llvm.org GIT mirror llvm / 0fa7dc4
Teach LLVMConfigVersion.cmake to behave as find_package() expects. Patch by Brad King git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206426 91177308-0d34-0410-b5e6-96231b3b80d8 Eric Christopher 5 years ago
2 changed file(s) with 16 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
None set(PACKAGE_VERSION "@PACKAGE_VERSION@")
0 set(PACKAGE_VERSION "@PACKAGE_VERSION@")
1
2 # LLVM is API-compatible only with matching major.minor versions
3 # and patch versions not less than that requested.
4 if("@LLVM_VERSION_MAJOR@.@LLVM_VERSION_MINOR@" VERSION_EQUAL
5 "${PACKAGE_FIND_VERSION_MAJOR}.${PACKAGE_FIND_VERSION_MINOR}"
6 AND NOT "@LLVM_VERSION_PATCH@" VERSION_LESS "${PACKAGE_FIND_VERSION_PATCH}")
7 set(PACKAGE_VERSION_COMPATIBLE 1)
8 if("@LLVM_VERSION_PATCH@" VERSION_EQUAL
9 "${PACKAGE_FIND_VERSION_PATCH}")
10 set(PACKAGE_VERSION_EXACT 1)
11 endif()
12 endif()
5151 $(Echo) 'Generating LLVM CMake package version file'
5252 $(Verb) cat $< | sed \
5353 -e 's/@PACKAGE_VERSION@/'"$(LLVMVersion)"'/' \
54 -e 's/@LLVM_VERSION_MAJOR@/'"$(LLVM_VERSION_MAJOR)"'/' \
55 -e 's/@LLVM_VERSION_MINOR@/'"$(LLVM_VERSION_MINOR)"'/' \
56 -e 's/@LLVM_VERSION_PATCH@/'"$(LLVM_VERSION_PATCH)"'/' \
5457 > $@
5558
5659 $(PROJ_OBJ_DIR)/LLVMExports.cmake: $(LLVMBuildCMakeExportsFrag)