File tree Expand file tree Collapse file tree 1 file changed +9
-10
lines changed Expand file tree Collapse file tree 1 file changed +9
-10
lines changed Original file line number Diff line number Diff line change @@ -4,8 +4,8 @@ project(UnitTest++)
4
4
option (UTPP_USE_PLUS_SIGN
5
5
"Set this to OFF if you wish to use '-cpp' instead of '++' in lib/include paths"
6
6
ON )
7
- option (UTPP_RUN_TESTS_AS_BUILD_STEP
8
- "Set this to OFF if you do not wish unit tests to run as part of cmake --build"
7
+ option (UTPP_INCLUDE_TESTS_IN_BUILD
8
+ "Set this to OFF if you do not wish to automatically build or run unit tests as part of the default cmake --build"
9
9
ON )
10
10
11
11
if (MSVC14 OR MSVC12 )
@@ -60,14 +60,13 @@ endif()
60
60
61
61
target_link_libraries (TestUnitTest++ UnitTest++ )
62
62
63
- if (${UTPP_RUN_TESTS_AS_BUILD_STEP} )
64
- # run unit tests as post build step
65
- add_custom_command (TARGET TestUnitTest++
66
- POST_BUILD COMMAND TestUnitTest++
67
- COMMENT "Running unit tests" )
68
- else ()
69
- add_custom_command (TARGET TestUnitTest++
70
- POST_BUILD COMMAND echo "TestUnitTest++ was not run as a build step because UTPP_RUN_TESTS_AS_BUILD_STEP is OFF" )
63
+ # run unit tests as post build step
64
<
65E8
td data-grid-cell-id="diff-1e7de1ae2d059d21e1dd75d5812d5a34b0222cef273b7c3a2af62eb747f9d20a-70-64-2" data-line-anchor="diff-1e7de1ae2d059d21e1dd75d5812d5a34b0222cef273b7c3a2af62eb747f9d20aR64" data-selected="false" role="gridcell" style="background-color:var(--diffBlob-additionLine-bgColor, var(--diffBlob-addition-bgColor-line));padding-right:24px" tabindex="-1" valign="top" class="focusable-grid-cell diff-text-cell right-side-diff-cell left-side">+ add_custom_command (TARGET TestUnitTest++
65
+ POST_BUILD COMMAND TestUnitTest++
66
+ COMMENT "Running unit tests" )
67
+
68
+ if (NOT ${UTPP_INCLUDE_TESTS_IN_BUILD} )
69
+ set_target_properties (TestUnitTest++ PROPERTIES EXCLUDE_FROM_ALL 1 )
71
70
endif ()
72
71
73
72
# add install targets
You can’t perform that action at this time.
0 commit comments