8000 made build/run of self-test switched off a cache bool, defaults to of… · Reification/unittest-cpp@4e2213b · GitHub
[go: up one dir, main page]

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 4e2213b

Browse files
made build/run of self-test switched off a cache bool, defaults to off - fix for android build/install
1 parent 478b654 commit 4e2213b

File tree

1 file changed

+19
-14
lines changed

1 file changed

+19
-14
lines changed

CMakeLists.txt

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ file(GLOB headers_ RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} UnitTest++/*.h)
4242
file(GLOB sources_ RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} UnitTest++/*.cpp)
4343
source_group("" FILES ${headers_} ${sources_})
4444

45+
set(BUILD_SELF_TEST false CACHE BOOL "")
46+
4547
# get platform specific sources
4648
if (WIN32)
4749
add_definitions(-D_CRT_SECURE_NO_DEPRECATE)
@@ -63,24 +65,27 @@ endif()
6365

6466

6567
# 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})
7071

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(.)
7474

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++)
7680

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")
8185

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()
8489
endif()
8590

8691
# add install targets

0 commit comments

Comments
 (0)
0