summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2012-05-06 21:43:50 -0400
committerAdam <Adam@anope.org>2012-05-06 21:43:50 -0400
commit675b113c3e03cf1917b2a731c21fe82b5f1f2b2b (patch)
tree6a80aaeafa829a3cef5c41c938d92ffedd1bdad8 /CMakeLists.txt
parenteb0e07d5645c06eb034cfcfbf91883158ba9dc00 (diff)
Split up db/conf/lib/locale install directories, and allow alternate ones to be specified at runtime
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt37
1 files changed, 30 insertions, 7 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index eeaef2983..737754006 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -379,6 +379,29 @@ else(INSTDIR)
set(CMAKE_INSTALL_PREFIX "$ENV{HOME}/services")
endif(INSTDIR)
+# Set default paths for various directories if not already defined
+if(NOT BIN_DIR)
+ set(BIN_DIR "${CMAKE_INSTALL_PREFIX}/bin")
+endif(NOT BIN_DIR)
+if(NOT DB_DIR)
+ set(DB_DIR "${CMAKE_INSTALL_PREFIX}/data")
+endif(NOT DB_DIR)
+if(NOT DOC_DIR)
+ set(DOC_DIR "${CMAKE_INSTALL_PREFIX}/doc")
+endif(NOT DOC_DIR)
+if(NOT CONF_DIR)
+ set(CONF_DIR "${CMAKE_INSTALL_PREFIX}/conf")
+endif(NOT CONF_DIR)
+if(NOT LIB_DIR)
+ set(LIB_DIR "${CMAKE_INSTALL_PREFIX}/lib")
+endif(NOT LIB_DIR)
+if(NOT LOCALE_DIR)
+ set(LOCALE_DIR "${CMAKE_INSTALL_PREFIX}/locale")
+endif(NOT LOCALE_DIR)
+if(NOT LOGS_DIR)
+ set(LOGS_DIR "${CMAKE_INSTALL_PREFIX}/logs")
+endif(NOT LOGS_DIR)
+
# Version number processing
# Find all lines in src/version.sh that start with VERSION_
read_from_file(${Anope_SOURCE_DIR}/src/version.sh "^VERSION_" VERSIONS)
@@ -457,20 +480,20 @@ 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}/data/backups\")")
-install(CODE "file(MAKE_DIRECTORY \"\${CMAKE_INSTALL_PREFIX}/data/logs\")")
-install(CODE "file(MAKE_DIRECTORY \"\${CMAKE_INSTALL_PREFIX}/data/modules/runtime\")")
+install(CODE "file(MAKE_DIRECTORY \"${DB_DIR}/backups\")")
+install(CODE "file(MAKE_DIRECTORY \"${LOGS_DIR}\")")
+install(CODE "file(MAKE_DIRECTORY \"${LIB_DIR}/modules/runtime\")")
# 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}/data/backups\")")
- install(CODE "execute_process(COMMAND ${CHMOD} 2775 \"\${CMAKE_INSTALL_PREFIX}/data/logs\")")
- install(CODE "execute_process(COMMAND ${CHMOD} 2775 \"\${CMAKE_INSTALL_PREFIX}/data/modules/runtime\")")
+ install(CODE "execute_process(COMMAND ${CHMOD} 2775 \"\${DB_DIR}/backups\")")
+ install(CODE "execute_process(COMMAND ${CHMOD} 2775 \"\${LOGS_DIR}\")")
+ install(CODE "execute_process(COMMAND ${CHMOD} 2775 \"\${LIB_DIR}/modules/runtime\")")
install(CODE "execute_process(COMMAND ${CHGRP} -R ${RUNGROUP} \"\${CMAKE_INSTALL_PREFIX}\")")
endif(NOT WIN32 AND RUNGROUP)
# On Windows platforms, install extra files
if(WIN32)
install(FILES ${Anope_SOURCE_DIR}/src/win32/anope.bat
- DESTINATION bin
+ DESTINATION ${BIN_DIR}
)
endif(WIN32)