generated from TheLartians/ModernCppStarter
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcmcppConfigVersion.cmake.in
More file actions
26 lines (24 loc) · 1.01 KB
/
cmcppConfigVersion.cmake.in
File metadata and controls
26 lines (24 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
set(PACKAGE_VERSION "@PROJECT_VERSION@")
# Check whether the requested PACKAGE_FIND_VERSION is compatible
if("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}")
set(PACKAGE_VERSION_COMPATIBLE FALSE)
else()
set(PACKAGE_VERSION_COMPATIBLE TRUE)
if("${PACKAGE_VERSION}" VERSION_EQUAL "${PACKAGE_FIND_VERSION}")
set(PACKAGE_VERSION_EXACT TRUE)
endif()
endif()
# Check for version compatibility based on semantic versioning
# Major version must match for compatibility
if(PACKAGE_FIND_VERSION_MAJOR STREQUAL "0")
# For 0.x.y versions, minor version must also match (pre-1.0 API instability)
if(NOT "${PACKAGE_FIND_VERSION_MAJOR}.${PACKAGE_FIND_VERSION_MINOR}" VERSION_EQUAL
"@PROJECT_VERSION_MAJOR@.@PROJECT_VERSION_MINOR@")
set(PACKAGE_VERSION_COMPATIBLE FALSE)
endif()
else()
# For 1.x.y and above, only major version must match
if(NOT PACKAGE_FIND_VERSION_MAJOR STREQUAL "@PROJECT_VERSION_MAJOR@")
set(PACKAGE_VERSION_COMPATIBLE FALSE)
endif()
endif()