Skip to content

Commit

Permalink
Add a CMake option to activate or deactivate unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
doom committed Jan 19, 2019
1 parent ffb1533 commit bbeb6d7
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,14 @@ target_sources(strong_type INTERFACE ${STRONG_TYPE_SOURCES})

target_include_directories(strong_type INTERFACE include)

find_package(GTest REQUIRED)
option(STRONG_TYPE_BUILD_TESTS "Build tests of the strong_type library" OFF)

add_executable(strong_type-tests
tests/strong_type-tests.cpp
)
if (STRONG_TYPE_BUILD_TESTS)
find_package(GTest REQUIRED)

add_executable(strong_type-tests
tests/strong_type-tests.cpp
)

target_link_libraries(strong_type-tests strong_type GTest::GTest GTest::Main)
target_link_libraries(strong_type-tests strong_type GTest::GTest GTest::Main)
endif ()

0 comments on commit bbeb6d7

Please sign in to comment.