daily pastebin goal
72%
SHARE
TWEET

CMakeLists.txt for 2nd project for UT&TDD

bartoszka1996 Mar 21st, 2019 56 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. cmake_minimum_required(VERSION 3.10)
  2. project(myProject)
  3.  
  4. set(CMAKE_CXX_STANDARD 17)
  5.  
  6. find_package(Threads REQUIRED)
  7. enable_testing()
  8.  
  9. add_subdirectory(googletest)
  10.  
  11. include_directories(${GTEST_SOURCE_DIR}/include ${GTEST_SOURCE_DIR})
  12. include_directories(${GMOCK_SOURCE_DIR}/include ${GMOCK_SOURCE_DIR})
  13.  
  14. file(GLOB SOURCES "src/*.hpp" "src/*.h" "src/*.cpp" "include/*.hpp" "include/*.h" "include/*.cpp")
  15. file(GLOB TEST_SOURCES "uts/*.hpp" "uts/*.h" "uts/*.cpp")
  16.  
  17. add_executable(runAllTests ${TEST_SOURCES} ${SOURCES})
  18. add_executable(myProject app/main.cpp ${SOURCES})
  19.  
  20. target_link_libraries(runAllTests gtest gmock)
  21. target_link_libraries(runAllTests Threads::Threads)
  22. add_test(AllTests runAllTests)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top