|
|
|
@ -418,6 +418,17 @@ MACRO(NL_SETUP_BUILD)
|
|
|
|
|
MESSAGE(STATUS "Compiling on ${HOST_CPU} for ${TARGET_CPU}")
|
|
|
|
|
ENDIF("${HOST_CPU}" STREQUAL "${TARGET_CPU}")
|
|
|
|
|
|
|
|
|
|
# Use values from environment variables
|
|
|
|
|
SET(PLATFORM_CFLAGS "$ENV{CFLAGS} ${PLATFORM_CFLAGS}")
|
|
|
|
|
SET(PLATFORM_LINKFLAGS "$ENV{LDFLAGS} ${PLATFORM_LINKFLAGS}")
|
|
|
|
|
|
|
|
|
|
# Remove -g flag because we are managing it ourself
|
|
|
|
|
STRING(REPLACE "-g" "" PLATFORM_CFLAGS ${PLATFORM_CFLAGS})
|
|
|
|
|
|
|
|
|
|
# Strip spaces
|
|
|
|
|
STRING(STRIP ${PLATFORM_CFLAGS} PLATFORM_CFLAGS)
|
|
|
|
|
STRING(STRIP ${PLATFORM_LINKFLAGS} PLATFORM_LINKFLAGS)
|
|
|
|
|
|
|
|
|
|
IF(TARGET_CPU STREQUAL "x86_64")
|
|
|
|
|
SET(TARGET_X64 1)
|
|
|
|
|
SET(PLATFORM_CFLAGS "${PLATFORM_CFLAGS} -DHAVE_X86_64")
|
|
|
|
@ -468,9 +479,6 @@ MACRO(NL_SETUP_BUILD)
|
|
|
|
|
|
|
|
|
|
SET(PLATFORM_CFLAGS "${PLATFORM_CFLAGS} /D_CRT_SECURE_NO_WARNINGS /D_CRT_NONSTDC_NO_WARNINGS /DWIN32 /D_WINDOWS /W3 /Zm1000 /MP /Gy-")
|
|
|
|
|
|
|
|
|
|
# Common link flags
|
|
|
|
|
SET(PLATFORM_LINKFLAGS "")
|
|
|
|
|
|
|
|
|
|
IF(TARGET_X64)
|
|
|
|
|
# Fix a bug with Intellisense
|
|
|
|
|
SET(PLATFORM_CFLAGS "${PLATFORM_CFLAGS} /D_WIN64")
|
|
|
|
@ -617,119 +625,171 @@ MACRO(NL_SETUP_PREFIX_PATHS)
|
|
|
|
|
IF(NOT NL_ETC_PREFIX)
|
|
|
|
|
IF(WIN32)
|
|
|
|
|
SET(NL_ETC_PREFIX "../etc/nel" CACHE PATH "Installation path for configurations")
|
|
|
|
|
SET(NL_ETC_ABSOLUTE_PREFIX ${NL_ETC_PREFIX})
|
|
|
|
|
ELSE(WIN32)
|
|
|
|
|
SET(NL_ETC_PREFIX "${CMAKE_INSTALL_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)
|
|
|
|
|
ELSE(NOT NL_ETC_PREFIX)
|
|
|
|
|
SET(NL_ETC_ABSOLUTE_PREFIX ${NL_ETC_PREFIX})
|
|
|
|
|
ENDIF(NOT NL_ETC_PREFIX)
|
|
|
|
|
|
|
|
|
|
## Allow override of install_prefix/share path.
|
|
|
|
|
IF(NOT NL_SHARE_PREFIX)
|
|
|
|
|
IF(WIN32)
|
|
|
|
|
SET(NL_SHARE_PREFIX "../share/nel" CACHE PATH "Installation path for data.")
|
|
|
|
|
SET(NL_SHARE_ABSOLUTE_PREFIX ${NL_SHARE_PREFIX})
|
|
|
|
|
ELSE(WIN32)
|
|
|
|
|
SET(NL_SHARE_PREFIX "${CMAKE_INSTALL_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)
|
|
|
|
|
ELSE(NOT NL_SHARE_PREFIX)
|
|
|
|
|
SET(NL_SHARE_ABSOLUTE_PREFIX ${NL_SHARE_PREFIX})
|
|
|
|
|
ENDIF(NOT NL_SHARE_PREFIX)
|
|
|
|
|
|
|
|
|
|
## Allow override of install_prefix/sbin path.
|
|
|
|
|
IF(NOT NL_SBIN_PREFIX)
|
|
|
|
|
IF(WIN32)
|
|
|
|
|
SET(NL_SBIN_PREFIX "../sbin" CACHE PATH "Installation path for admin tools and services.")
|
|
|
|
|
SET(NL_SBIN_ABSOLUTE_PREFIX ${NL_SBIN_PREFIX})
|
|
|
|
|
ELSE(WIN32)
|
|
|
|
|
SET(NL_SBIN_PREFIX "${CMAKE_INSTALL_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)
|
|
|
|
|
ELSE(NOT NL_SBIN_PREFIX)
|
|
|
|
|
SET(NL_SBIN_ABSOLUTE_PREFIX ${NL_SBIN_PREFIX})
|
|
|
|
|
ENDIF(NOT NL_SBIN_PREFIX)
|
|
|
|
|
|
|
|
|
|
## Allow override of install_prefix/bin path.
|
|
|
|
|
IF(NOT NL_BIN_PREFIX)
|
|
|
|
|
IF(WIN32)
|
|
|
|
|
SET(NL_BIN_PREFIX "../bin" CACHE PATH "Installation path for tools and applications.")
|
|
|
|
|
SET(NL_BIN_ABSOLUTE_PREFIX ${NL_BIN_PREFIX})
|
|
|
|
|
ELSE(WIN32)
|
|
|
|
|
SET(NL_BIN_PREFIX "${CMAKE_INSTALL_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)
|
|
|
|
|
ELSE(NOT NL_BIN_PREFIX)
|
|
|
|
|
SET(NL_BIN_ABSOLUTE_PREFIX ${NL_BIN_PREFIX})
|
|
|
|
|
ENDIF(NOT NL_BIN_PREFIX)
|
|
|
|
|
|
|
|
|
|
## Allow override of install_prefix/lib path.
|
|
|
|
|
IF(NOT NL_LIB_PREFIX)
|
|
|
|
|
IF(WIN32)
|
|
|
|
|
SET(NL_LIB_PREFIX "../lib" CACHE PATH "Installation path for libraries.")
|
|
|
|
|
SET(NL_LIB_ABSOLUTE_PREFIX ${NL_LIB_PREFIX})
|
|
|
|
|
ELSE(WIN32)
|
|
|
|
|
IF(CMAKE_LIBRARY_ARCHITECTURE)
|
|
|
|
|
SET(NL_LIB_PREFIX "${CMAKE_INSTALL_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)
|
|
|
|
|
SET(NL_LIB_PREFIX "${CMAKE_INSTALL_PREFIX}/lib" CACHE PATH "Installation path for libraries.")
|
|
|
|
|
SET(NL_LIB_PREFIX "lib" CACHE PATH "Installation path for libraries.")
|
|
|
|
|
ENDIF(CMAKE_LIBRARY_ARCHITECTURE)
|
|
|
|
|
SET(NL_LIB_ABSOLUTE_PREFIX ${CMAKE_INSTALL_PREFIX}/${NL_LIB_PREFIX})
|
|
|
|
|
ENDIF(WIN32)
|
|
|
|
|
ELSE(NOT NL_LIB_PREFIX)
|
|
|
|
|
SET(NL_LIB_ABSOLUTE_PREFIX ${NL_LIB_PREFIX})
|
|
|
|
|
ENDIF(NOT NL_LIB_PREFIX)
|
|
|
|
|
|
|
|
|
|
## Allow override of install_prefix/lib path.
|
|
|
|
|
IF(NOT NL_DRIVER_PREFIX)
|
|
|
|
|
IF(WIN32)
|
|
|
|
|
SET(NL_DRIVER_PREFIX "../lib" CACHE PATH "Installation path for drivers.")
|
|
|
|
|
SET(NL_DRIVER_ABSOLUTE_PREFIX ${NL_DRIVER_PREFIX})
|
|
|
|
|
ELSE(WIN32)
|
|
|
|
|
IF(CMAKE_LIBRARY_ARCHITECTURE)
|
|
|
|
|
SET(NL_DRIVER_PREFIX "${CMAKE_INSTALL_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)
|
|
|
|
|
SET(NL_DRIVER_PREFIX "${CMAKE_INSTALL_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)
|
|
|
|
|
SET(NL_DRIVER_ABSOLUTE_PREFIX ${CMAKE_INSTALL_PREFIX}/${NL_DRIVER_PREFIX})
|
|
|
|
|
ENDIF(WIN32)
|
|
|
|
|
ELSE(NOT NL_DRIVER_PREFIX)
|
|
|
|
|
SET(NL_DRIVER_ABSOLUTE_PREFIX ${NL_DRIVER_PREFIX})
|
|
|
|
|
ENDIF(NOT NL_DRIVER_PREFIX)
|
|
|
|
|
|
|
|
|
|
ENDMACRO(NL_SETUP_PREFIX_PATHS)
|
|
|
|
|
|
|
|
|
|
MACRO(RYZOM_SETUP_PREFIX_PATHS)
|
|
|
|
|
## Allow override of install_prefix path.
|
|
|
|
|
IF(NOT RYZOM_PREFIX)
|
|
|
|
|
IF(WIN32)
|
|
|
|
|
SET(RYZOM_PREFIX "." CACHE PATH "Installation path")
|
|
|
|
|
ELSE(WIN32)
|
|
|
|
|
SET(RYZOM_PREFIX "${CMAKE_INSTALL_PREFIX}" CACHE PATH "Installation path")
|
|
|
|
|
ENDIF(WIN32)
|
|
|
|
|
ENDIF(NOT RYZOM_PREFIX)
|
|
|
|
|
|
|
|
|
|
## Allow override of install_prefix/etc path.
|
|
|
|
|
IF(NOT RYZOM_ETC_PREFIX)
|
|
|
|
|
IF(WIN32)
|
|
|
|
|
SET(RYZOM_ETC_PREFIX "." CACHE PATH "Installation path for configurations")
|
|
|
|
|
SET(RYZOM_ETC_ABSOLUTE_PREFIX ${RYZOM_ETC_PREFIX})
|
|
|
|
|
ELSE(WIN32)
|
|
|
|
|
SET(RYZOM_ETC_PREFIX "${RYZOM_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)
|
|
|
|
|
ELSE(NOT RYZOM_ETC_PREFIX)
|
|
|
|
|
SET(RYZOM_ETC_ABSOLUTE_PREFIX ${RYZOM_ETC_PREFIX})
|
|
|
|
|
ENDIF(NOT RYZOM_ETC_PREFIX)
|
|
|
|
|
|
|
|
|
|
## Allow override of install_prefix/share path.
|
|
|
|
|
IF(NOT RYZOM_SHARE_PREFIX)
|
|
|
|
|
IF(WIN32)
|
|
|
|
|
SET(RYZOM_SHARE_PREFIX "." CACHE PATH "Installation path for data.")
|
|
|
|
|
SET(RYZOM_SHARE_ABSOLUTE_PREFIX ${RYZOM_SHARE_PREFIX})
|
|
|
|
|
ELSE(WIN32)
|
|
|
|
|
SET(RYZOM_SHARE_PREFIX "${RYZOM_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)
|
|
|
|
|
ELSE(NOT RYZOM_SHARE_PREFIX)
|
|
|
|
|
SET(RYZOM_SHARE_ABSOLUTE_PREFIX ${RYZOM_SHARE_PREFIX})
|
|
|
|
|
ENDIF(NOT RYZOM_SHARE_PREFIX)
|
|
|
|
|
|
|
|
|
|
## Allow override of install_prefix/sbin path.
|
|
|
|
|
IF(NOT RYZOM_SBIN_PREFIX)
|
|
|
|
|
IF(WIN32)
|
|
|
|
|
SET(RYZOM_SBIN_PREFIX "." CACHE PATH "Installation path for admin tools and services.")
|
|
|
|
|
SET(RYZOM_SBIN_ABSOLUTE_PREFIX ${RYZOM_SBIN_PREFIX})
|
|
|
|
|
ELSE(WIN32)
|
|
|
|
|
SET(RYZOM_SBIN_PREFIX "${RYZOM_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)
|
|
|
|
|
ELSE(NOT RYZOM_SBIN_PREFIX)
|
|
|
|
|
SET(RYZOM_SBIN_ABSOLUTE_PREFIX ${RYZOM_SBIN_PREFIX})
|
|
|
|
|
ENDIF(NOT RYZOM_SBIN_PREFIX)
|
|
|
|
|
|
|
|
|
|
## Allow override of install_prefix/bin path.
|
|
|
|
|
IF(NOT RYZOM_BIN_PREFIX)
|
|
|
|
|
IF(WIN32)
|
|
|
|
|
SET(RYZOM_BIN_PREFIX "." CACHE PATH "Installation path for tools and applications.")
|
|
|
|
|
SET(RYZOM_BIN_ABSOLUTE_PREFIX ${RYZOM_BIN_PREFIX})
|
|
|
|
|
ELSE(WIN32)
|
|
|
|
|
SET(RYZOM_BIN_PREFIX "${RYZOM_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)
|
|
|
|
|
ELSE(NOT RYZOM_BIN_PREFIX)
|
|
|
|
|
SET(RYZOM_BIN_ABSOLUTE_PREFIX ${RYZOM_BIN_PREFIX})
|
|
|
|
|
ENDIF(NOT RYZOM_BIN_PREFIX)
|
|
|
|
|
|
|
|
|
|
## Allow override of install_prefix/lib path.
|
|
|
|
|
IF(NOT RYZOM_LIB_PREFIX)
|
|
|
|
|
IF(WIN32)
|
|
|
|
|
SET(RYZOM_LIB_PREFIX "." CACHE PATH "Installation path for libraries.")
|
|
|
|
|
SET(RYZOM_LIB_ABSOLUTE_PREFIX ${RYZOM_LIB_PREFIX})
|
|
|
|
|
ELSE(WIN32)
|
|
|
|
|
IF(CMAKE_LIBRARY_ARCHITECTURE)
|
|
|
|
|
SET(RYZOM_LIB_PREFIX "lib/${CMAKE_LIBRARY_ARCHITECTURE}" CACHE PATH "Installation path for libraries.")
|
|
|
|
|
ELSE(CMAKE_LIBRARY_ARCHITECTURE)
|
|
|
|
|
SET(RYZOM_LIB_PREFIX "lib" CACHE PATH "Installation path for libraries.")
|
|
|
|
|
ENDIF(CMAKE_LIBRARY_ARCHITECTURE)
|
|
|
|
|
SET(RYZOM_LIB_ABSOLUTE_PREFIX ${CMAKE_INSTALL_PREFIX}/${RYZOM_LIB_PREFIX})
|
|
|
|
|
ENDIF(WIN32)
|
|
|
|
|
ELSE(NOT RYZOM_LIB_PREFIX)
|
|
|
|
|
SET(RYZOM_LIB_ABSOLUTE_PREFIX ${RYZOM_LIB_PREFIX})
|
|
|
|
|
ENDIF(NOT RYZOM_LIB_PREFIX)
|
|
|
|
|
|
|
|
|
|
## Allow override of install_prefix/games path.
|
|
|
|
|
IF(NOT RYZOM_GAMES_PREFIX)
|
|
|
|
|
IF(WIN32)
|
|
|
|
|
SET(RYZOM_GAMES_PREFIX "." CACHE PATH "Installation path for tools and applications.")
|
|
|
|
|
SET(RYZOM_GAMES_ABSOLUTE_PREFIX ${RYZOM_GAMES_PREFIX})
|
|
|
|
|
ELSE(WIN32)
|
|
|
|
|
SET(RYZOM_GAMES_PREFIX "${RYZOM_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)
|
|
|
|
|
ELSE(NOT RYZOM_GAMES_PREFIX)
|
|
|
|
|
SET(RYZOM_GAMES_ABSOLUTE_PREFIX ${RYZOM_GAMES_PREFIX})
|
|
|
|
|
ENDIF(NOT RYZOM_GAMES_PREFIX)
|
|
|
|
|
|
|
|
|
|
ENDMACRO(RYZOM_SETUP_PREFIX_PATHS)
|
|
|
|
|