CMakeLists.txt 1.0 KB

123456789101112131415161718192021222324252627282930
  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. add_executable(dorayme main.cpp)
  18. target_include_directories(rayonnement PUBLIC include ${LODEPNG_INCLUDE_FOLDER} ${LUA_INCLUDE_DIR})
  19. target_link_libraries(dorayme rayonnement ${LUA_LIBRARIES})
  20. if (COVERALLS)
  21. set(COVERAGE_SRCS ${RAY_HEADERS} ${RAY_SOURCES} ${COVERAGE_SRCS} PARENT_SCOPE)
  22. endif()