From 3c73600237526ab09b77c5bd1750762a3ebd1c00 Mon Sep 17 00:00:00 2001 From: Edward d'Auvergne Date: Tue, 6 Mar 2018 10:24:13 +0100 Subject: [PATCH] TestSuite: Addition of the SYSTEM_CPPUNIT option for distributors. This is to allow for selecting between a system installed version of CppUnit or the version bundled with flightgear. --- 3rdparty/CMakeLists.txt | 4 ++++ CMakeLists.txt | 14 +++++++------- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/3rdparty/CMakeLists.txt b/3rdparty/CMakeLists.txt index 6eb756871..0c8b87f2a 100644 --- a/3rdparty/CMakeLists.txt +++ b/3rdparty/CMakeLists.txt @@ -29,3 +29,7 @@ endif() if (ENABLE_HID_INPUT) add_subdirectory(hidapi) endif() + +if (NOT SYSTEM_CPPUNIT) + add_subdirectory(cppunit) +endif() diff --git a/CMakeLists.txt b/CMakeLists.txt index 372fbc59c..4204057c4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -160,6 +160,11 @@ elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux" OR if(HTS_ENGINE_FOUND) set(SYSTEM_HTS_ENGINE_DEFAULT 1) endif() + + find_package(CppUnit) + if (CPPUNIT_FOUND) + set(SYSTEM_CPPUNIT_DEFAULT 1) + endif() endif() find_package(Git) @@ -191,6 +196,7 @@ option(SYSTEM_SPEEX "Set to ON to build IAXClient with the system's speex a option(SYSTEM_GSM "Set to ON to build IAXClient with the system's GSM library" ${SYSTEM_GSM_DEFAULT}) option(SYSTEM_FLITE "Set to ON to build Flightgear with the system's Flite library" ${SYSTEM_FLITE_DEFAULT}) option(SYSTEM_HTS_ENGINE "Set to ON to build Flightgear with the system's HTS Engine library" ${SYSTEM_HTS_ENGINE_DEFAULT}) +option(SYSTEM_CPPUNIT "Set to ON to build Flightgear with the system's CppUnit library" ${SYSTEM_CPPUNIT_DEFAULT}) # additional utilities option(ENABLE_FGELEV "Set to ON to build the fgelev application (default)" ON) @@ -603,10 +609,4 @@ ADD_CUSTOM_TARGET(uninstall # The test suite. -find_package(CppUnit) -if (CPPUNIT_FOUND) - message(STATUS "CppUnit found.") - add_subdirectory(test_suite EXCLUDE_FROM_ALL) -else() - message(STATUS "CppUnit not found.") -endif() +add_subdirectory(test_suite EXCLUDE_FROM_ALL)