Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -328,10 +328,10 @@ include_directories(BEFORE SYSTEM
string(REPLACE "-Wcovered-switch-default" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")

file(STRINGS "VERSION" CPPINTEROP_VERSION)
string(REGEX MATCH "([0-9]*)\.([0-9]*)\.([0-9]*)" CPPINTEROP_VERSION_ONLY "${CPPINTEROP_VERSION}")
set(CPPINTEROP_VERSION_MAJOR "${CMAKE_MATCH_1}")
set(CPPINTEROP_VERSION_MINOR "${CMAKE_MATCH_2}")
set(CPPINTEROP_VERSION_PATCH "${CMAKE_MATCH_3}")
string(REPLACE "." ";" VERSION_LIST "${CPPINTEROP_VERSION}")
list(GET VERSION_LIST 0 CPPINTEROP_VERSION_MAJOR)
list(GET VERSION_LIST 1 CPPINTEROP_VERSION_MINOR)
list(GET VERSION_LIST 2 CPPINTEROP_VERSION_PATCH)

configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/cmake/CppInterOp/CppInterOpConfig.cmake.in
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.4.0;dev
1.4.0;dev
9 changes: 3 additions & 6 deletions cmake/CppInterOp/CppInterOpConfigVersion.cmake.in
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
set(PACKAGE_VERSION "@CPPINTEROP_VERSION@")

# LLVM is API-compatible only with matching major.minor versions
# and patch versions not less than that requested.

if("@CPPINTEROP_VERSION_MAJOR@.@CPPINTEROP_VERSION_MINOR@" VERSION_EQUAL "${PACKAGE_FIND_VERSION_MAJOR}.${PACKAGE_FIND_VERSION_MINOR}"
if("${PACKAGE_FIND_VERSION_MAJOR}.${PACKAGE_FIND_VERSION_MINOR}" VERSION_LESS "@CPPINTEROP_VERSION_MAJOR@.@CPPINTEROP_VERSION_MINOR@"
AND NOT "@CPPINTEROP_VERSION_PATCH@" VERSION_LESS "${PACKAGE_FIND_VERSION_PATCH}")
set(PACKAGE_VERSION_COMPATIBLE 1)
if("@CPPINTEROP_VERSION_PATCH@" VERSION_EQUAL "${PACKAGE_FIND_VERSION_PATCH}")
endif()
if("@CPPINTEROP_VERSION_MAJOR@.@CPPINTEROP_VERSION_MINOR@.@CPPINTEROP_VERSION_PATCH@" VERSION_EQUAL "${PACKAGE_FIND_VERSION_MAJOR}.${PACKAGE_FIND_VERSION_MINOR}.${PACKAGE_FIND_VERSION_PATCH}")
set(PACKAGE_VERSION_EXACT 1)
endif()
endif()