1
0
Fork 0

Use the system CppUnit only when -DSYSTEM_CPPUNIT=ON is passed to CMake

According to the discussion around [1], using the system CppUnit library
is rarely useful but likely to cause problems (due to possible
incompatibilities between versions); that is, unless people doing so
really know what they are doing. For this reason, this commit changes
the CMake config logic as follows: the system CppUnit library is now
only used when explicitly asked for with -DSYSTEM_CPPUNIT=ON on the
CMake command line.

[1] https://sourceforge.net/p/flightgear/mailman/message/36636483/
This commit is contained in:
Florent Rougon 2019-04-11 22:01:10 +02:00
parent 4e8e69b4f8
commit b405bd47d0

View file

@ -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)