From bfe59d0cdd151f7f655c2a4066ba6e840b33fc82 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Fri, 31 Dec 2010 14:08:20 +0100 Subject: [PATCH] cmake: Fixed installation path for OS/2. --- CMakeLists.txt | 1 + cmake/Modules/DefineInstallationPaths.cmake | 29 +++++++++------------ cmake/Modules/DefinePlatformDefaults.cmake | 25 ++++++++++++++++++ 3 files changed, 39 insertions(+), 16 deletions(-) create mode 100644 cmake/Modules/DefinePlatformDefaults.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index 886c1c29..ff0feb5c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -30,6 +30,7 @@ set(CMAKE_MODULE_PATH # add definitions include(DefineCMakeDefaults) include(DefineCompilerFlags) +include(DefinePlatformDefaults) include(DefineInstallationPaths) include(DefineOptions.cmake) include(CPackConfig.cmake) diff --git a/cmake/Modules/DefineInstallationPaths.cmake b/cmake/Modules/DefineInstallationPaths.cmake index 71e1e854..d857871e 100644 --- a/cmake/Modules/DefineInstallationPaths.cmake +++ b/cmake/Modules/DefineInstallationPaths.cmake @@ -1,4 +1,15 @@ -if (UNIX) +if (WIN32) + # Same same + set(BIN_INSTALL_DIR "bin" CACHE PATH "-") + set(SBIN_INSTALL_DIR "." CACHE PATH "-") + set(LIB_INSTALL_DIR "lib" CACHE PATH "-") + set(INCLUDE_INSTALL_DIR "include" CACHE PATH "-") + set(PLUGIN_INSTALL_DIR "plugins" CACHE PATH "-") + set(HTML_INSTALL_DIR "doc/HTML" CACHE PATH "-") + set(ICON_INSTALL_DIR "." CACHE PATH "-") + set(SOUND_INSTALL_DIR "." CACHE PATH "-") + set(LOCALE_INSTALL_DIR "lang" CACHE PATH "-") +elseif (UNIX OR OS2) IF (NOT APPLICATION_NAME) MESSAGE(STATUS "${PROJECT_NAME} is used as APPLICATION_NAME") SET(APPLICATION_NAME ${PROJECT_NAME}) @@ -90,18 +101,4 @@ if (UNIX) "${SHARE_INSTALL_PREFIX}/info" CACHE PATH "The ${APPLICATION_NAME} info install dir (default prefix/info)" ) -endif (UNIX) - -if (WIN32) - # Same same - set(BIN_INSTALL_DIR "bin" CACHE PATH "-") - set(SBIN_INSTALL_DIR "." CACHE PATH "-") - set(LIB_INSTALL_DIR "lib" CACHE PATH "-") - set(INCLUDE_INSTALL_DIR "include" CACHE PATH "-") - set(PLUGIN_INSTALL_DIR "plugins" CACHE PATH "-") - set(HTML_INSTALL_DIR "doc/HTML" CACHE PATH "-") - set(ICON_INSTALL_DIR "." CACHE PATH "-") - set(SOUND_INSTALL_DIR "." CACHE PATH "-") - set(LOCALE_INSTALL_DIR "lang" CACHE PATH "-") -endif (WIN32) - +endif () diff --git a/cmake/Modules/DefinePlatformDefaults.cmake b/cmake/Modules/DefinePlatformDefaults.cmake new file mode 100644 index 00000000..0c3a05eb --- /dev/null +++ b/cmake/Modules/DefinePlatformDefaults.cmake @@ -0,0 +1,25 @@ +# Set system vars + +if (CMAKE_SYSTEM_NAME MATCHES "Linux") + set(LINUX TRUE) +endif(CMAKE_SYSTEM_NAME MATCHES "Linux") + +if (CMAKE_SYSTEM_NAME MATCHES "FreeBSD") + set(FREEBSD TRUE) +endif (CMAKE_SYSTEM_NAME MATCHES "FreeBSD") + +if (CMAKE_SYSTEM_NAME MATCHES "OpenBSD") + set(OPENBSD TRUE) +endif (CMAKE_SYSTEM_NAME MATCHES "OpenBSD") + +if (CMAKE_SYSTEM_NAME MATCHES "NetBSD") + set(NETBSD TRUE) +endif (CMAKE_SYSTEM_NAME MATCHES "NetBSD") + +if (CMAKE_SYSTEM_NAME MATCHES "(Solaris|SunOS)") + set(SOLARIS TRUE) +endif (CMAKE_SYSTEM_NAME MATCHES "(Solaris|SunOS)") + +if (CMAKE_SYSTEM_NAME MATCHES "OS2") + set(OS2 TRUE) +endif (CMAKE_SYSTEM_NAME MATCHES "OS2")