cmake_minimum_required (VERSION 3.15) project (elm CXX) set (CMAKE_EXPORT_COMPILE_COMMANDS ON) if (CMAKE_CXX_COMPILER_ID MATCHES ".*Clang") add_compile_options(-fcolor-diagnostics) elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") add_compile_options(-fdiagnostics-color=always) else() message(STATUS "No colored compiler diagnostic set for '${CMAKE_CXX_COMPILER_ID}' compiler.") endif() # Link this 'library' to set the c++ standard / compile-time options requested add_library(project_options INTERFACE) target_compile_features(project_options INTERFACE cxx_std_17) add_executable (elmarch main.cpp) target_link_libraries (elmarch PRIVATE project_options)