Skip to content
This repository was archived by the owner on Jul 8, 2022. It is now read-only.

Commit b3235be

Browse files
t-bmliszcz
andcommitted
CMakeLists.txt: Rework test suite handling
We now support switching the test suite build off using the standard CTest option BUILD_TESTING. This allows environments where the test compilation fails to skip it in a consistent manner. This also removes the unconditional call to enable_testing() which the CTest module now does only if BUILD_TESTING is ON. Co-authored-by: Michal Liszcz <liszcz.michal@gmail.com>
1 parent 93df4fc commit b3235be

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
cmake_minimum_required(VERSION 2.8.12)
22
include(CTest)
33

4-
enable_testing()
54
#need to define the version of the library
65
set(MAJOR_VERSION "9")
76
set(MINOR_VERSION "3")
@@ -32,9 +31,10 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR}/log4tango/include)
3231
#source code
3332
add_subdirectory("log4tango")
3433
add_subdirectory("cppapi")
35-
if(NOT WIN32)
34+
35+
if(BUILD_TESTING)
3636
add_subdirectory("cpp_test_suite")
37-
endif(NOT WIN32)
37+
endif()
3838

3939
if(WIN32)
4040
include(configure/cmake_win.cmake)

INSTALL.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
- `-DCMAKE_BUILD_TYPE=<Release|Debug>`
2828
- `-DCMAKE_VERBOSE_MAKEFILE=true`
2929
- `-DTANGO_USE_USING_NAMESPACE=<ON|OFF>` choose `OFF` for modern builds
30+
- `-DBUILD_TESTING=<ON|OFF>` Build the test suite (`ON` by default)
3031

3132
Typical output:
3233

appveyor.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -255,10 +255,10 @@ install:
255255
- cmd: set PTHREAD_WIN=C:/projects/pthreads-win32/
256256
#- cmd: cmake -G "%CMAKE_GENERATOR%" -DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=TRUE -DBUILD_SHARED_LIBS=TRUE .
257257
#- cmd: cmake -G "%CMAKE_GENERATOR%" -DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=TRUE .
258-
- cmd: cmake -G "%CMAKE_GENERATOR%" -DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=TRUE -DIDL_BASE="%IDL_BASE%" -DOMNI_BASE="%OMNI_BASE%" -DZMQ_BASE="%ZMQ_BASE%" -DPTHREAD_WIN=%PTHREAD_WIN% .
258+
- cmd: cmake -G "%CMAKE_GENERATOR%" -DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=TRUE -DIDL_BASE="%IDL_BASE%" -DOMNI_BASE="%OMNI_BASE%" -DZMQ_BASE="%ZMQ_BASE%" -DPTHREAD_WIN=%PTHREAD_WIN% -DBUILD_TESTING=OFF .
259259
- cmd: cd c:/projects/debug_build
260260
#- cmd: cmake -G "%CMAKE_GENERATOR%" -DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=TRUE -DBUILD_SHARED_LIBS=TRUE -DCMAKE_BUILD_TYPE=Debug .
261-
- cmd: cmake -G "%CMAKE_GENERATOR%" -DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=TRUE -DCMAKE_BUILD_TYPE=Debug -DIDL_BASE="%IDL_BASE%" -DOMNI_BASE="%OMNI_BASE%" -DZMQ_BASE="%ZMQ_BASE%" -DPTHREAD_WIN=%PTHREAD_WIN% .
261+
- cmd: cmake -G "%CMAKE_GENERATOR%" -DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=TRUE -DCMAKE_BUILD_TYPE=Debug -DIDL_BASE="%IDL_BASE%" -DOMNI_BASE="%OMNI_BASE%" -DZMQ_BASE="%ZMQ_BASE%" -DPTHREAD_WIN=%PTHREAD_WIN% -DBUILD_TESTING=OFF .
262262

263263
clone_folder: C:\projects\cppTango
264264

0 commit comments

Comments
 (0)