Skip to content

Commit 04e8a21

Browse files
author
Chris Bieneman
committed
[CMake] Version is aways greater than 3
We don't need any checks for this code anymore. Since CMake version is always greater than 3 we can always generate the exports file. llvm-svn: 272323
1 parent 60adaf5 commit 04e8a21

File tree

1 file changed

+22
-25
lines changed

1 file changed

+22
-25
lines changed

clang/CMakeLists.txt

Lines changed: 22 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -606,31 +606,28 @@ if(APPLE)
606606
endif()
607607
endif()
608608

609-
if (CLANG_BUILT_STANDALONE OR CMAKE_VERSION VERSION_EQUAL 3 OR
610-
CMAKE_VERSION VERSION_GREATER 3)
611-
# Generate a list of CMake library targets so that other CMake projects can
612-
# link against them. LLVM calls its version of this file LLVMExports.cmake, but
613-
# the usual CMake convention seems to be ${Project}Targets.cmake.
614-
set(CLANG_INSTALL_PACKAGE_DIR lib${LLVM_LIBDIR_SUFFIX}/cmake/clang)
615-
set(clang_cmake_builddir "${CMAKE_BINARY_DIR}/${CLANG_INSTALL_PACKAGE_DIR}")
616-
get_property(CLANG_EXPORTS GLOBAL PROPERTY CLANG_EXPORTS)
617-
export(TARGETS ${CLANG_EXPORTS} FILE ${clang_cmake_builddir}/ClangTargets.cmake)
618-
619-
# Install a <prefix>/lib/cmake/clang/ClangConfig.cmake file so that
620-
# find_package(Clang) works. Install the target list with it.
621-
install(EXPORT ClangTargets DESTINATION ${CLANG_INSTALL_PACKAGE_DIR})
622-
623-
install(FILES
624-
${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules/ClangConfig.cmake
625-
DESTINATION lib${LLVM_LIBDIR_SUFFIX}/cmake/clang)
626-
627-
# Also copy ClangConfig.cmake to the build directory so that dependent projects
628-
# can build against a build directory of Clang more easily.
629-
configure_file(
630-
${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules/ClangConfig.cmake
631-
${CLANG_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/cmake/clang/ClangConfig.cmake
632-
COPYONLY)
633-
endif ()
609+
# Generate a list of CMake library targets so that other CMake projects can
610+
# link against them. LLVM calls its version of this file LLVMExports.cmake, but
611+
# the usual CMake convention seems to be ${Project}Targets.cmake.
612+
set(CLANG_INSTALL_PACKAGE_DIR lib${LLVM_LIBDIR_SUFFIX}/cmake/clang)
613+
set(clang_cmake_builddir "${CMAKE_BINARY_DIR}/${CLANG_INSTALL_PACKAGE_DIR}")
614+
get_property(CLANG_EXPORTS GLOBAL PROPERTY CLANG_EXPORTS)
615+
export(TARGETS ${CLANG_EXPORTS} FILE ${clang_cmake_builddir}/ClangTargets.cmake)
616+
617+
# Install a <prefix>/lib/cmake/clang/ClangConfig.cmake file so that
618+
# find_package(Clang) works. Install the target list with it.
619+
install(EXPORT ClangTargets DESTINATION ${CLANG_INSTALL_PACKAGE_DIR})
620+
621+
install(FILES
622+
${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules/ClangConfig.cmake
623+
DESTINATION lib${LLVM_LIBDIR_SUFFIX}/cmake/clang)
624+
625+
# Also copy ClangConfig.cmake to the build directory so that dependent projects
626+
# can build against a build directory of Clang more easily.
627+
configure_file(
628+
${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules/ClangConfig.cmake
629+
${CLANG_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/cmake/clang/ClangConfig.cmake
630+
COPYONLY)
634631

635632
if (CLANG_ENABLE_BOOTSTRAP)
636633
include(ExternalProject)

0 commit comments

Comments
 (0)