From f832668bba1e28a7d2b3fb53666869541e639329 Mon Sep 17 00:00:00 2001 From: kai Date: Sun, 16 Dec 2012 14:15:14 +0100 Subject: [PATCH] Do not override INCLUDE_INSTALL_DIR. If both CMAKE_INSTALL_PREFIX and INCLUDE_INSTALL_DIR are specified on the commandline then CMAKE_INSTALL_PREFIX takes precedence. E.g. you can't install all files with prefix /usr and move the include directory to /usr/include/ldc2 at the same time. This commit changes the behaviour by preserving the value of INCLUDE_INSTALL_DIR given on the commandline. --- runtime/CMakeLists.txt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/runtime/CMakeLists.txt b/runtime/CMakeLists.txt index c7f80afc..1474f65f 100644 --- a/runtime/CMakeLists.txt +++ b/runtime/CMakeLists.txt @@ -10,11 +10,17 @@ set(DMDFE_MINOR_VERSION 0) set(DMDFE_PATCH_VERSION 60) set(DMDFE_VERSION ${D_VERSION}.${DMDFE_MINOR_VERSION}.${DMDFE_PATCH_VERSION}) +if(INCLUDE_INSTALL_DIR) + set(INCLUDE_INSTALL_DIR_DEFAULT ${INCLUDE_INSTALL_DIR}) +else() + set(INCLUDE_INSTALL_DIR_DEFAULT ${CMAKE_INSTALL_PREFIX}/include/d) +endif() + set(MULTILIB OFF CACHE BOOL "Build both 32/64 bit runtime libraries") set(BUILD_BC_LIBS OFF CACHE BOOL "Build the runtime as LLVM bitcode libraries") set(BUILD_SINGLE_LIB ON CACHE BOOL "Build single runtime library (no core/rt/gc split)") set(LIB_SUFFIX "" CACHE STRING "'64' to install libraries into ${PREFIX}/lib64") -set(INCLUDE_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/include/d CACHE PATH "Path to install D modules to") +set(INCLUDE_INSTALL_DIR ${INCLUDE_INSTALL_DIR_DEFAULT} CACHE PATH "Path to install D modules to") set(BUILD_SHARED_LIBS OFF CACHE BOOL "Whether to build the runtime as a shared library (*UNSUPPORTED*)") set(D_FLAGS -w;-d CACHE STRING "Runtime build flags, separated by ;") set(D_FLAGS_DEBUG -g CACHE STRING "Runtime build flags (debug libraries), separated by ;")