CMakeLists.txt 763 B

123456789101112131415161718192021
  1. cmake_minimum_required(VERSION 2.8)
  2. set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/test)
  3. # Setup testing
  4. enable_testing()
  5. # dependencies used by tests only
  6. find_package(GTest REQUIRED)
  7. find_package(GMock REQUIRED)
  8. include_directories(${Boost_INCLUDE_DIR} ${JSONCPP_INCLUDE_DIRS} ${GTEST_INCLUDE_DIRS} ${GMOCK_INCLUDE_DIRS})
  9. # Add test cpp file
  10. add_executable(jsonCommanderTest test/JsonCommanderTest.cpp src/JsonCommander.cpp src/FileManager.cpp src/base64.cpp test/ConfigMock.cpp test/UserManagerMock.cpp src/Notifications.cpp)
  11. target_link_libraries(jsonCommanderTest ${CMAKE_THREAD_LIBS_INIT} ${Boost_LIBRARIES} ${JSONCPP_LIBRARIES} ${GTEST_BOTH_LIBRARIES} ${GMOCK_BOTH_LIBRARIES})
  12. add_test(
  13. NAME jsonCommanderTest
  14. COMMAND jsonCommanderTest
  15. )