diff --git a/cmake/macros.cmake b/cmake/macros.cmake index 38c72b1df..44de00bfb 100644 --- a/cmake/macros.cmake +++ b/cmake/macros.cmake @@ -68,71 +68,21 @@ ENDIF(WIN32) SET(SD_TOOLS_EXECPREFIX "sd2-" CACHE STRING "Prefix for the tools executable names") MARK_AS_ADVANCED(SD_TOOLS_EXECPREFIX) -# Determine the default value of the data, bin and lib (and man) folders. -IF(IN_SOURCETREE) - IF(CMAKE_SIZEOF_VOID_P MATCHES 4) - SET(_DEFLIBDIR "lib") - ELSE() - SET(_DEFLIBDIR "lib64") - ENDIF() - IF(WIN32) - SET(SD_BINDIR bin CACHE PATH "Place where the executables should go") - SET(SD_LIBDIR ${_DEFLIBDIR} CACHE PATH "Place where the libraries should go") - SET(SD_INCLUDEDIR include CACHE PATH "Place where the include files should go") - ELSE(WIN32) #UNIX - SET(SD_BINDIR games CACHE PATH "Place where the executables should go") - SET(SD_LIBDIR ${_DEFLIBDIR}/games/speed-dreams-2 CACHE PATH "Place where the libraries should go") - SET(SD_INCLUDEDIR include/speed-dreams-2 CACHE PATH "Place where the include files should go") - SET(SD_MANDIR share/man CACHE PATH "Place where the manual pages should go") - ENDIF(WIN32) - MARK_AS_ADVANCED(SD_BINDIR) - MARK_AS_ADVANCED(SD_LIBDIR) - MARK_AS_ADVANCED(SD_INCLUDEDIR) - IF(UNIX) - MARK_AS_ADVANCED(SD_MANDIR) - ENDIF(UNIX) -ELSE(IN_SOURCETREE) - SET(SD_LIBDIR ${SD_LIBDIR_ABS}) - SET(SD_BINDIR ${SD_BINDIR_ABS}) - SET(SD_INCLUDEDIR ${SD_INCLUDEDIR_ABS}) - IF(UNIX) - SET(SD_MANDIR ${SD_MANDIR_ABS}) - ENDIF(UNIX) -ENDIF(IN_SOURCETREE) +IF(WIN32) + SET(SD_BINDIR ${CMAKE_INSTALL_BINDIR} CACHE PATH "Place where the executables should go") +ELSE() + SET(SD_BINDIR games CACHE PATH "Place where the executables should go") +ENDIF() -# Determine the aboslute paths of the data, bin and lib (and man) folders. - -IF(IS_ABSOLUTE ${SD_LIBDIR}) - GET_FILENAME_COMPONENT(SD_LIBDIR_ABS ${SD_LIBDIR} ABSOLUTE) -ELSE(IS_ABSOLUTE ${SD_LIBDIR}) - GET_FILENAME_COMPONENT(SD_LIBDIR_ABS ${CMAKE_INSTALL_PREFIX}/${SD_LIBDIR} ABSOLUTE) -ENDIF(IS_ABSOLUTE ${SD_LIBDIR}) - -IF(IS_ABSOLUTE ${SD_BINDIR}) - GET_FILENAME_COMPONENT(SD_BINDIR_ABS ${SD_BINDIR} ABSOLUTE) -ELSE(IS_ABSOLUTE ${SD_BINDIR}) - GET_FILENAME_COMPONENT(SD_BINDIR_ABS ${CMAKE_INSTALL_PREFIX}/${SD_BINDIR} ABSOLUTE) -ENDIF(IS_ABSOLUTE ${SD_BINDIR}) - -IF(IS_ABSOLUTE ${SD_INCLUDEDIR}) - GET_FILENAME_COMPONENT(SD_INCLUDEDIR_ABS ${SD_INCLUDEDIR} ABSOLUTE) -ELSE(IS_ABSOLUTE ${SD_INCLUDEDIR}) - GET_FILENAME_COMPONENT(SD_INCLUDEDIR_ABS ${CMAKE_INSTALL_PREFIX}/${SD_INCLUDEDIR} ABSOLUTE) -ENDIF(IS_ABSOLUTE ${SD_INCLUDEDIR}) - -IF(UNIX) - IF(IS_ABSOLUTE ${SD_MANDIR}) - GET_FILENAME_COMPONENT(SD_MANDIR_ABS ${SD_MANDIR} ABSOLUTE) - ELSE(IS_ABSOLUTE ${SD_MANDIR}) - GET_FILENAME_COMPONENT(SD_MANDIR_ABS ${CMAKE_INSTALL_PREFIX}/${SD_MANDIR} ABSOLUTE) - ENDIF(IS_ABSOLUTE ${SD_MANDIR}) -ENDIF(UNIX) +SET(SD_LIBDIR ${CMAKE_INSTALL_LIBDIR}/games/speed-dreams-2 CACHE PATH "Place where the libraries should go") +SET(SD_INCLUDEDIR ${CMAKE_INSTALL_INCLUDEDIR}/speed-dreams-2 CACHE PATH "Place where the include files should go") +SET(SD_MANDIR ${CMAKE_INSTALL_MANDIR} CACHE PATH "Place where the manual pages should go") STRING(REGEX REPLACE "^(.*[^/])/*$" "\\1" SD_LOCALDIR_TMP ${SD_LOCALDIR}) SET(SD_LOCALDIR ${SD_LOCALDIR_TMP}) SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_LIST_DIR}) -SET(CMAKE_INSTALL_RPATH "${SD_LIBDIR_ABS}/lib") +SET(CMAKE_INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/${SD_LIBDIR}/lib) # Configuration options macros. INCLUDE(${CMAKE_CURRENT_LIST_DIR}/options.cmake)