CMakeLists.txt 1.0 KB

1234567891011121314151617181920212223242526272829
  1. cmake_minimum_required(VERSION 3.5)
  2. project(BinOM VERSION 0.1 LANGUAGES CXX)
  3. # CXX Compiler config
  4. message("Build type: ${CMAKE_BUILD_TYPE}")
  5. set(CMAKE_CXX_STANDARD 20)
  6. set(CMAKE_CXX_STANDARD_REQUIRED ON)
  7. set(CMAKE_CXX_FLAGS "-fPIC")
  8. set(CMAKE_CXX_FLAGS_DEBUG_INIT "-g -O0 -fno-inline-small-functions -Wall")
  9. set(CMAKE_CXX_FLAGS_RELEASE_INIT "-O3 -Wall")
  10. # Source files searching
  11. file(GLOB_RECURSE SOURCE_LIB RELATIVE ${CMAKE_SOURCE_DIR} "libbinom/source/*.cxx")
  12. message("Library sources
  13. ${SOURCE_LIB}")
  14. file(GLOB_RECURSE SOURCE_TEST RELATIVE ${CMAKE_SOURCE_DIR} "test/*.cxx")
  15. message("Test sources
  16. ${SOURCE_TEST}")
  17. add_library(binom STATIC ${SOURCE_LIB})
  18. target_include_directories(binom PRIVATE RELATIVE ${CMAKE_SOURCE_DIR} ".")
  19. target_include_directories(binom PRIVATE RELATIVE ${CMAKE_SOURCE_DIR} "libbinom/include")
  20. add_executable(test ${SOURCE_TEST})
  21. target_include_directories(test PRIVATE RELATIVE ${CMAKE_SOURCE_DIR} ".")
  22. target_include_directories(test PRIVATE RELATIVE ${CMAKE_SOURCE_DIR} "libbinom/include")
  23. target_link_libraries(test binom)