]> git.mxchange.org Git - simgear.git/blob - CMakeLists.txt
Remove old terraysnc backend methods.
[simgear.git] / CMakeLists.txt
1 cmake_minimum_required (VERSION 2.8.11)
2
3 if(COMMAND cmake_policy)
4    if(POLICY CMP0054)
5        cmake_policy(SET CMP0054 NEW)
6    endif()
7    if(POLICY CMP0042)
8        cmake_policy(SET CMP0042 NEW)
9    endif()
10 endif()
11
12 include (CheckFunctionExists)
13 include (CheckIncludeFile)
14 include (CheckLibraryExists)
15 include (CheckCXXSourceCompiles)
16 include (CheckCXXCompilerFlag)
17 include (GenerateExportHeader)
18
19 # using 10.7 because boost requires libc++ and 10.6 doesn't include it
20 set(CMAKE_OSX_DEPLOYMENT_TARGET 10.7)
21
22 # only relevant for building shared libs but let's set it regardless
23 set(CMAKE_OSX_RPATH 1)
24
25 # Set the C++ standard to C++98 to avoid compilation errors on GCC 6 (which
26 # defaults to C++14).
27 if(CMAKE_VERSION VERSION_LESS "3.1")
28   if(CMAKE_COMPILER_IS_GNUCXX)
29     set (CMAKE_CXX_FLAGS "-std=gnu++98 ${CMAKE_CXX_FLAGS}")
30   endif()
31 else()
32   set (CMAKE_CXX_STANDARD 98)
33 endif()
34
35 project(SimGear)
36
37 # read 'version' file into a variable (stripping any newlines or spaces)
38 file(READ version versionFile)
39 string(STRIP ${versionFile} SIMGEAR_VERSION)
40
41 set(FIND_LIBRARY_USE_LIB64_PATHS ON)
42
43 # use simgear version also as the SO version (if building SOs)
44 SET(SIMGEAR_SOVERSION ${SIMGEAR_VERSION})
45
46 # Warning when build is not an out-of-source build.
47 string(COMPARE EQUAL "${CMAKE_SOURCE_DIR}" "${CMAKE_BINARY_DIR}" InSourceBuild)
48 if(InSourceBuild)
49     message(WARNING  "Avoid building inside the source tree!")
50     message(WARNING  "Create a separate build directory instead (i.e. 'sgbuild') and call CMake from there: ")
51     message(WARNING  "  mkdir ../sgbuild && cd ../sgbuild && cmake ${CMAKE_SOURCE_DIR}")
52 endif(InSourceBuild)
53
54 #packaging
55 SET(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/COPYING")
56 SET(CPACK_RESOURCE_FILE_README "${PROJECT_SOURCE_DIR}/README")
57 SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Simulation support libraries for FlightGear and related projects")
58 SET(CPACK_PACKAGE_VENDOR "The FlightGear project")
59 SET(CPACK_GENERATOR "TBZ2")
60 SET(CPACK_INSTALL_CMAKE_PROJECTS  ${CMAKE_CURRENT_BINARY_DIR};SimGear;ALL;/)
61
62
63 # split version string into components, note CMAKE_MATCH_0 is the entire regexp match
64 string(REGEX MATCH "([0-9]+)\\.([0-9]+)\\.([0-9]+)" CPACK_PACKAGE_VERSION ${SIMGEAR_VERSION} )
65 set(CPACK_PACKAGE_VERSION_MAJOR ${CMAKE_MATCH_1})
66 set(CPACK_PACKAGE_VERSION_MINOR ${CMAKE_MATCH_2})
67 set(CPACK_PACKAGE_VERSION_PATCH ${CMAKE_MATCH_3})
68
69 message(STATUS "version is ${CPACK_PACKAGE_VERSION_MAJOR} dot ${CPACK_PACKAGE_VERSION_MINOR} dot ${CPACK_PACKAGE_VERSION_PATCH}")
70
71 set(CPACK_SOURCE_GENERATOR TBZ2)
72 set(CPACK_SOURCE_PACKAGE_FILE_NAME "simgear-${SIMGEAR_VERSION}" CACHE INTERNAL "tarball basename")
73 set(CPACK_SOURCE_IGNORE_FILES
74   "^${PROJECT_SOURCE_DIR}/.git;\\\\.gitignore;Makefile.am;~$;${CPACK_SOURCE_IGNORE_FILES}")
75
76 message(STATUS "ignoring: ${CPACK_SOURCE_IGNORE_FILES}")
77
78 include (CPack)
79
80 # We have some custom .cmake scripts not in the official distribution.
81 set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/CMakeModules;${CMAKE_MODULE_PATH}")
82
83 # Change the default build type to something fast
84 if(NOT CMAKE_BUILD_TYPE)
85   set(CMAKE_BUILD_TYPE Release CACHE STRING
86       "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel."
87       FORCE)
88 endif(NOT CMAKE_BUILD_TYPE)
89
90 # Determine name of library installation directory, i.e. "lib" vs "lib64", which
91 # differs between all Debian-based vs all other Linux distros.
92 # See cmake bug #11964, http://cmake.org/gitweb?p=cmake.git;a=commit;h=126c993d
93 include(GNUInstallDirs)
94 message(STATUS "Library installation directory: ${CMAKE_INSTALL_LIBDIR}")
95
96 #####################################################################################
97 # Configure library search paths
98 #####################################################################################
99
100 if(NOT "${CMAKE_LIBRARY_ARCHITECTURE}" STREQUAL "")
101     # Workaround for Ubuntu/Debian which introduced the "multiarch" library
102     # directory structure, which is unsupported by CMake < 2.8.10, so we need to
103     # add paths manually
104     # see http://www.cmake.org/Bug/view.php?id=12049 and
105     # http://www.cmake.org/Bug/view.php?id=12037
106     list(APPEND ADDITIONAL_LIBRARY_PATHS
107          /usr/local/lib/${CMAKE_LIBRARY_ARCHITECTURE}
108          /usr/lib/${CMAKE_LIBRARY_ARCHITECTURE}
109          /lib/${CMAKE_LIBRARY_ARCHITECTURE})
110     message(STATUS "additional library directories: ${ADDITIONAL_LIBRARY_PATHS}")
111 endif()
112
113 #####################################################################################
114
115 if (NOT MSVC)
116 option(SIMGEAR_SHARED   "Set to ON to build SimGear as a shared library/framework" OFF)
117 option(SYSTEM_EXPAT     "Set to ON to build SimGear using the system expat library" OFF)
118 option(SYSTEM_UDNS      "Set to ON to build SimGear using the system udns library" OFF)
119 else()
120 # Building SimGear DLLs is currently not supported for MSVC.
121 set(SIMGEAR_SHARED OFF)
122 # Using external 3rd party libraries is currently not supported for MSVC - it would require shared simgear (DLL).
123 set(SYSTEM_EXPAT OFF)
124 set(SYSTEM_UDNS OFF)
125 endif()
126
127 option(SIMGEAR_HEADLESS "Set to ON to build SimGear without GUI/graphics support" OFF)
128 option(ENABLE_RTI       "Set to ON to build SimGear with RTI support" OFF)
129 option(ENABLE_TESTS     "Set to OFF to disable building SimGear's test applications" ON)
130 option(ENABLE_SOUND     "Set to OFF to disable building SimGear's sound support" ON)
131 option(ENABLE_PKGUTIL   "Set to ON to build the sg_pkgutil application (default)" ON)
132 option(ENABLE_DNS       "Set to ON to use udns library and DNS service resolver" ON)
133
134 if (MSVC)
135   GET_FILENAME_COMPONENT(PARENT_DIR ${PROJECT_BINARY_DIR} PATH)
136   if (CMAKE_CL_64)
137     SET(TEST_3RDPARTY_DIR "${PARENT_DIR}/3rdparty.x64")
138   else (CMAKE_CL_64)
139     SET(TEST_3RDPARTY_DIR "${PARENT_DIR}/3rdparty")
140   endif (CMAKE_CL_64)
141   if (EXISTS ${TEST_3RDPARTY_DIR})
142     set(MSVC_3RDPARTY_ROOT ${PARENT_DIR} CACHE PATH "Location where the third-party dependencies are extracted")
143   else (EXISTS ${TEST_3RDPARTY_DIR})
144     set(MSVC_3RDPARTY_ROOT NOT_FOUND CACHE PATH "Location where the third-party dependencies are extracted")
145   endif (EXISTS ${TEST_3RDPARTY_DIR})
146 else (MSVC)
147   set(MSVC_3RDPARTY_ROOT NOT_FOUND CACHE PATH "Location where the third-party dependencies are extracted")
148 endif (MSVC)
149
150 if (MSVC AND MSVC_3RDPARTY_ROOT)
151   message(STATUS "3rdparty files located in ${MSVC_3RDPARTY_ROOT}")
152   set( OSG_MSVC "msvc" )
153   if (${MSVC_VERSION} EQUAL 1700)
154       set( OSG_MSVC ${OSG_MSVC}110 )
155   elseif (${MSVC_VERSION} EQUAL 1600)
156       set( OSG_MSVC ${OSG_MSVC}100 )
157   else (${MSVC_VERSION} EQUAL 1700)
158       set( OSG_MSVC ${OSG_MSVC}90 )
159   endif (${MSVC_VERSION} EQUAL 1700)
160   if (CMAKE_CL_64)
161       set( OSG_MSVC ${OSG_MSVC}-64 )
162       set( MSVC_3RDPARTY_DIR 3rdParty.x64 )
163   else (CMAKE_CL_64)
164       set( MSVC_3RDPARTY_DIR 3rdParty )
165   endif (CMAKE_CL_64)
166
167   set (CMAKE_LIBRARY_PATH ${MSVC_3RDPARTY_ROOT}/${MSVC_3RDPARTY_DIR}/lib ${MSVC_3RDPARTY_ROOT}/install/${OSG_MSVC}/OpenScenegraph/lib ${MSVC_3RDPARTY_ROOT}/install/${OSG_MSVC}/OpenRTI/lib )
168   set (CMAKE_INCLUDE_PATH ${MSVC_3RDPARTY_ROOT}/${MSVC_3RDPARTY_DIR}/include ${MSVC_3RDPARTY_ROOT}/install/${OSG_MSVC}/OpenScenegraph/include ${MSVC_3RDPARTY_ROOT}/install/${OSG_MSVC}/OpenRTI/include)
169   find_path(BOOST_ROOT boost/version.hpp
170                         ${MSVC_3RDPARTY_ROOT}/boost
171                         ${MSVC_3RDPARTY_ROOT}/boost_1_52_0
172                         ${MSVC_3RDPARTY_ROOT}/boost_1_51_0
173                         ${MSVC_3RDPARTY_ROOT}/boost_1_50_0
174                         ${MSVC_3RDPARTY_ROOT}/boost_1_49_0
175                         ${MSVC_3RDPARTY_ROOT}/boost_1_48_0
176                         ${MSVC_3RDPARTY_ROOT}/boost_1_47_0
177                         ${MSVC_3RDPARTY_ROOT}/boost_1_46_1
178                         ${MSVC_3RDPARTY_ROOT}/boost_1_46_0
179                         ${MSVC_3RDPARTY_ROOT}/boost_1_45_0
180                         ${MSVC_3RDPARTY_ROOT}/boost_1_44_0
181                         )
182   # set (BOOST_ROOT ${MSVC_3RDPARTY_ROOT}/boost_1_44_0)
183   message(STATUS "BOOST_ROOT is ${BOOST_ROOT}")
184   set (OPENAL_INCLUDE_DIR ${MSVC_3RDPARTY_ROOT}/${MSVC_3RDPARTY_DIR}/include)
185   set (OPENAL_LIBRARY_DIR ${MSVC_3RDPARTY_ROOT}/${MSVC_3RDPARTY_DIR}/lib)
186 endif (MSVC AND MSVC_3RDPARTY_ROOT)
187
188 if(APPLE)
189   find_library(COCOA_LIBRARY Cocoa)
190
191   # using 10.7 because boost requires libc++ and 10.6 doesn't include it
192   SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mmacosx-version-min=10.7")
193 endif()
194
195 if(${CMAKE_SYSTEM_NAME} MATCHES "Linux" OR
196         ${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
197     find_package(Threads REQUIRED)
198 endif()
199
200 # Somehow this only works if included before searching for Boost...
201 include(BoostTestTargets)
202
203 find_package(Boost REQUIRED)
204 set (BOOST_CXX_FLAGS "-DBOOST_BIMAP_DISABLE_SERIALIZATION")
205
206 if(SIMGEAR_HEADLESS)
207     message(STATUS "SimGear mode: HEADLESS")
208     set(ENABLE_SOUND 0)
209 else()
210     message(STATUS "SimGear mode: NORMAL")
211     find_package(OpenGL REQUIRED)
212
213     if (ENABLE_SOUND)
214         find_package(OpenAL REQUIRED)
215         message(STATUS "Sound support: ENABLED")
216     endif(ENABLE_SOUND)
217
218     find_package(OpenSceneGraph 3.2.0 REQUIRED osgText osgSim osgDB osgParticle osgGA osgViewer osgUtil)
219 endif(SIMGEAR_HEADLESS)
220
221 find_package(ZLIB REQUIRED)
222 find_package(CURL REQUIRED)
223
224 if (SYSTEM_EXPAT)
225     message(STATUS "Requested to use system Expat library, forcing SIMGEAR_SHARED to true")
226     set(SIMGEAR_SHARED ON)
227     find_package(EXPAT REQUIRED)
228
229 else()
230     message(STATUS "Using built-in expat code")
231     # XML_STATIC is important to avoid sg_expat_external.h
232     # declaring symbols as declspec(import)
233     add_definitions(-DHAVE_EXPAT_CONFIG_H -DXML_STATIC)
234     set(EXPAT_INCLUDE_DIRS
235             ${PROJECT_SOURCE_DIR}/3rdparty/expat
236             ${PROJECT_BINARY_DIR}/3rdparty/expat)
237 endif(SYSTEM_EXPAT)
238
239 include_directories(${EXPAT_INCLUDE_DIRS})
240
241 check_include_file(inttypes.h HAVE_INTTYPES_H)
242 check_include_file(sys/time.h HAVE_SYS_TIME_H)
243 check_include_file(sys/timeb.h HAVE_SYS_TIMEB_H)
244 check_include_file(unistd.h HAVE_UNISTD_H)
245 check_include_file(windows.h HAVE_WINDOWS_H)
246
247 if(HAVE_INTTYPES_H)
248   # ShivaVG needs inttypes.h
249   add_definitions(-DHAVE_INTTYPES_H)
250 endif()
251
252 if(ENABLE_RTI)
253     # See if we have any rti library variant installed
254     message(STATUS "RTI: ENABLED")
255     find_package(RTI)
256 else()
257     message(STATUS "RTI: DISABLED")
258 endif(ENABLE_RTI)
259
260 check_function_exists(gettimeofday HAVE_GETTIMEOFDAY)
261 check_function_exists(ftime HAVE_FTIME)
262 check_function_exists(timegm HAVE_TIMEGM)
263 check_function_exists(rint HAVE_RINT)
264 check_function_exists(mkdtemp HAVE_MKDTEMP)
265 check_function_exists(bcopy HAVE_BCOPY)
266 check_function_exists(mmap HAVE_MMAP)
267
268 if(HAVE_UNISTD_H)
269     set(CMAKE_REQUIRED_INCLUDES ${CMAKE_INCLUDE_PATH})
270     check_cxx_source_compiles(
271        "#include <unistd.h>
272         #if !defined(_POSIX_TIMERS) || (0 >= _POSIX_TIMERS)
273             #error clock_gettime is not supported
274         #endif
275
276         int main() { return 0; }
277         "
278         HAVE_CLOCK_GETTIME)
279 endif(HAVE_UNISTD_H)
280
281 set(RT_LIBRARY "")
282 if(HAVE_CLOCK_GETTIME)
283     check_library_exists(rt clock_gettime "" HAVE_RT)
284     if(HAVE_RT)
285         set(RT_LIBRARY rt)
286     endif(HAVE_RT)
287 endif(HAVE_CLOCK_GETTIME)
288
289 set(DL_LIBRARY "")
290 check_cxx_source_compiles(
291     "#include <dlfcn.h>
292     int main(void) {
293         return 0;
294     }
295     "
296     HAVE_DLFCN_H)
297
298 if(HAVE_DLFCN_H)
299     check_library_exists(dl dlerror "" HAVE_DL)
300     if(HAVE_DL)
301         set(DL_LIBRARY "dl")
302     endif()
303 endif()
304
305 SET(CMAKE_DEBUG_POSTFIX "d" CACHE STRING "add a postfix, usually 'd' on windows")
306 SET(CMAKE_RELEASE_POSTFIX "" CACHE STRING "add a postfix, usually empty on windows")
307 SET(CMAKE_RELWITHDEBINFO_POSTFIX "" CACHE STRING "add a postfix, usually empty on windows")
308 SET(CMAKE_MINSIZEREL_POSTFIX "" CACHE STRING "add a postfix, usually empty on windows")
309
310 # isnan might not be real symbol, so can't check using function_exists
311 check_cxx_source_compiles(
312     "#include <cmath>
313     int main() { return isnan(0.0);} "
314     HAVE_ISNAN)
315
316 check_cxx_source_compiles(
317     "#include <cmath>
318     int main() { return std::isnan(0.0);} "
319     HAVE_STD_ISNAN)
320
321 if(CMAKE_COMPILER_IS_GNUCXX)
322     set(WARNING_FLAGS_CXX "-Wall")
323     set(WARNING_FLAGS_C   "-Wall")
324
325     # certain GCC versions don't provide the atomic builds, and hence
326     # require is to provide them in SGAtomic.cxx
327     set(CMAKE_REQUIRED_INCLUDES ${CMAKE_INCLUDE_PATH})
328     check_cxx_source_compiles(
329        "int main() { unsigned mValue; return __sync_add_and_fetch(&mValue, 1); }"
330         GCC_ATOMIC_BUILTINS_FOUND)
331 endif(CMAKE_COMPILER_IS_GNUCXX)
332
333 if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
334     # Boost redeclares class members
335     set(WARNING_FLAGS_CXX "-Wall -Wno-overloaded-virtual -Wno-redeclared-class-member")
336     set(WARNING_FLAGS_C   "-Wall")
337     set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libc++")
338     set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LANGUAGE_STANDARD "c++11")
339     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -stdlib=libc++")
340 endif()
341
342 if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
343 # boost goes haywire wrt static asserts
344     check_cxx_compiler_flag(-Wno-unused-local-typedefs HAS_NOWARN_UNUSED_TYPEDEFS)
345     if(HAS_NOWARN_UNUSED_TYPEDEFS)
346         set(WARNING_FLAGS_CXX " ${WARNING_FLAGS_CXX} -Wno-unused-local-typedefs")
347     endif()
348 endif()
349
350 if(WIN32)
351
352     if(MINGW)
353         add_definitions(-D_WIN32_WINNT=0x501)
354     endif()
355
356     if(MSVC)
357         # turn off various warnings
358         # foreach(warning 4244 4251 4267 4275 4290 4786 4305 4996)
359         #     SET(WARNING_FLAGS "${WARNING_FLAGS} /wd${warning}")
360         # endforeach(warning)
361
362         set(MSVC_FLAGS "-DWIN32 -DNOMINMAX -D_USE_MATH_DEFINES -D_CRT_SECURE_NO_WARNINGS -D__CRT_NONSTDC_NO_WARNINGS /wd4996 /wd4250 -Dstrdup=_strdup")
363         if (${MSVC_VERSION} GREATER 1599)
364             set( MSVC_LD_FLAGS "/FORCE:MULTIPLE" )
365         endif (${MSVC_VERSION} GREATER 1599)
366     endif(MSVC)
367
368     # assumed on Windows
369     set(HAVE_GETLOCALTIME 1)
370
371     set( WINSOCK_LIBRARY "ws2_32.lib" )
372     set( RT_LIBRARY "winmm" )
373 endif(WIN32)
374
375 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${WARNING_FLAGS_C} ${MSVC_FLAGS}")
376 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${WARNING_FLAGS_CXX} ${MSVC_FLAGS} ${BOOST_CXX_FLAGS}")
377 set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${MSVC_LD_FLAGS}")
378
379 # use BEFORE to ensure local directories are used first,
380 # ahead of system-installed libs
381 include_directories(BEFORE ${PROJECT_SOURCE_DIR})
382 include_directories(BEFORE ${PROJECT_SOURCE_DIR}/simgear/canvas/ShivaVG/include)
383 include_directories(BEFORE ${PROJECT_BINARY_DIR}/simgear)
384
385 include_directories(${OPENSCENEGRAPH_INCLUDE_DIRS}
386     ${Boost_INCLUDE_DIRS}
387     ${ZLIB_INCLUDE_DIR}
388     ${OPENAL_INCLUDE_DIR}
389     ${CURL_INCLUDE_DIRS}
390 )
391
392 add_definitions(-DHAVE_CONFIG_H)
393
394 # configure a header file to pass some of the CMake settings
395 # to the source code
396 configure_file (
397   "${PROJECT_SOURCE_DIR}/simgear/simgear_config_cmake.h.in"
398   "${PROJECT_BINARY_DIR}/simgear/simgear_config.h"
399   )
400
401 if(ENABLE_TESTS)
402     # enable CTest / make test target
403     message(STATUS "Tests: ENABLED")
404
405     include (Dart)
406     enable_testing()
407 else()
408     message(STATUS "Tests: DISABLED")
409 endif(ENABLE_TESTS)
410
411 # always set TEST_LIBS as it is also used by other tools/applications
412 set(TEST_LIBS_INTERNAL_CORE
413     ${CMAKE_THREAD_LIBS_INIT}
414     ${ZLIB_LIBRARY}
415     ${WINSOCK_LIBRARY}
416     ${RT_LIBRARY}
417     ${DL_LIBRARY}
418     ${COCOA_LIBRARY}
419     ${CURL_LIBRARIES})
420 set(TEST_LIBS SimGearCore ${TEST_LIBS_INTERNAL_CORE})
421
422 if(NOT SIMGEAR_HEADLESS)
423     set(TEST_LIBS SimGearScene ${OPENGL_LIBRARIES} ${TEST_LIBS})
424 endif()
425
426 install (FILES ${PROJECT_BINARY_DIR}/simgear/simgear_config.h  DESTINATION include/simgear/)
427
428 include_directories(3rdparty/utf8/source)
429
430 if(ENABLE_DNS)
431     if(SYSTEM_UDNS)
432         message(STATUS "Requested to use system udns library, forcing SIMGEAR_SHARED to true")
433         set(SIMGEAR_SHARED ON)
434         find_package(Udns REQUIRED)
435     else()
436         message(STATUS "DNS resolver: ENABLED")
437         include_directories(3rdparty/udns)
438     endif()
439 else()
440     message(STATUS "DNS resolver: DISABLED")
441 endif()
442
443
444 add_subdirectory(3rdparty)
445 add_subdirectory(simgear)
446
447 #-----------------------------------------------------------------------------
448 ### Export stuff, see https://cmake.org/cmake/help/v3.2/manual/cmake-packages.7.html#creating-packages
449 #-----------------------------------------------------------------------------
450
451 generate_export_header(SimGearCore)
452 if(NOT SIMGEAR_HEADLESS)
453   generate_export_header(SimGearScene)
454 endif()
455
456 include(CMakePackageConfigHelpers)
457
458 write_basic_package_version_file(
459   "${CMAKE_CURRENT_BINARY_DIR}/SimGear/SimGearConfigVersion.cmake"
460   VERSION ${SIMGEAR_VERSION}
461   COMPATIBILITY AnyNewerVersion
462 )
463
464 configure_file(SimGearConfig.cmake.in
465   "${CMAKE_CURRENT_BINARY_DIR}/SimGear/SimGearConfig.cmake"
466   @ONLY
467 )
468
469 set(ConfigPackageLocation lib/cmake/SimGear)
470 install(EXPORT SimGearTargets
471   DESTINATION ${ConfigPackageLocation}
472 )
473 install(
474   FILES
475     "${CMAKE_CURRENT_BINARY_DIR}/SimGear/SimGearConfig.cmake"
476     "${CMAKE_CURRENT_BINARY_DIR}/SimGear/SimGearConfigVersion.cmake"
477   DESTINATION ${ConfigPackageLocation}
478   COMPONENT Devel
479 )
480
481 #-----------------------------------------------------------------------------
482 ### uninstall target
483 #-----------------------------------------------------------------------------
484 CONFIGURE_FILE(
485   "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules/cmake_uninstall.cmake.in"
486   "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
487   IMMEDIATE @ONLY)
488 ADD_CUSTOM_TARGET(uninstall
489   "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake")