1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 18:54:02 +01:00

Teach LLVMConfigVersion.cmake to behave as find_package() expects.

Patch by Brad King

llvm-svn: 206426
This commit is contained in:
Eric Christopher 2014-04-16 23:15:31 +00:00
parent 205f3f5b67
commit 057dc443d6
2 changed files with 16 additions and 1 deletions

View File

@ -1 +1,13 @@
set(PACKAGE_VERSION "@PACKAGE_VERSION@")
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@.@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()

View File

@ -52,6 +52,9 @@ $(PROJ_OBJ_DIR)/LLVMConfigVersion.cmake: LLVMConfigVersion.cmake.in
$(Echo) 'Generating LLVM CMake package version file'
$(Verb) cat $< | sed \
-e 's/@PACKAGE_VERSION@/'"$(LLVMVersion)"'/' \
-e 's/@LLVM_VERSION_MAJOR@/'"$(LLVM_VERSION_MAJOR)"'/' \
-e 's/@LLVM_VERSION_MINOR@/'"$(LLVM_VERSION_MINOR)"'/' \
-e 's/@LLVM_VERSION_PATCH@/'"$(LLVM_VERSION_PATCH)"'/' \
> $@
$(PROJ_OBJ_DIR)/LLVMExports.cmake: $(LLVMBuildCMakeExportsFrag)