From ee1efe5d036a5cc88e00d5ef8c969f551ca31d01 Mon Sep 17 00:00:00 2001 From: Jeremy Bicha Date: Sat, 9 Jul 2016 17:14:28 -0400 Subject: [PATCH] Use CMAKE_INSTALL_BINDIR Allow /bin install directory to be overriden. Debian for example uses this to install FlightGear to /usr/games/ instead of /usr/bin/ https://cmake.org/cmake/help/latest/module/GNUInstallDirs.html --- README.cmake | 2 +- src/FDM/YASim/CMakeLists.txt | 2 +- src/Input/CMakeLists.txt | 4 ++-- src/Main/CMakeLists.txt | 4 ++-- utils/GPSsmooth/CMakeLists.txt | 2 +- utils/TerraSync/CMakeLists.txt | 2 +- utils/fgai/CMakeLists.txt | 2 +- utils/fgcom/CMakeLists.txt | 2 +- utils/fgelev/CMakeLists.txt | 2 +- utils/fgpanel/CMakeLists.txt | 2 +- utils/fgviewer/CMakeLists.txt | 2 +- utils/stgmerge/CMakeLists.txt | 2 +- 12 files changed, 14 insertions(+), 14 deletions(-) diff --git a/README.cmake b/README.cmake index 767f9c779..863c2e77a 100644 --- a/README.cmake +++ b/README.cmake @@ -148,7 +148,7 @@ Adding a new executable target add_executable(myexecutable ${SOURCES} ${HEADERS}) target_link_libraries(myexecutable .... libraries ... ) - install(TARGETS myexecutable RUNTIME DESTINATION bin) + install(TARGETS myexecutable RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) (If the executable should not be installed, omit the final line above) diff --git a/src/FDM/YASim/CMakeLists.txt b/src/FDM/YASim/CMakeLists.txt index 97a8e2581..506f7a010 100644 --- a/src/FDM/YASim/CMakeLists.txt +++ b/src/FDM/YASim/CMakeLists.txt @@ -49,7 +49,7 @@ target_link_libraries(yasim-proptest ${SIMGEAR_CORE_LIBRARIES} ${SIMGEAR_CORE_LIBRARY_DEPENDENCIES}) -install(TARGETS yasim yasim-proptest RUNTIME DESTINATION bin) +install(TARGETS yasim yasim-proptest RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) endif(ENABLE_TESTS) diff --git a/src/Input/CMakeLists.txt b/src/Input/CMakeLists.txt index 11b277ef2..3a0c85efb 100644 --- a/src/Input/CMakeLists.txt +++ b/src/Input/CMakeLists.txt @@ -53,7 +53,7 @@ if(ENABLE_FGJS) ${SIMGEAR_CORE_LIBRARY_DEPENDENCIES} ) - install(TARGETS fgjs RUNTIME DESTINATION bin) + install(TARGETS fgjs RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) endif() if(ENABLE_JS_DEMO) @@ -64,7 +64,7 @@ if(ENABLE_JS_DEMO) ${SIMGEAR_CORE_LIBRARY_DEPENDENCIES} ) - install(TARGETS js_demo RUNTIME DESTINATION bin) + install(TARGETS js_demo RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) endif() flightgear_component(Input "${SOURCES}" "${HEADERS}") \ No newline at end of file diff --git a/src/Main/CMakeLists.txt b/src/Main/CMakeLists.txt index 4ea0fe523..3ae88d1db 100644 --- a/src/Main/CMakeLists.txt +++ b/src/Main/CMakeLists.txt @@ -162,7 +162,7 @@ endif() if (APPLE) install(TARGETS fgfs BUNDLE DESTINATION .) else() - install(TARGETS fgfs RUNTIME DESTINATION bin) + install(TARGETS fgfs RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) endif() if(ENABLE_METAR) @@ -174,5 +174,5 @@ if(ENABLE_METAR) ${PLATFORM_LIBS} ) - install(TARGETS metar RUNTIME DESTINATION bin) + install(TARGETS metar RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) endif() diff --git a/utils/GPSsmooth/CMakeLists.txt b/utils/GPSsmooth/CMakeLists.txt index a76c9521d..82bb89abf 100644 --- a/utils/GPSsmooth/CMakeLists.txt +++ b/utils/GPSsmooth/CMakeLists.txt @@ -38,4 +38,4 @@ target_link_libraries(UGsmooth ${ZLIB_LIBRARY} ) -install(TARGETS GPSsmooth MIDGsmooth UGsmooth RUNTIME DESTINATION bin) +install(TARGETS GPSsmooth MIDGsmooth UGsmooth RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/utils/TerraSync/CMakeLists.txt b/utils/TerraSync/CMakeLists.txt index f97996a9a..826a97ac9 100644 --- a/utils/TerraSync/CMakeLists.txt +++ b/utils/TerraSync/CMakeLists.txt @@ -6,4 +6,4 @@ # ${SIMGEAR_CORE_LIBRARY_DEPENDENCIES} #) -#install(TARGETS terrasync RUNTIME DESTINATION bin) +#install(TARGETS terrasync RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/utils/fgai/CMakeLists.txt b/utils/fgai/CMakeLists.txt index 3b234a4c3..fc65438c4 100644 --- a/utils/fgai/CMakeLists.txt +++ b/utils/fgai/CMakeLists.txt @@ -25,4 +25,4 @@ target_link_libraries(fgai ${SIMGEAR_CORE_LIBRARY_DEPENDENCIES} ) -install(TARGETS fgai RUNTIME DESTINATION bin) +install(TARGETS fgai RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/utils/fgcom/CMakeLists.txt b/utils/fgcom/CMakeLists.txt index bfa43e323..c9e9b6d95 100644 --- a/utils/fgcom/CMakeLists.txt +++ b/utils/fgcom/CMakeLists.txt @@ -31,4 +31,4 @@ target_link_Libraries(${name} ${SIMGEAR_CORE_LIBRARY_DEPENDENCIES} ) -install(TARGETS ${name} RUNTIME DESTINATION bin) +install(TARGETS ${name} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/utils/fgelev/CMakeLists.txt b/utils/fgelev/CMakeLists.txt index 13d6d3850..c8a7e79e8 100644 --- a/utils/fgelev/CMakeLists.txt +++ b/utils/fgelev/CMakeLists.txt @@ -8,4 +8,4 @@ target_link_libraries(fgelev ${ZLIB_LIBRARY} ) -install(TARGETS fgelev RUNTIME DESTINATION bin) +install(TARGETS fgelev RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/utils/fgpanel/CMakeLists.txt b/utils/fgpanel/CMakeLists.txt index f7ac79ca1..51bb7ad2a 100644 --- a/utils/fgpanel/CMakeLists.txt +++ b/utils/fgpanel/CMakeLists.txt @@ -35,7 +35,7 @@ if(GLUT_FOUND) include_directories(${PNG_INCLUDE_DIR}) - install(TARGETS fgpanel RUNTIME DESTINATION bin) + install(TARGETS fgpanel RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) else() message(STATUS "glut NOT found, can't build fgpanel") endif() diff --git a/utils/fgviewer/CMakeLists.txt b/utils/fgviewer/CMakeLists.txt index bfc52ad50..1cf6653c5 100644 --- a/utils/fgviewer/CMakeLists.txt +++ b/utils/fgviewer/CMakeLists.txt @@ -53,4 +53,4 @@ target_link_libraries(fgviewer ${FGVIEWER_RTI_LIBRARIES} ${SIMGEAR_CORE_LIBRARY_DEPENDENCIES} ) -install(TARGETS fgviewer RUNTIME DESTINATION bin) +install(TARGETS fgviewer RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/utils/stgmerge/CMakeLists.txt b/utils/stgmerge/CMakeLists.txt index ef694f690..d6d14ff72 100644 --- a/utils/stgmerge/CMakeLists.txt +++ b/utils/stgmerge/CMakeLists.txt @@ -7,4 +7,4 @@ target_link_libraries(stgmerge ${SIMGEAR_CORE_LIBRARY_DEPENDENCIES} ) -install(TARGETS stgmerge RUNTIME DESTINATION bin) +install(TARGETS stgmerge RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) -- 2.39.5