CMakeLists.txt 1.0 KB

1234567891011121314151617181920212223242526272829
  1. # To simplify testing, the app is build in two passes,
  2. option(USE_OPENMP "Build using OpenMP" OFF)
  3. if (USE_OPENMP)
  4. find_package(OpenMP REQUIRED)
  5. endif()
  6. # First most is build as a library
  7. add_library(rayonnement STATIC)
  8. file(GLOB RAY_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/include/*.h ${CMAKE_CURRENT_SOURCE_DIR}/pattern/*.h)
  9. file(GLOB RAY_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp ${CMAKE_CURRENT_SOURCE_DIR}/shapes/*.cpp
  10. ${CMAKE_CURRENT_SOURCE_DIR}/worldbuilder/*.cpp)
  11. target_include_directories(rayonnement PUBLIC include pattern)
  12. target_sources(rayonnement PRIVATE ${RAY_HEADERS} ${RAY_SOURCES})
  13. target_link_libraries(rayonnement LodePNG)
  14. if (USE_OPENMP)
  15. target_link_libraries(rayonnement OpenMP::OpenMP_CXX)
  16. endif()
  17. # Second we build the main executable
  18. add_executable(dorayme main.cpp)
  19. target_include_directories(rayonnement PUBLIC include ${LODEPNG_INCLUDE_FOLDER})
  20. target_link_libraries(dorayme rayonnement)
  21. if (COVERALLS)
  22. set(COVERAGE_SRCS ${RAY_HEADERS} ${RAY_SOURCES} ${COVERAGE_SRCS} PARENT_SCOPE)
  23. endif()