diff --git a/CMakeLists.txt b/CMakeLists.txt index 3bc05b110..4a435860c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -156,11 +156,6 @@ 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() # FlightGear build options @@ -181,7 +176,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}) +option(SYSTEM_CPPUNIT "Set to ON to build Flightgear with the system's CppUnit library") # additional utilities option(ENABLE_FGELEV "Set to ON to build the fgelev application (default)" ON) @@ -279,6 +274,10 @@ if (ENABLE_SWIFT) endif() endif() +if (SYSTEM_CPPUNIT) + find_package(CppUnit REQUIRED) +endif() + # check required dependencies find_package(Boost REQUIRED) find_package(OpenGL REQUIRED)