CMakeLists.txt 1017 B

12345678910111213141516171819202122
  1. # ---[ gtest
  2. if(NOT build_gtest_already)
  3. add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../../3rdparty/googletest ${PROJECT_BINARY_DIR}/googletest)
  4. set(build_gtest_already ON)
  5. endif()
  6. include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../3rdparty/googletest/googletest/include)
  7. include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../core/src)
  8. # ---[ gflags
  9. include(${CMAKE_CURRENT_SOURCE_DIR}/../../cmake/FindGFlags.cmake)
  10. include_directories(${GFLAGS_INCLUDE_DIRS})
  11. include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include/)
  12. aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR}/core core_test_srcs)
  13. list(APPEND core_test_srcs ${CMAKE_CURRENT_SOURCE_DIR}/test_base.cpp)
  14. list(APPEND core_test_srcs ${CMAKE_CURRENT_SOURCE_DIR}/test_main.cpp)
  15. add_executable(cnstream_core_test ${core_test_srcs})
  16. add_dependencies(cnstream_core_test cnstream_core gtest)
  17. target_link_libraries(cnstream_core_test gtest dl cnstream_core pthread rt ${GFLAGS_LIBRARIES})
  18. add_test(cnstream_core_test ${EXECUTABLE_OUTPUT_PATH}/cnstream_core_test)