nixpkgs/pkgs/development/compilers/llvm/3.6/clang/cmake-exports.patch

30 lines
1.3 KiB
Diff

diff -Naur clang-3.6.0.src-orig/CMakeLists.txt clang-3.6.0.src/CMakeLists.txt
--- clang-3.6.0.src-orig/CMakeLists.txt 2015-03-05 05:56:20.788520896 +0100
+++ clang-3.6.0.src/CMakeLists.txt 2015-03-05 06:02:15.589365469 +0100
@@ -362,6 +362,7 @@
if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY OR ${name} STREQUAL "libclang")
install(TARGETS ${name}
+ EXPORT ClangTargets
LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX}
ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX}
RUNTIME DESTINATION bin)
@@ -516,15 +517,15 @@
set(CLANG_INSTALL_PACKAGE_DIR share/clang/cmake)
set(clang_cmake_builddir "${CMAKE_BINARY_DIR}/${CLANG_INSTALL_PACKAGE_DIR}")
get_property(CLANG_EXPORTS GLOBAL PROPERTY CLANG_EXPORTS)
- export(TARGETS ${CLANG_EXPORTS} FILE ${clang_cmake_builddir}/ClangTargets.cmake)
# Install a <prefix>/share/clang/cmake/ClangConfig.cmake file so that
# find_package(Clang) works. Install the target list with it.
install(FILES
${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules/ClangConfig.cmake
- ${CLANG_BINARY_DIR}/share/clang/cmake/ClangTargets.cmake
DESTINATION share/clang/cmake)
+ install(EXPORT ClangTargets DESTINATION share/clang/cmake)
+
# Also copy ClangConfig.cmake to the build directory so that dependent projects
# can build against a build directory of Clang more easily.
configure_file(