cmake_minimum_required(VERSION 3.9) # Make sure the user doesn't play dirty with symlinks get_filename_component(srcdir "${CMAKE_SOURCE_DIR}" REALPATH) get_filename_component(bindir "${CMAKE_BINARY_DIR}" REALPATH) # Disallow in-source builds if(${srcdir} STREQUAL ${bindir}) message(FATAL_ERROR "In-source builds are not allowed." " Please create a directory and run cmake from there, passing the path" " to this source directory as the last argument. This process created" " the file `CMakeCache.txt' and the directory `CMakeFiles' in ${srcdir}." " Please remove them.") endif() project(odm CXX) set(CMAKE_CXX_STANDARD 20) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_INTERPROCEDURAL_OPTIMIZATION ON) include_directories(include) add_compile_options(-Wall) # Dwarf-4 support check include(CheckCXXCompilerFlag) CHECK_CXX_COMPILER_FLAG(-gdwarf-4 COMPILER_SUPPORTS_DWARF4) if(COMPILER_SUPPORTS_DWARF4 AND (CMAKE_BUILD_TYPE STREQUAL "Debug" OR CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")) add_compile_options(-gdwarf-4) endif() add_subdirectory(src)