File tree Expand file tree Collapse file tree 1 file changed +15
-5
lines changed Expand file tree Collapse file tree 1 file changed +15
-5
lines changed Original file line number Diff line number Diff line change 1
1
cmake_minimum_required (VERSION 2.8.1 )
2
2
project (UnitTest++ )
3
3
4
- option (UTPP_USE_PLUS_SIGN "Set this to OFF if you wish to use '-cpp' instead of '++' in lib/include paths" ON )
4
+ option (UTPP_USE_PLUS_SIGN
5
+ "Set this to OFF if you wish to use '-cpp' instead of '++' in lib/include paths"
6
+ ON )
7
+ option (UTPP_SKIP_TESTS_AS_BUILD_STEP
8
+ "Set this to ON if you do not wish unit tests to run as part of cmake --build"
9
+ OFF )
5
10
6
11
if (MSVC14 OR MSVC12 )
7
12
# has the support we need
@@ -55,10 +60,15 @@ endif()
55
60
56
61
target_link_libraries (TestUnitTest++ UnitTest++ )
57
62
58
- # run unit tests as post build step
59
- add_custom_command (TARGET TestUnitTest++
60
- POST_BUILD COMMAND TestUnitTest++
61
- COMMENT "Running unit tests" )
63
+ if (${UTPP_SKIP_TESTS_AS_BUILD_STEP} )
64
+ add_custom_command (TARGET TestUnitTest++
65
+ POST_BUILD COMMAND echo "TestUnitTest++ was not run as a build step because UTPP_SKIP_TESTS_AS_BUILD_STEP is ON" )
66
+ else ()
67
+ # run unit tests as post build step
68
+ add_custom_command (TARGET TestUnitTest++
69
+ POST_BUILD COMMAND TestUnitTest++
70
+ COMMENT "Running unit tests" )
71
+ endif ()
62
72
63
73
# add install targets
64
74
# need a custom install path?
You can’t perform that action at this time.
0 commit comments