[clang] b62c8d3 - Revert: Add version to all LLVM cmake package

Thomas Preud'homme via cfe-commits cfe-commits at lists.llvm.org
Fri Nov 25 02:55:29 PST 2022


Author: Thomas Preud'homme
Date: 2022-11-25T10:54:58Z
New Revision: b62c8d396f7dbef61122e169ef143276e74eff05

URL: https://github.com/llvm/llvm-project/commit/b62c8d396f7dbef61122e169ef143276e74eff05
DIFF: https://github.com/llvm/llvm-project/commit/b62c8d396f7dbef61122e169ef143276e74eff05.diff

LOG: Revert: Add version to all LLVM cmake package

Summary: This reverts commit ad485b71b51168ce13282ae159bd8feff48baf84.

Reviewers:

Subscribers:

Added: 
    

Modified: 
    clang/cmake/modules/CMakeLists.txt
    clang/cmake/modules/ClangConfig.cmake.in
    flang/cmake/modules/CMakeLists.txt
    flang/cmake/modules/FlangConfig.cmake.in
    lld/cmake/modules/CMakeLists.txt
    lld/cmake/modules/LLDConfig.cmake.in
    mlir/cmake/modules/CMakeLists.txt
    mlir/cmake/modules/MLIRConfig.cmake.in
    polly/cmake/CMakeLists.txt
    polly/cmake/PollyConfig.cmake.in

Removed: 
    clang/cmake/modules/ClangConfigVersion.cmake.in
    flang/cmake/modules/FlangConfigVersion.cmake.in
    lld/cmake/modules/LLDConfigVersion.cmake.in
    mlir/cmake/modules/MLIRConfigVersion.cmake.in
    polly/cmake/PollyConfigVersion.cmake.in


################################################################################
diff  --git a/clang/cmake/modules/CMakeLists.txt b/clang/cmake/modules/CMakeLists.txt
index 749ef672c34f7..880d51f5aef71 100644
--- a/clang/cmake/modules/CMakeLists.txt
+++ b/clang/cmake/modules/CMakeLists.txt
@@ -32,10 +32,6 @@ configure_file(
   ${CMAKE_CURRENT_SOURCE_DIR}/ClangConfig.cmake.in
   ${clang_cmake_builddir}/ClangConfig.cmake
   @ONLY)
-configure_file(
-  ${CMAKE_CURRENT_SOURCE_DIR}/ClangConfigVersion.cmake.in
-  ${clang_cmake_builddir}/ClangConfigVersion.cmake
-  @ONLY)
 set(CLANG_CONFIG_CMAKE_DIR)
 set(CLANG_CONFIG_LLVM_CMAKE_DIR)
 
@@ -63,10 +59,6 @@ configure_file(
   ${CMAKE_CURRENT_SOURCE_DIR}/ClangConfig.cmake.in
   ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/ClangConfig.cmake
   @ONLY)
-configure_file(
-  ${CMAKE_CURRENT_SOURCE_DIR}/ClangConfigVersion.cmake.in
-  ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/ClangConfigVersion.cmake
-  @ONLY)
 set(CLANG_CONFIG_CODE)
 set(CLANG_CONFIG_CMAKE_DIR)
 
@@ -75,7 +67,6 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
 
   install(FILES
     ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/ClangConfig.cmake
-    ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/ClangConfigVersion.cmake
     ${CMAKE_CURRENT_SOURCE_DIR}/AddClang.cmake
     DESTINATION ${CLANG_INSTALL_PACKAGE_DIR}
     COMPONENT clang-cmake-exports)

diff  --git a/clang/cmake/modules/ClangConfig.cmake.in b/clang/cmake/modules/ClangConfig.cmake.in
index 5596ad669e209..2a254463d6f5e 100644
--- a/clang/cmake/modules/ClangConfig.cmake.in
+++ b/clang/cmake/modules/ClangConfig.cmake.in
@@ -2,8 +2,7 @@
 
 @CLANG_CONFIG_CODE@
 
