@@ -42,6 +42,8 @@ file(GLOB headers_ RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} UnitTest++/*.h)
42
42
file (GLOB sources_ RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} UnitTest++/*.cpp)
43
43
source_group ("" FILES ${headers_} ${sources_} )
44
44
45
+ set (BUILD_SELF_TEST false CACHE BOOL "" )
46
+
45
47
# get platform specific sources
46
48
if (WIN32 )
47
49
add_definitions (-D_CRT_SECURE_NO_DEPRECATE)
@@ -63,24 +65,27 @@ endif()
63
65
64
66
65
67
# build the test runner
66
- file (GLOB TEST_SRCS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} tests/*.cpp tests/*.h)
67
- source_group ( "" FILES ${TEST_SRCS} )
68
- add_executable (TestUnitTest++ ${TEST_SRCS} )
69
- include_directories (.)
68
+ if (BUILD_SELF_TEST)
69
+ file (GLOB TEST_SRCS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} tests/*.cpp tests/*.h)
70
+ source_group ( "" FILES ${TEST_SRCS} )
70
71
71
- if (${UTPP_USE_PLUS_SIGN} )
72
- set_target_properties (TestUnitTest++ PROPERTIES OUTPUT_NAME TestUnitTest++)
73
- endif ()
72
+ add_executable (TestUnitTest++ ${TEST_SRCS} )
73
+ include_directories (.)
74
74
75
- target_link_libraries (TestUnitTest++ UnitTest++)
75
+ if (${UTPP_USE_PLUS_SIGN} )
76
+ set_target_properties (TestUnitTest++ PROPERTIES OUTPUT_NAME TestUnitTest++)
77
+ endif ()
78
+
79
+ target_link_libraries (TestUnitTest++ UnitTest++)
76
80
77
- # run unit tests as post build step
78
- add_custom_command (TARGET TestUnitTest++
79
- POST_BUILD COMMAND TestUnitTest++
80
- COMMENT "Running unit tests" )
81
+ # run unit tests as post build step
82
+ add_custom_command (TARGET TestUnitTest++
83
+ POST_BUILD COMMAND TestUnitTest++
84
+ COMMENT "Running unit tests" )
81
85
82
- if (NOT ${UTPP_INCLUDE_TESTS_IN_BUILD} )
83
- set_target_properties (TestUnitTest++ PROPERTIES EXCLUDE_FROM_ALL 1)
86
+ if (NOT ${UTPP_INCLUDE_TESTS_IN_BUILD} )
87
+ set_target_properties (TestUnitTest++ PROPERTIES EXCLUDE_FROM_ALL 1)
88
+ endif ()
84
89
endif ()
85
90
86
91
# add install targets
0 commit comments