diff --git a/CMakeLists.txt b/CMakeLists.txt index c2cab6e..cfa86eb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -223,6 +223,23 @@ if (WIN32) ) 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( "${CMAKE_SOURCE_DIR}/config.h.in" "${CMAKE_BINARY_DIR}/config.h" diff --git a/config.h.in b/config.h.in index 9c0c951..b96976b 100644 --- a/config.h.in +++ b/config.h.in @@ -6,6 +6,9 @@ #define BUILD_LIBRARY_SUFFIX "@CMAKE_SHARED_LIBRARY_SUFFIX@" +#define BUILD_LIBDIR "@libdir@" +#define BUILD_DATADIR "@datadir@" + #cmakedefine HAVE_JPEG_MEM_SRC #cmakedefine ID_ENABLE_CURL