-set(LLVM_VERSION ${LLVM_VERSION_MAJOR}.${LLVM_VERSION_MINOR}.${LLVM_VERSION_PATCH})
-find_package(LLVM @LLVM_VERSION@ EXACT REQUIRED CONFIG
+find_package(LLVM REQUIRED CONFIG
              HINTS "@CLANG_CONFIG_LLVM_CMAKE_DIR@")
 
 set(CLANG_EXPORTED_TARGETS "@CLANG_EXPORTS@")

diff  --git a/clang/cmake/modules/ClangConfigVersion.cmake.in b/clang/cmake/modules/ClangConfigVersion.cmake.in
deleted file mode 100644
index e9ac4ed2da786..0000000000000
--- a/clang/cmake/modules/ClangConfigVersion.cmake.in
+++ /dev/null
@@ -1,13 +0,0 @@
-set(PACKAGE_VERSION "@PACKAGE_VERSION@")
-
-# LLVM is API-compatible only with matching major.minor versions
-# and patch versions not less than that requested.
-if("@LLVM_VERSION_MAJOR at .@LLVM_VERSION_MINOR@" VERSION_EQUAL
-    "${PACKAGE_FIND_VERSION_MAJOR}.${PACKAGE_FIND_VERSION_MINOR}"
-   AND NOT "@LLVM_VERSION_PATCH@" VERSION_LESS "${PACKAGE_FIND_VERSION_PATCH}")
-  set(PACKAGE_VERSION_COMPATIBLE 1)
-  if("@LLVM_VERSION_PATCH@" VERSION_EQUAL
-      "${PACKAGE_FIND_VERSION_PATCH}")
-    set(PACKAGE_VERSION_EXACT 1)
-  endif()
-endif()

diff  --git a/flang/cmake/modules/CMakeLists.txt b/flang/cmake/modules/CMakeLists.txt
index bf50bcaa18d52..31a6c3c83e48b 100644
--- a/flang/cmake/modules/CMakeLists.txt
+++ b/flang/cmake/modules/CMakeLists.txt
@@ -28,8 +28,8 @@ set(FLANG_CONFIG_INCLUDE_DIRS
   "${FLANG_BINARY_DIR}/include"
   )
 configure_file(
-  ${CMAKE_CURRENT_SOURCE_DIR}/FlangConfigVersion.cmake.in
-  ${flang_cmake_builddir}/FlangConfigVersion.cmake
+  ${CMAKE_CURRENT_SOURCE_DIR}/FlangConfig.cmake.in
+  ${flang_cmake_builddir}/FlangConfig.cmake
   @ONLY)
 set(FLANG_CONFIG_CMAKE_DIR)
 set(FLANG_CONFIG_LLVM_CMAKE_DIR)
@@ -46,10 +46,6 @@ configure_file(
   ${CMAKE_CURRENT_SOURCE_DIR}/FlangConfig.cmake.in
   ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/FlangConfig.cmake
   @ONLY)
-configure_file(
-  ${CMAKE_CURRENT_SOURCE_DIR}/FlangConfigVersion.cmake.in
-  ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/FlangConfigVersion.cmake
-  @ONLY)
 
 set(FLANG_CONFIG_CODE)
 set(FLANG_CONFIG_CMAKE_DIR)
@@ -60,7 +56,6 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
 
   install(FILES
     ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/FlangConfig.cmake
-    ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/FlangConfigVersion.cmake
     DESTINATION ${FLANG_INSTALL_PACKAGE_DIR}
     COMPONENT flang-cmake-exports)
 

diff  --git a/flang/cmake/modules/FlangConfig.cmake.in b/flang/cmake/modules/FlangConfig.cmake.in
index 576ec367c4982..7893cb64b9365 100644
--- a/flang/cmake/modules/FlangConfig.cmake.in
+++ b/flang/cmake/modules/FlangConfig.cmake.in
@@ -2,8 +2,7 @@
 
 @FLANG_CONFIG_CODE@
 
-set(LLVM_VERSION ${LLVM_VERSION_MAJOR}.${LLVM_VERSION_MINOR}.${LLVM_VERSION_PATCH})
-find_package(LLVM @LLVM_VERSION@ EXACT REQUIRED CONFIG
+find_package(LLVM REQUIRED CONFIG
              HINTS "@FLANG_CONFIG_LLVM_CMAKE_DIR@")
 
 set(FLANG_EXPORTED_TARGETS "@FLANG_EXPORTS@")

diff  --git a/flang/cmake/modules/FlangConfigVersion.cmake.in b/flang/cmake/modules/FlangConfigVersion.cmake.in
deleted file mode 100644
index e9ac4ed2da786..0000000000000
--- a/flang/cmake/modules/FlangConfigVersion.cmake.in
+++ /dev/null
@@ -1,13 +0,0 @@
-set(PACKAGE_VERSION "@PACKAGE_VERSION@")
-
-# LLVM is API-compatible only with matching major.minor versions
-# and patch versions not less than that requested.
-if("@LLVM_VERSION_MAJOR at .@LLVM_VERSION_MINOR@" VERSION_EQUAL
-    "${PACKAGE_FIND_VERSION_MAJOR}.${PACKAGE_FIND_VERSION_MINOR}"
-   AND NOT "@LLVM_VERSION_PATCH@" VERSION_LESS "${PACKAGE_FIND_VERSION_PATCH}")
-  set(PACKAGE_VERSION_COMPATIBLE 1)
-  if("@LLVM_VERSION_PATCH@" VERSION_EQUAL
-      "${PACKAGE_FIND_VERSION_PATCH}")
-    set(PACKAGE_VERSION_EXACT 1)
-  endif()
-endif()

diff  --git a/lld/cmake/modules/CMakeLists.txt b/lld/cmake/modules/CMakeLists.txt
index e0578d7156a1c..61e7a1fe2752f 100644
--- a/lld/cmake/modules/CMakeLists.txt
+++ b/lld/cmake/modules/CMakeLists.txt
@@ -31,10 +31,6 @@ configure_file(
   ${CMAKE_CURRENT_SOURCE_DIR}/LLDConfig.cmake.in
   ${lld_cmake_builddir}/LLDConfig.cmake
   @ONLY)
-configure_file(
-  ${CMAKE_CURRENT_SOURCE_DIR}/LLDConfigVersion.cmake.in
-  ${lld_cmake_builddir}/LLDConfigVersion.cmake
-  @ONLY)
 set(LLD_CONFIG_CMAKE_DIR)
 set(LLD_CONFIG_LLVM_CMAKE_DIR)
 
@@ -48,10 +44,6 @@ configure_file(
   ${CMAKE_CURRENT_SOURCE_DIR}/LLDConfig.cmake.in
   ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/LLDConfig.cmake
   @ONLY)
-configure_file(
-  ${CMAKE_CURRENT_SOURCE_DIR}/LLDConfigVersion.cmake.in
-  ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/LLDConfigVersion.cmake
-  @ONLY)
 set(LLD_CONFIG_CODE)
 set(LLD_CONFIG_CMAKE_DIR)
 
@@ -60,7 +52,6 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
 
   install(FILES
     ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/LLDConfig.cmake
-    ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/LLDConfigVersion.cmake
     DESTINATION ${LLD_INSTALL_PACKAGE_DIR}
     COMPONENT lld-cmake-exports)
 

diff  --git a/lld/cmake/modules/LLDConfig.cmake.in b/lld/cmake/modules/LLDConfig.cmake.in
index b7eb07d1d0481..38ca4296eb3a1 100644
--- a/lld/cmake/modules/LLDConfig.cmake.in
+++ b/lld/cmake/modules/LLDConfig.cmake.in
@@ -2,8 +2,7 @@
 
 @LLD_CONFIG_CODE@
 
-set(LLVM_VERSION ${LLVM_VERSION_MAJOR}.${LLVM_VERSION_MINOR}.${LLVM_VERSION_PATCH})
-find_package(LLVM @LLVM_VERSION@ EXACT REQUIRED CONFIG
+find_package(LLVM REQUIRED CONFIG
              HINTS "@LLD_CONFIG_LLVM_CMAKE_DIR@")
 
 set(LLD_EXPORTED_TARGETS "@LLD_EXPORTS@")

diff  --git a/lld/cmake/modules/LLDConfigVersion.cmake.in b/lld/cmake/modules/LLDConfigVersion.cmake.in
deleted file mode 100644
index e9ac4ed2da786..0000000000000
--- a/lld/cmake/modules/LLDConfigVersion.cmake.in
+++ /dev/null
@@ -1,13 +0,0 @@
-set(PACKAGE_VERSION "@PACKAGE_VERSION@")
-
-# LLVM is API-compatible only with matching major.minor versions
-# and patch versions not less than that requested.
-if("@LLVM_VERSION_MAJOR at .@LLVM_VERSION_MINOR@" VERSION_EQUAL
-    "${PACKAGE_FIND_VERSION_MAJOR}.${PACKAGE_FIND_VERSION_MINOR}"
-   AND NOT "@LLVM_VERSION_PATCH@" VERSION_LESS "${PACKAGE_FIND_VERSION_PATCH}")
-  set(PACKAGE_VERSION_COMPATIBLE 1)
-  if("@LLVM_VERSION_PATCH@" VERSION_EQUAL
-      "${PACKAGE_FIND_VERSION_PATCH}")
-    set(PACKAGE_VERSION_EXACT 1)
-  endif()
-endif()

diff  --git a/mlir/cmake/modules/CMakeLists.txt b/mlir/cmake/modules/CMakeLists.txt
index 3f15c2d5cd0b3..a6addd7735829 100644
--- a/mlir/cmake/modules/CMakeLists.txt
+++ b/mlir/cmake/modules/CMakeLists.txt
@@ -41,10 +41,6 @@ configure_file(
   ${CMAKE_CURRENT_SOURCE_DIR}/MLIRConfig.cmake.in
   ${mlir_cmake_builddir}/MLIRConfig.cmake
   @ONLY)
-configure_file(
-  ${CMAKE_CURRENT_SOURCE_DIR}/MLIRConfigVersion.cmake.in
-  ${mlir_cmake_builddir}/MLIRConfigVersion.cmake
-  @ONLY)
 set(MLIR_CONFIG_CMAKE_DIR)
 set(MLIR_CONFIG_LLVM_CMAKE_DIR)
 set(MLIR_CONFIG_INCLUDE_DIRS)
@@ -79,10 +75,6 @@ configure_file(
   ${CMAKE_CURRENT_SOURCE_DIR}/MLIRConfig.cmake.in
   ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/MLIRConfig.cmake
   @ONLY)
-configure_file(
-  ${CMAKE_CURRENT_SOURCE_DIR}/MLIRConfigVersion.cmake.in
-  ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/MLIRConfigVersion.cmake
-  @ONLY)
 set(MLIR_CONFIG_CODE)
 set(MLIR_CONFIG_CMAKE_DIR)
 set(MLIR_CONFIG_LLVM_CMAKE_DIR)
@@ -95,7 +87,6 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
 
   install(FILES
     ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/MLIRConfig.cmake
-    ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/MLIRConfigVersion.cmake
     ${CMAKE_CURRENT_SOURCE_DIR}/AddMLIR.cmake
     ${CMAKE_CURRENT_SOURCE_DIR}/AddMLIRPython.cmake
     ${CMAKE_CURRENT_SOURCE_DIR}/MLIRDetectPythonEnv.cmake

diff  --git a/mlir/cmake/modules/MLIRConfig.cmake.in b/mlir/cmake/modules/MLIRConfig.cmake.in
index 3c47219d72c3a..65a23148a225d 100644
--- a/mlir/cmake/modules/MLIRConfig.cmake.in
+++ b/mlir/cmake/modules/MLIRConfig.cmake.in
@@ -2,8 +2,7 @@
 
 @MLIR_CONFIG_CODE@
 
-set(LLVM_VERSION ${LLVM_VERSION_MAJOR}.${LLVM_VERSION_MINOR}.${LLVM_VERSION_PATCH})
-find_package(LLVM @LLVM_VERSION@ EXACT REQUIRED CONFIG
+find_package(LLVM REQUIRED CONFIG
              HINTS "@MLIR_CONFIG_LLVM_CMAKE_DIR@")
 
 set(MLIR_EXPORTED_TARGETS "@MLIR_EXPORTS@")

diff  --git a/mlir/cmake/modules/MLIRConfigVersion.cmake.in b/mlir/cmake/modules/MLIRConfigVersion.cmake.in
deleted file mode 100644
index e9ac4ed2da786..0000000000000
--- a/mlir/cmake/modules/MLIRConfigVersion.cmake.in
+++ /dev/null
@@ -1,13 +0,0 @@
-set(PACKAGE_VERSION "@PACKAGE_VERSION@")
-
-# LLVM is API-compatible only with matching major.minor versions
-# and patch versions not less than that requested.
-if("@LLVM_VERSION_MAJOR at .@LLVM_VERSION_MINOR@" VERSION_EQUAL
-    "${PACKAGE_FIND_VERSION_MAJOR}.${PACKAGE_FIND_VERSION_MINOR}"
-   AND NOT "@LLVM_VERSION_PATCH@" VERSION_LESS "${PACKAGE_FIND_VERSION_PATCH}")
-  set(PACKAGE_VERSION_COMPATIBLE 1)
-  if("@LLVM_VERSION_PATCH@" VERSION_EQUAL
-      "${PACKAGE_FIND_VERSION_PATCH}")
-    set(PACKAGE_VERSION_EXACT 1)
-  endif()
-endif()

diff  --git a/polly/cmake/CMakeLists.txt b/polly/cmake/CMakeLists.txt
index d7b3fa1f29d82..183410734cef0 100644
--- a/polly/cmake/CMakeLists.txt
+++ b/polly/cmake/CMakeLists.txt
@@ -82,10 +82,6 @@ configure_file(
   ${CMAKE_CURRENT_SOURCE_DIR}/PollyConfig.cmake.in
   ${polly_cmake_builddir}/PollyConfig.cmake
   @ONLY)
-configure_file(
-  ${CMAKE_CURRENT_SOURCE_DIR}/PollyConfigVersion.cmake.in
-  ${polly_cmake_builddir}/PollyConfigVersion.cmake
-  @ONLY)
 
 file(GENERATE
   OUTPUT ${polly_cmake_builddir}/${POLLY_EXPORTS_FILE_NAME}
@@ -142,10 +138,6 @@ configure_file(
   ${CMAKE_CURRENT_SOURCE_DIR}/PollyConfig.cmake.in
   ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/PollyConfig.cmake
   @ONLY)
-configure_file(
-  ${CMAKE_CURRENT_SOURCE_DIR}/PollyConfigVersion.cmake.in
-  ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/PollyConfigVersion.cmake
-  @ONLY)
 file(GENERATE OUTPUT
   ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${POLLY_EXPORTS_FILE_NAME}
   CONTENT "${POLLY_EXPORTS}")
@@ -154,7 +146,6 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
   install(
     FILES
     "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/PollyConfig.cmake"
-    "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/PollyConfigVersion.cmake"
     "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${POLLY_EXPORTS_FILE_NAME}"
     DESTINATION "${POLLY_INSTALL_PACKAGE_DIR}")
 endif ()

diff  --git a/polly/cmake/PollyConfig.cmake.in b/polly/cmake/PollyConfig.cmake.in
index d7e8d1f768914..ce1144d85b83f 100644
--- a/polly/cmake/PollyConfig.cmake.in
+++ b/polly/cmake/PollyConfig.cmake.in
@@ -2,8 +2,7 @@
 
 @POLLY_CONFIG_CODE@
 
-set(LLVM_VERSION ${LLVM_VERSION_MAJOR}.${LLVM_VERSION_MINOR}.${LLVM_VERSION_PATCH})
-find_package(LLVM @LLVM_VERSION@ EXACT REQUIRED CONFIG
+find_package(LLVM REQUIRED CONFIG
              HINTS "@POLLY_CONFIG_LLVM_CMAKE_DIR@")
 
 set(Polly_CMAKE_DIR ${CMAKE_CURRENT_LIST_DIR})

diff  --git a/polly/cmake/PollyConfigVersion.cmake.in b/polly/cmake/PollyConfigVersion.cmake.in
deleted file mode 100644
index e9ac4ed2da786..0000000000000
--- a/polly/cmake/PollyConfigVersion.cmake.in
+++ /dev/null
@@ -1,13 +0,0 @@
-set(PACKAGE_VERSION "@PACKAGE_VERSION@")
-
-# LLVM is API-compatible only with matching major.minor versions
-# and patch versions not less than that requested.
-if("@LLVM_VERSION_MAJOR at .@LLVM_VERSION_MINOR@" VERSION_EQUAL
-    "${PACKAGE_FIND_VERSION_MAJOR}.${PACKAGE_FIND_VERSION_MINOR}"
-   AND NOT "@LLVM_VERSION_PATCH@" VERSION_LESS "${PACKAGE_FIND_VERSION_PATCH}")
-  set(PACKAGE_VERSION_COMPATIBLE 1)
-  if("@LLVM_VERSION_PATCH@" VERSION_EQUAL
-      "${PACKAGE_FIND_VERSION_PATCH}")
-    set(PACKAGE_VERSION_EXACT 1)
-  endif()
-endif()


        


More information about the cfe-commits mailing list