Changed: #1493 Fixed absolute prefixes

This commit is contained in:
kervala 2012-09-23 23:56:34 +02:00
parent 51905e8b71
commit 003baa9140
2 changed files with 25 additions and 49 deletions

View file

@ -621,92 +621,87 @@ MACRO(NL_SETUP_BUILD_FLAGS)
SET(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${PLATFORM_LINKFLAGS} ${NL_RELEASE_LINKFLAGS}" CACHE STRING "" FORCE) SET(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${PLATFORM_LINKFLAGS} ${NL_RELEASE_LINKFLAGS}" CACHE STRING "" FORCE)
ENDMACRO(NL_SETUP_BUILD_FLAGS) ENDMACRO(NL_SETUP_BUILD_FLAGS)
# Macro to create x_ABSOLUTE_PREFIX from x_PREFIX
MACRO(NL_MAKE_ABSOLUTE_PREFIX NAME_RELATIVE NAME_ABSOLUTE)
IF(IS_ABSOLUTE ${NAME_RELATIVE})
SET(${NAME_ABSOLUTE} ${NAME_RELATIVE})
ELSE(IS_ABSOLUTE ${NAME_RELATIVE})
IF(WIN32)
SET(${NAME_ABSOLUTE} ${${NAME_RELATIVE}})
ELSE(WIN32)
SET(${NAME_ABSOLUTE} ${CMAKE_INSTALL_PREFIX}/${${NAME_RELATIVE}})
ENDIF(WIN32)
ENDIF(IS_ABSOLUTE ${NAME_RELATIVE})
ENDMACRO(NL_MAKE_ABSOLUTE_PREFIX)
MACRO(NL_SETUP_PREFIX_PATHS) MACRO(NL_SETUP_PREFIX_PATHS)
## Allow override of install_prefix/etc path. ## Allow override of install_prefix/etc path.
IF(NOT NL_ETC_PREFIX) IF(NOT NL_ETC_PREFIX)
IF(WIN32) IF(WIN32)
SET(NL_ETC_PREFIX "../etc/nel" CACHE PATH "Installation path for configurations") SET(NL_ETC_PREFIX "../etc/nel" CACHE PATH "Installation path for configurations")
SET(NL_ETC_ABSOLUTE_PREFIX ${NL_ETC_PREFIX})
ELSE(WIN32) ELSE(WIN32)
SET(NL_ETC_PREFIX "etc/nel" CACHE PATH "Installation path for configurations") SET(NL_ETC_PREFIX "etc/nel" CACHE PATH "Installation path for configurations")
SET(NL_ETC_ABSOLUTE_PREFIX ${CMAKE_INSTALL_PREFIX}/${NL_ETC_PREFIX})
ENDIF(WIN32) ENDIF(WIN32)
ELSE(NOT NL_ETC_PREFIX)
SET(NL_ETC_ABSOLUTE_PREFIX ${NL_ETC_PREFIX})
ENDIF(NOT NL_ETC_PREFIX) ENDIF(NOT NL_ETC_PREFIX)
NL_MAKE_ABSOLUTE_PREFIX(NL_ETC_PREFIX NL_ETC_ABSOLUTE_PREFIX)
## Allow override of install_prefix/share path. ## Allow override of install_prefix/share path.
IF(NOT NL_SHARE_PREFIX) IF(NOT NL_SHARE_PREFIX)
IF(WIN32) IF(WIN32)
SET(NL_SHARE_PREFIX "../share/nel" CACHE PATH "Installation path for data.") SET(NL_SHARE_PREFIX "../share/nel" CACHE PATH "Installation path for data.")
SET(NL_SHARE_ABSOLUTE_PREFIX ${NL_SHARE_PREFIX})
ELSE(WIN32) ELSE(WIN32)
SET(NL_SHARE_PREFIX "share/nel" CACHE PATH "Installation path for data.") SET(NL_SHARE_PREFIX "share/nel" CACHE PATH "Installation path for data.")
SET(NL_SHARE_ABSOLUTE_PREFIX ${CMAKE_INSTALL_PREFIX}/${NL_SHARE_PREFIX})
ENDIF(WIN32) ENDIF(WIN32)
ELSE(NOT NL_SHARE_PREFIX)
SET(NL_SHARE_ABSOLUTE_PREFIX ${NL_SHARE_PREFIX})
ENDIF(NOT NL_SHARE_PREFIX) ENDIF(NOT NL_SHARE_PREFIX)
NL_MAKE_ABSOLUTE_PREFIX(NL_SHARE_PREFIX NL_SHARE_ABSOLUTE_PREFIX)
## Allow override of install_prefix/sbin path. ## Allow override of install_prefix/sbin path.
IF(NOT NL_SBIN_PREFIX) IF(NOT NL_SBIN_PREFIX)
IF(WIN32) IF(WIN32)
SET(NL_SBIN_PREFIX "../sbin" CACHE PATH "Installation path for admin tools and services.") SET(NL_SBIN_PREFIX "../sbin" CACHE PATH "Installation path for admin tools and services.")
SET(NL_SBIN_ABSOLUTE_PREFIX ${NL_SBIN_PREFIX})
ELSE(WIN32) ELSE(WIN32)
SET(NL_SBIN_PREFIX "sbin" CACHE PATH "Installation path for admin tools and services.") SET(NL_SBIN_PREFIX "sbin" CACHE PATH "Installation path for admin tools and services.")
SET(NL_SBIN_ABSOLUTE_PREFIX ${CMAKE_INSTALL_PREFIX}/${NL_SBIN_PREFIX})
ENDIF(WIN32) ENDIF(WIN32)
ELSE(NOT NL_SBIN_PREFIX)
SET(NL_SBIN_ABSOLUTE_PREFIX ${NL_SBIN_PREFIX})
ENDIF(NOT NL_SBIN_PREFIX) ENDIF(NOT NL_SBIN_PREFIX)
NL_MAKE_ABSOLUTE_PREFIX(NL_SBIN_PREFIX NL_SBIN_ABSOLUTE_PREFIX)
## Allow override of install_prefix/bin path. ## Allow override of install_prefix/bin path.
IF(NOT NL_BIN_PREFIX) IF(NOT NL_BIN_PREFIX)
IF(WIN32) IF(WIN32)
SET(NL_BIN_PREFIX "../bin" CACHE PATH "Installation path for tools and applications.") SET(NL_BIN_PREFIX "../bin" CACHE PATH "Installation path for tools and applications.")
SET(NL_BIN_ABSOLUTE_PREFIX ${NL_BIN_PREFIX})
ELSE(WIN32) ELSE(WIN32)
SET(NL_BIN_PREFIX "bin" CACHE PATH "Installation path for tools and applications.") SET(NL_BIN_PREFIX "bin" CACHE PATH "Installation path for tools and applications.")
SET(NL_BIN_ABSOLUTE_PREFIX ${CMAKE_INSTALL_PREFIX}/${NL_BIN_PREFIX})
ENDIF(WIN32) ENDIF(WIN32)
ELSE(NOT NL_BIN_PREFIX)
SET(NL_BIN_ABSOLUTE_PREFIX ${NL_BIN_PREFIX})
ENDIF(NOT NL_BIN_PREFIX) ENDIF(NOT NL_BIN_PREFIX)
NL_MAKE_ABSOLUTE_PREFIX(NL_BIN_PREFIX NL_BIN_ABSOLUTE_PREFIX)
## Allow override of install_prefix/lib path. ## Allow override of install_prefix/lib path.
IF(NOT NL_LIB_PREFIX) IF(NOT NL_LIB_PREFIX)
IF(WIN32) IF(WIN32)
SET(NL_LIB_PREFIX "../lib" CACHE PATH "Installation path for libraries.") SET(NL_LIB_PREFIX "../lib" CACHE PATH "Installation path for libraries.")
SET(NL_LIB_ABSOLUTE_PREFIX ${NL_LIB_PREFIX})
ELSE(WIN32) ELSE(WIN32)
IF(CMAKE_LIBRARY_ARCHITECTURE) IF(CMAKE_LIBRARY_ARCHITECTURE)
SET(NL_LIB_PREFIX "lib/${CMAKE_LIBRARY_ARCHITECTURE}" CACHE PATH "Installation path for libraries.") SET(NL_LIB_PREFIX "lib/${CMAKE_LIBRARY_ARCHITECTURE}" CACHE PATH "Installation path for libraries.")
ELSE(CMAKE_LIBRARY_ARCHITECTURE) ELSE(CMAKE_LIBRARY_ARCHITECTURE)
SET(NL_LIB_PREFIX "lib" CACHE PATH "Installation path for libraries.") SET(NL_LIB_PREFIX "lib" CACHE PATH "Installation path for libraries.")
ENDIF(CMAKE_LIBRARY_ARCHITECTURE) ENDIF(CMAKE_LIBRARY_ARCHITECTURE)
SET(NL_LIB_ABSOLUTE_PREFIX ${CMAKE_INSTALL_PREFIX}/${NL_LIB_PREFIX})
ENDIF(WIN32) ENDIF(WIN32)
ELSE(NOT NL_LIB_PREFIX)
SET(NL_LIB_ABSOLUTE_PREFIX ${NL_LIB_PREFIX})
ENDIF(NOT NL_LIB_PREFIX) ENDIF(NOT NL_LIB_PREFIX)
NL_MAKE_ABSOLUTE_PREFIX(NL_LIB_PREFIX NL_LIB_ABSOLUTE_PREFIX)
## Allow override of install_prefix/lib path. ## Allow override of install_prefix/lib path.
IF(NOT NL_DRIVER_PREFIX) IF(NOT NL_DRIVER_PREFIX)
IF(WIN32) IF(WIN32)
SET(NL_DRIVER_PREFIX "../lib" CACHE PATH "Installation path for drivers.") SET(NL_DRIVER_PREFIX "../lib" CACHE PATH "Installation path for drivers.")
SET(NL_DRIVER_ABSOLUTE_PREFIX ${NL_DRIVER_PREFIX})
ELSE(WIN32) ELSE(WIN32)
IF(CMAKE_LIBRARY_ARCHITECTURE) IF(CMAKE_LIBRARY_ARCHITECTURE)
SET(NL_DRIVER_PREFIX "lib/${CMAKE_LIBRARY_ARCHITECTURE}/nel" CACHE PATH "Installation path for drivers.") SET(NL_DRIVER_PREFIX "lib/${CMAKE_LIBRARY_ARCHITECTURE}/nel" CACHE PATH "Installation path for drivers.")
ELSE(CMAKE_LIBRARY_ARCHITECTURE) ELSE(CMAKE_LIBRARY_ARCHITECTURE)
SET(NL_DRIVER_PREFIX "lib/nel" CACHE PATH "Installation path for drivers.") SET(NL_DRIVER_PREFIX "lib/nel" CACHE PATH "Installation path for drivers.")
ENDIF(CMAKE_LIBRARY_ARCHITECTURE) ENDIF(CMAKE_LIBRARY_ARCHITECTURE)
SET(NL_DRIVER_ABSOLUTE_PREFIX ${CMAKE_INSTALL_PREFIX}/${NL_DRIVER_PREFIX})
ENDIF(WIN32) ENDIF(WIN32)
ELSE(NOT NL_DRIVER_PREFIX)
SET(NL_DRIVER_ABSOLUTE_PREFIX ${NL_DRIVER_PREFIX})
ENDIF(NOT NL_DRIVER_PREFIX) ENDIF(NOT NL_DRIVER_PREFIX)
NL_MAKE_ABSOLUTE_PREFIX(NL_DRIVER_PREFIX NL_DRIVER_ABSOLUTE_PREFIX)
ENDMACRO(NL_SETUP_PREFIX_PATHS) ENDMACRO(NL_SETUP_PREFIX_PATHS)
@ -715,83 +710,65 @@ MACRO(RYZOM_SETUP_PREFIX_PATHS)
IF(NOT RYZOM_ETC_PREFIX) IF(NOT RYZOM_ETC_PREFIX)
IF(WIN32) IF(WIN32)
SET(RYZOM_ETC_PREFIX "." CACHE PATH "Installation path for configurations") SET(RYZOM_ETC_PREFIX "." CACHE PATH "Installation path for configurations")
SET(RYZOM_ETC_ABSOLUTE_PREFIX ${RYZOM_ETC_PREFIX})
ELSE(WIN32) ELSE(WIN32)
SET(RYZOM_ETC_PREFIX "etc/ryzom" CACHE PATH "Installation path for configurations") SET(RYZOM_ETC_PREFIX "etc/ryzom" CACHE PATH "Installation path for configurations")
SET(RYZOM_ETC_ABSOLUTE_PREFIX ${CMAKE_INSTALL_PREFIX}/${RYZOM_ETC_PREFIX})
ENDIF(WIN32) ENDIF(WIN32)
ELSE(NOT RYZOM_ETC_PREFIX)
SET(RYZOM_ETC_ABSOLUTE_PREFIX ${RYZOM_ETC_PREFIX})
ENDIF(NOT RYZOM_ETC_PREFIX) ENDIF(NOT RYZOM_ETC_PREFIX)
NL_MAKE_ABSOLUTE_PREFIX(RYZOM_ETC_PREFIX RYZOM_ETC_ABSOLUTE_PREFIX)
## Allow override of install_prefix/share path. ## Allow override of install_prefix/share path.
IF(NOT RYZOM_SHARE_PREFIX) IF(NOT RYZOM_SHARE_PREFIX)
IF(WIN32) IF(WIN32)
SET(RYZOM_SHARE_PREFIX "." CACHE PATH "Installation path for data.") SET(RYZOM_SHARE_PREFIX "." CACHE PATH "Installation path for data.")
SET(RYZOM_SHARE_ABSOLUTE_PREFIX ${RYZOM_SHARE_PREFIX})
ELSE(WIN32) ELSE(WIN32)
SET(RYZOM_SHARE_PREFIX "share/ryzom" CACHE PATH "Installation path for data.") SET(RYZOM_SHARE_PREFIX "share/ryzom" CACHE PATH "Installation path for data.")
SET(RYZOM_SHARE_ABSOLUTE_PREFIX ${CMAKE_INSTALL_PREFIX}/${RYZOM_SHARE_PREFIX})
ENDIF(WIN32) ENDIF(WIN32)
ELSE(NOT RYZOM_SHARE_PREFIX)
SET(RYZOM_SHARE_ABSOLUTE_PREFIX ${RYZOM_SHARE_PREFIX})
ENDIF(NOT RYZOM_SHARE_PREFIX) ENDIF(NOT RYZOM_SHARE_PREFIX)
NL_MAKE_ABSOLUTE_PREFIX(RYZOM_SHARE_PREFIX RYZOM_SHARE_ABSOLUTE_PREFIX)
## Allow override of install_prefix/sbin path. ## Allow override of install_prefix/sbin path.
IF(NOT RYZOM_SBIN_PREFIX) IF(NOT RYZOM_SBIN_PREFIX)
IF(WIN32) IF(WIN32)
SET(RYZOM_SBIN_PREFIX "." CACHE PATH "Installation path for admin tools and services.") SET(RYZOM_SBIN_PREFIX "." CACHE PATH "Installation path for admin tools and services.")
SET(RYZOM_SBIN_ABSOLUTE_PREFIX ${RYZOM_SBIN_PREFIX})
ELSE(WIN32) ELSE(WIN32)
SET(RYZOM_SBIN_PREFIX "sbin" CACHE PATH "Installation path for admin tools and services.") SET(RYZOM_SBIN_PREFIX "sbin" CACHE PATH "Installation path for admin tools and services.")
SET(RYZOM_SBIN_ABSOLUTE_PREFIX ${CMAKE_INSTALL_PREFIX}/${RYZOM_SBIN_PREFIX})
ENDIF(WIN32) ENDIF(WIN32)
ELSE(NOT RYZOM_SBIN_PREFIX)
SET(RYZOM_SBIN_ABSOLUTE_PREFIX ${RYZOM_SBIN_PREFIX})
ENDIF(NOT RYZOM_SBIN_PREFIX) ENDIF(NOT RYZOM_SBIN_PREFIX)
NL_MAKE_ABSOLUTE_PREFIX(RYZOM_SBIN_PREFIX RYZOM_SBIN_ABSOLUTE_PREFIX)
## Allow override of install_prefix/bin path. ## Allow override of install_prefix/bin path.
IF(NOT RYZOM_BIN_PREFIX) IF(NOT RYZOM_BIN_PREFIX)
IF(WIN32) IF(WIN32)
SET(RYZOM_BIN_PREFIX "." CACHE PATH "Installation path for tools and applications.") SET(RYZOM_BIN_PREFIX "." CACHE PATH "Installation path for tools and applications.")
SET(RYZOM_BIN_ABSOLUTE_PREFIX ${RYZOM_BIN_PREFIX})
ELSE(WIN32) ELSE(WIN32)
SET(RYZOM_BIN_PREFIX "bin" CACHE PATH "Installation path for tools.") SET(RYZOM_BIN_PREFIX "bin" CACHE PATH "Installation path for tools.")
SET(RYZOM_BIN_ABSOLUTE_PREFIX ${CMAKE_INSTALL_PREFIX}/${RYZOM_BIN_PREFIX})
ENDIF(WIN32) ENDIF(WIN32)
ELSE(NOT RYZOM_BIN_PREFIX)
SET(RYZOM_BIN_ABSOLUTE_PREFIX ${RYZOM_BIN_PREFIX})
ENDIF(NOT RYZOM_BIN_PREFIX) ENDIF(NOT RYZOM_BIN_PREFIX)
NL_MAKE_ABSOLUTE_PREFIX(RYZOM_BIN_PREFIX RYZOM_BIN_ABSOLUTE_PREFIX)
## Allow override of install_prefix/lib path. ## Allow override of install_prefix/lib path.
IF(NOT RYZOM_LIB_PREFIX) IF(NOT RYZOM_LIB_PREFIX)
IF(WIN32) IF(WIN32)
SET(RYZOM_LIB_PREFIX "." CACHE PATH "Installation path for libraries.") SET(RYZOM_LIB_PREFIX "." CACHE PATH "Installation path for libraries.")
SET(RYZOM_LIB_ABSOLUTE_PREFIX ${RYZOM_LIB_PREFIX})
ELSE(WIN32) ELSE(WIN32)
IF(CMAKE_LIBRARY_ARCHITECTURE) IF(CMAKE_LIBRARY_ARCHITECTURE)
SET(RYZOM_LIB_PREFIX "lib/${CMAKE_LIBRARY_ARCHITECTURE}" CACHE PATH "Installation path for libraries.") SET(RYZOM_LIB_PREFIX "lib/${CMAKE_LIBRARY_ARCHITECTURE}" CACHE PATH "Installation path for libraries.")
ELSE(CMAKE_LIBRARY_ARCHITECTURE) ELSE(CMAKE_LIBRARY_ARCHITECTURE)
SET(RYZOM_LIB_PREFIX "lib" CACHE PATH "Installation path for libraries.") SET(RYZOM_LIB_PREFIX "lib" CACHE PATH "Installation path for libraries.")
ENDIF(CMAKE_LIBRARY_ARCHITECTURE) ENDIF(CMAKE_LIBRARY_ARCHITECTURE)
SET(RYZOM_LIB_ABSOLUTE_PREFIX ${CMAKE_INSTALL_PREFIX}/${RYZOM_LIB_PREFIX})
ENDIF(WIN32) ENDIF(WIN32)
ELSE(NOT RYZOM_LIB_PREFIX)
SET(RYZOM_LIB_ABSOLUTE_PREFIX ${RYZOM_LIB_PREFIX})
ENDIF(NOT RYZOM_LIB_PREFIX) ENDIF(NOT RYZOM_LIB_PREFIX)
NL_MAKE_ABSOLUTE_PREFIX(RYZOM_LIB_PREFIX RYZOM_LIB_ABSOLUTE_PREFIX)
## Allow override of install_prefix/games path. ## Allow override of install_prefix/games path.
IF(NOT RYZOM_GAMES_PREFIX) IF(NOT RYZOM_GAMES_PREFIX)
IF(WIN32) IF(WIN32)
SET(RYZOM_GAMES_PREFIX "." CACHE PATH "Installation path for tools and applications.") SET(RYZOM_GAMES_PREFIX "." CACHE PATH "Installation path for tools and applications.")
SET(RYZOM_GAMES_ABSOLUTE_PREFIX ${RYZOM_GAMES_PREFIX})
ELSE(WIN32) ELSE(WIN32)
SET(RYZOM_GAMES_PREFIX "games" CACHE PATH "Installation path for client.") SET(RYZOM_GAMES_PREFIX "games" CACHE PATH "Installation path for client.")
SET(RYZOM_GAMES_ABSOLUTE_PREFIX ${CMAKE_INSTALL_PREFIX}/${RYZOM_GAMES_PREFIX})
ENDIF(WIN32) ENDIF(WIN32)
ELSE(NOT RYZOM_GAMES_PREFIX)
SET(RYZOM_GAMES_ABSOLUTE_PREFIX ${RYZOM_GAMES_PREFIX})
ENDIF(NOT RYZOM_GAMES_PREFIX) ENDIF(NOT RYZOM_GAMES_PREFIX)
NL_MAKE_ABSOLUTE_PREFIX(RYZOM_GAMES_PREFIX RYZOM_GAMES_ABSOLUTE_PREFIX)
ENDMACRO(RYZOM_SETUP_PREFIX_PATHS) ENDMACRO(RYZOM_SETUP_PREFIX_PATHS)

