CMakeLists.txt 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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. ${CMAKE_CURRENT_SOURCE_DIR}/uvpattern/*.h)
  10. file(GLOB RAY_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp ${CMAKE_CURRENT_SOURCE_DIR}/shapes/*.cpp
  11. ${CMAKE_CURRENT_SOURCE_DIR}/worldbuilder/*.cpp)
  12. target_include_directories(rayonnement PUBLIC include pattern)
  13. if (USE_LUA)
  14. add_dependencies(rayonnement LuaCore)
  15. target_link_libraries(rayonnement ${LUA_LIBRARIES})
  16. endif()
  17. target_include_directories(rayonnement PUBLIC include ${LODEPNG_INCLUDE_FOLDER} ${LUA_INCLUDE_DIR})
  18. target_sources(rayonnement PRIVATE ${RAY_HEADERS} ${RAY_SOURCES})
  19. target_link_libraries(rayonnement LodePNG)
  20. if (USE_OPENMP)
  21. target_link_libraries(rayonnement OpenMP::OpenMP_CXX)
  22. endif()
  23. # The main executable
  24. #add_executable(dorayme main.cpp)
  25. #add_dependencies(dorayme LuaCore)
  26. #target_link_libraries(dorayme rayonnement ${LUA_LIBRARIES})
  27. if (COVERALLS)
  28. set(COVERAGE_SRCS ${RAY_HEADERS} ${RAY_SOURCES} ${COVERAGE_SRCS} PARENT_SCOPE)
  29. endif()