Introduce CMAKE_INSTALL_PREFIX relative paths

configure style install dirs.
This commit is contained in:
dhewg 2012-07-03 18:13:52 +02:00 committed by Daniel Gibson
parent c4af9b0ce0
commit e67598eeb5
2 changed files with 20 additions and 0 deletions

View file

@ -223,6 +223,23 @@ if (WIN32)
) )
endif() endif()
if (APPLE)
SET(bindir "${CMAKE_INSTALL_PREFIX}")
SET(libdir "${CMAKE_INSTALL_PREFIX}")
SET(datarootdir "${CMAKE_INSTALL_PREFIX}")
SET(datadir "${datarootdir}")
elseif (WIN32)
SET(bindir "${CMAKE_INSTALL_PREFIX}")
SET(libdir "${CMAKE_INSTALL_PREFIX}/lib")
SET(datarootdir "${CMAKE_INSTALL_PREFIX}")
SET(datadir "${datarootdir}")
else()
SET(bindir "${CMAKE_INSTALL_PREFIX}/bin")
SET(libdir "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}/dhewm3")
SET(datarootdir "${CMAKE_INSTALL_PREFIX}/share")
SET(datadir "${datarootdir}/dhewm3")
endif()
configure_file( configure_file(
"${CMAKE_SOURCE_DIR}/config.h.in" "${CMAKE_SOURCE_DIR}/config.h.in"
"${CMAKE_BINARY_DIR}/config.h" "${CMAKE_BINARY_DIR}/config.h"

View file

@ -6,6 +6,9 @@
#define BUILD_LIBRARY_SUFFIX "@CMAKE_SHARED_LIBRARY_SUFFIX@" #define BUILD_LIBRARY_SUFFIX "@CMAKE_SHARED_LIBRARY_SUFFIX@"
#define BUILD_LIBDIR "@libdir@"
#define BUILD_DATADIR "@datadir@"
#cmakedefine HAVE_JPEG_MEM_SRC #cmakedefine HAVE_JPEG_MEM_SRC
#cmakedefine ID_ENABLE_CURL #cmakedefine ID_ENABLE_CURL