View file

@ -49,7 +49,6 @@
#cmakedefine NL_LIB_PREFIX "${NL_LIB_ABSOLUTE_PREFIX}" #cmakedefine NL_LIB_PREFIX "${NL_LIB_ABSOLUTE_PREFIX}"
#cmakedefine NL_DRIVER_PREFIX "${NL_DRIVER_ABSOLUTE_PREFIX}" #cmakedefine NL_DRIVER_PREFIX "${NL_DRIVER_ABSOLUTE_PREFIX}"
#cmakedefine RYZOM_PREFIX "${RYZOM_ABSOLUTE_PREFIX}"
#cmakedefine RYZOM_BIN_PREFIX "${RYZOM_BIN_ABSOLUTE_PREFIX}" #cmakedefine RYZOM_BIN_PREFIX "${RYZOM_BIN_ABSOLUTE_PREFIX}"
#cmakedefine RYZOM_ETC_PREFIX "${RYZOM_ETC_ABSOLUTE_PREFIX}" #cmakedefine RYZOM_ETC_PREFIX "${RYZOM_ETC_ABSOLUTE_PREFIX}"
#cmakedefine RYZOM_SHARE_PREFIX "${RYZOM_SHARE_ABSOLUTE_PREFIX}" #cmakedefine RYZOM_SHARE_PREFIX "${RYZOM_SHARE_ABSOLUTE_PREFIX}"