-
Notifications
You must be signed in to change notification settings - Fork 65
Expand file tree
/
Copy pathcdat_pkg.cmake
More file actions
34 lines (28 loc) · 966 Bytes
/
cdat_pkg.cmake
File metadata and controls
34 lines (28 loc) · 966 Bytes
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
27
28
29
30
31
32
33
set(cdat_VERSION_MAJOR 2)
set(cdat_VERSION_MINOR 6)
set(cdat_VERSION_PATCH 0)
set(cdat_VERSION ${cdat_VERSION_MAJOR}.${cdat_VERSION_MINOR}.${cdat_VERSION_PATCH})
execute_process(
COMMAND ${GIT_EXECUTABLE} describe --tags
WORKING_DIRECTORY ${cdat_SOURCE_DIR}
RESULT_VARIABLE res
OUTPUT_VARIABLE ver
)
if (NOT ${res} EQUAL 0)
set(cdat_VERSION ${cdat_VERSION_MAJOR}.${cdat_VERSION_MINOR}.${cdat_VERSION_PATCH})
message("[WARNING] Couldn't get version from git. Setting from values in cdat_pkg.cmake: ${cdat_VERSION}")
else ()
STRING(REGEX REPLACE "(\r?\n)+$" "" ver "${ver}")
set(cdat_VERSION ${ver})
endif()
set(CDAT_SOURCE N/A)
# configure version file
set (nm cdat_VERSION)
string(TOUPPER ${nm} uc_nm)
set(${uc_nm}_VERSION ${cdat_VERSION})
set(CDAT_VERSION ${CDAT_VERSION_VERSION})
configure_file(${cdat_CMAKE_SOURCE_DIR}/cdat_modules_extra/version.in
${cdat_BINARY_DIR}/version
@ONLY
)
add_cdat_package(CDAT "" "" ON)