fix-cmake-config-prefix
authorLLVM Packaging Team <pkg-llvm-team@lists.alioth.debian.org>
Sun, 12 Mar 2017 08:49:18 +0000 (08:49 +0000)
committerSylvestre Ledru <sylvestre@debian.org>
Sun, 12 Mar 2017 08:49:18 +0000 (08:49 +0000)
## Description: add some description
## Origin/Author: add some origin or author
## Bug: bug URL

Gbp-Pq: Name fix-cmake-config-prefix.diff

cmake/modules/CMakeLists.txt
cmake/modules/Makefile

index 5f3f255628d66371e7b2176ff04de65169cfcf8d..f734a5586a20da819b8d23ea2b430ab3490b909c 100644 (file)
@@ -47,16 +47,7 @@ file(COPY .
   )
 
 # Generate LLVMConfig.cmake for the install tree.
-set(LLVM_CONFIG_CODE "
-# Compute the installation prefix from this LLVMConfig.cmake file location.
-get_filename_component(LLVM_INSTALL_PREFIX \"\${CMAKE_CURRENT_LIST_FILE}\" PATH)")
-# Construct the proper number of get_filename_component(... PATH)
-# calls to compute the installation prefix.
-string(REGEX REPLACE "/" ";" _count "${LLVM_INSTALL_PACKAGE_DIR}")
-foreach(p ${_count})
-  set(LLVM_CONFIG_CODE "${LLVM_CONFIG_CODE}
-get_filename_component(LLVM_INSTALL_PREFIX \"\${LLVM_INSTALL_PREFIX}\" PATH)")
-endforeach(p)
+set(LLVM_CONFIG_CODE "set(LLVM_INSTALL_PREFIX \"${CMAKE_INSTALL_PREFIX}\")")
 set(LLVM_CONFIG_INCLUDE_DIRS "\${LLVM_INSTALL_PREFIX}/include")
 set(LLVM_CONFIG_LIBRARY_DIRS "\${LLVM_INSTALL_PREFIX}/lib\${LLVM_LIBDIR_SUFFIX}")
 set(LLVM_CONFIG_CMAKE_DIR "\${LLVM_INSTALL_PREFIX}/${LLVM_INSTALL_PACKAGE_DIR}")
index abfda93b210fe6fe0b7d461c94b996ad9c81e320..33b13438a338c0249c2672242d8f94a68f948f4a 100644 (file)
@@ -45,17 +45,9 @@ OBJMODS := LLVMConfig.cmake LLVMConfigVersion.cmake LLVMExports.cmake
 
 LLVM_CONFIG_CODE := \
 \# Compute the CMake directory from the LLVMConfig.cmake file location.\n\
-get_filename_component(_LLVM_CMAKE_DIR "$${CMAKE_CURRENT_LIST_FILE}" PATH)\n\
-\# Compute the installation prefix from the LLVMConfig.cmake file location.\n\
-get_filename_component(LLVM_INSTALL_PREFIX "$${CMAKE_CURRENT_LIST_FILE}" PATH)\n
-
-# Compute number of levels (typically 3 - ``share/llvm/cmake/``) to PROJ_prefix
-# from PROJ_cmake, then emit the appropriate number of calls to
-# get_filename_components(). Note this assumes there are no spaces in the
-# cmake_path_suffix variable.
-cmake_path_suffix := $(subst $(PROJ_prefix),,$(subst $(DESTDIR),,$(PROJ_cmake)))
-cmake_path_dirs := $(subst /, ,$(cmake_path_suffix))
-LLVM_CONFIG_CODE += $(foreach __not_used,$(cmake_path_dirs),get_filename_component(LLVM_INSTALL_PREFIX "$${LLVM_INSTALL_PREFIX}" PATH)\n)
+get_filename_component(_LLVM_CMAKE_DIR "$${CMAKE_CURRENT_LIST_FILE}" PATH)\n
+
+LLVM_CONFIG_CODE += set(LLVM_INSTALL_PREFIX "$(subst /,\/,$(PROJ_prefix))")\n
 
 LLVM_CONFIG_CODE += set(_LLVM_LIBRARY_DIR "$${LLVM_INSTALL_PREFIX}\/lib")