CMakeLists.txt 1.5 KB

12345678910111213141516171819202122232425262728
  1. set(Boost_USE_STATIC_LIBS OFF)
  2. find_package(Boost REQUIRED COMPONENTS unit_test_framework)
  3. include_directories(${Boost_INCLUDE_DIRS})
  4. file(GLOB_RECURSE TEST_CORE_SRC_FILES ./core/*.cpp)
  5. add_executable(test_core ${TEST_CORE_SRC_FILES} ${CORE_SRC_FILES})
  6. target_compile_definitions(test_core PUBLIC SOPHIAR_TEST)
  7. target_link_libraries(test_core ${Boost_LIBRARIES} ${BASIC_LIBS})
  8. file(GLOB_RECURSE TEST_UTILITY_SRC_FILES ./utility/*.cpp)
  9. add_executable(test_utility ${TEST_UTILITY_SRC_FILES} ${CORE_SRC_FILES})
  10. target_compile_definitions(test_utility PUBLIC SOPHIAR_TEST)
  11. target_link_libraries(test_utility ${Boost_LIBRARIES} ${BASIC_LIBS})
  12. file(GLOB_RECURSE TEST_ALGORITHM_SRC_FILES ./algorithm/*.cpp)
  13. add_executable(test_algorithm ${TEST_ALGORITHM_SRC_FILES} ${CORE_SRC_FILES})
  14. target_compile_definitions(test_algorithm PUBLIC SOPHIAR_TEST SOPHIAR_TEST_ALGORITHM)
  15. target_link_libraries(test_algorithm ${Boost_LIBRARIES} ${BASIC_LIBS} sophiar_algorithm)
  16. file(GLOB_RECURSE TEST_ROBOT_SRC_FILES ./robot/*.cpp)
  17. add_executable(test_robot ${TEST_ROBOT_SRC_FILES} ${CORE_SRC_FILES})
  18. target_compile_definitions(test_robot PUBLIC SOPHIAR_TEST SOPHIAR_TEST_ROBOT)
  19. target_link_libraries(test_robot ${Boost_LIBRARIES} ${BASIC_LIBS} sophiar_robot)
  20. file(GLOB_RECURSE TEST_SENSOR_SRC_FILES ./sensor/*.cpp)
  21. add_executable(test_sensor ${TEST_SENSOR_SRC_FILES} ${CORE_SRC_FILES})
  22. target_compile_definitions(test_sensor PUBLIC SOPHIAR_TEST SOPHIAR_TEST_SENSOR)
  23. target_link_libraries(test_sensor ${Boost_LIBRARIES} ${BASIC_LIBS} sophiar_sensor)