diff options
author | Dominic Hargreaves <dom@earth.li> | 2015-07-01 20:08:51 -0400 |
---|---|---|
committer | Adam <Adam@anope.org> | 2015-07-01 20:08:51 -0400 |
commit | 4cbdf9a73bae33ecf7fbf04cbeb65e6d4ba2aa3f (patch) | |
tree | 15006c922d07357be6cd1a9dbd17e8c0ccc86355 | |
parent | fce257dc4391840cc868b905e4b8f2125ac59a7b (diff) |
Support DESTDIR
If DESTDIR is set it should be prepended to CMAKE_INSTALL_PREFIX. See
<http://www.cmake.org/cmake/help/v3.2/variable/CMAKE_INSTALL_PREFIX.html>
-rw-r--r-- | CMakeLists.txt | 12 | ||||
-rw-r--r-- | src/tools/CMakeLists.txt | 2 |
2 files changed, 7 insertions, 7 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 96387c738..3a08675d7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -470,16 +470,16 @@ get_target_property(SERVICES_BINARY ${PROGRAM_NAME} LOCATION) get_filename_component(SERVICES_BINARY ${SERVICES_BINARY} NAME) # At install time, create the following additional directories -install(CODE "file(MAKE_DIRECTORY \"\${CMAKE_INSTALL_PREFIX}/${DB_DIR}/backups\")") -install(CODE "file(MAKE_DIRECTORY \"\${CMAKE_INSTALL_PREFIX}/${LOGS_DIR}\")") +install(CODE "file(MAKE_DIRECTORY \"\$ENV{DESTDIR}/${CMAKE_INSTALL_PREFIX}/${DB_DIR}/backups\")") +install(CODE "file(MAKE_DIRECTORY \"\$ENV{DESTDIR}/${CMAKE_INSTALL_PREFIX}/${LOGS_DIR}\")") if(WIN32) install(CODE "file(MAKE_DIRECTORY \"\${CMAKE_INSTALL_PREFIX}/${DB_DIR}/runtime\")") endif(WIN32) # On non-Windows platforms, if RUNGROUP is set, change the permissions of the below directories, as well as the group of the data directory if(NOT WIN32 AND RUNGROUP) - install(CODE "execute_process(COMMAND ${CHMOD} 2775 \"\${CMAKE_INSTALL_PREFIX}/\${DB_DIR}/backups\")") - install(CODE "execute_process(COMMAND ${CHMOD} 2775 \"\${CMAKE_INSTALL_PREFIX}/\${LOGS_DIR}\")") - install(CODE "execute_process(COMMAND ${CHGRP} -R ${RUNGROUP} \"\${CMAKE_INSTALL_PREFIX}\")") + install(CODE "execute_process(COMMAND ${CHMOD} 2775 \"\$ENV{DESTDIR}/${CMAKE_INSTALL_PREFIX}/\${DB_DIR}/backups\")") + install(CODE "execute_process(COMMAND ${CHMOD} 2775 \"\$ENV{DESTDIR}/${CMAKE_INSTALL_PREFIX}/\${LOGS_DIR}\")") + install(CODE "execute_process(COMMAND ${CHGRP} -R ${RUNGROUP} \"\$ENV{DESTDIR}/${CMAKE_INSTALL_PREFIX}\")") endif(NOT WIN32 AND RUNGROUP) # On Windows platforms, install extra files if(WIN32) @@ -492,7 +492,7 @@ if(WIN32) install(FILES ${EXTRA_DLLS} DESTINATION ${BIN_DIR}) endif(WIN32) -install(CODE "file(REMOVE_RECURSE \"${CMAKE_INSTALL_PREFIX}/${LIB_DIR}/modules\")") +install(CODE "file(REMOVE_RECURSE \"$ENV{DESTDIR}/${CMAKE_INSTALL_PREFIX}/${LIB_DIR}/modules\")") # Only process the CPack section if we have CPack if(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake") diff --git a/src/tools/CMakeLists.txt b/src/tools/CMakeLists.txt index 200aa2bf3..e547a2e9a 100644 --- a/src/tools/CMakeLists.txt +++ b/src/tools/CMakeLists.txt @@ -48,5 +48,5 @@ endif(NOT WIN32) # On non-Windows platforms, if RUNGROUP is set, change the permissions of the tools directory if(NOT WIN32 AND RUNGROUP) - install(CODE "execute_process(COMMAND ${CHMOD} 2770 \"\${CMAKE_INSTALL_PREFIX}/bin\")") + install(CODE "execute_process(COMMAND ${CHMOD} 2770 \"\$ENV{DESTDIR}/${CMAKE_INSTALL_PREFIX}/bin\")") endif(NOT WIN32 AND RUNGROUP) |