CMakeLists.txt 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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. if (USE_LUA)
  13. add_dependencies(rayonnement LuaCore)
  14. target_link_libraries(rayonnement ${LUA_LIBRARIES})
  15. endif()
  16. target_include_directories(rayonnement PUBLIC include ${LODEPNG_INCLUDE_FOLDER} ${LUA_INCLUDE_DIR})
  17. target_sources(rayonnement PRIVATE ${RAY_HEADERS} ${RAY_SOURCES})
  18. target_link_libraries(rayonnement LodePNG)
  19. if (USE_OPENMP)
  20. target_link_libraries(rayonnement OpenMP::OpenMP_CXX)
  21. endif()
  22. # The main executable
  23. add_executable(dorayme main.cpp)
  24. add_dependencies(dorayme LuaCore)
  25. target_link_libraries(dorayme rayonnement ${LUA_LIBRARIES})
  26. if (COVERALLS)
  27. set(COVERAGE_SRCS ${RAY_HEADERS} ${RAY_SOURCES} ${COVERAGE_SRCS} PARENT_SCOPE)
  28. endif()