FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
AliceO2/version/CMakeLists.txt at dev · AliceO2Group/AliceO2 · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
AliceO2Group
/
AliceO2
Public
Notifications
You must be signed in to change notification settings
Fork
511
Star
125
Code
Issues
2
Pull requests
33
Actions
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Security and quality
Insights
Expand file tree
Breadcrumbs
AliceO2
/
version
/
CMakeLists.txt
Copy path
More file actions
More file actions
Latest commit
History
History
History
58 lines (45 loc) · 2.19 KB
Breadcrumbs
AliceO2
/
version
/
CMakeLists.txt
Copy path
File metadata and controls
58 lines (45 loc) · 2.19 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#
Generate a O2Version header and library that contain a couple of useful
#
fields such as the git commit with which we build.
#
We can also use this to define VERSION MACROS etc.
include
(
O2NameTarget
)
execute_process
(
COMMAND
git
log
--oneline
-1
--pretty=format:%h
WORKING_DIRECTORY
${
CMAKE_SOURCE_DIR
}
OUTPUT_VARIABLE
O2_GIT_REVISION
RESULT_VARIABLE
O2_GITCHECK_RETURN_STATUS
)
#
check if above command was ok
if
(
NOT
O2_GITCHECK_RETURN_STATUS
STREQUAL
"0"
)
set
(O2_GIT_REVISION
"--unknown--"
)
endif
()
#
check if we there are uncommited changes to the git
execute_process
(
COMMAND
git
diff-index
HEAD
--
WORKING_DIRECTORY
${
CMAKE_SOURCE_DIR
}
OUTPUT_VARIABLE
O2_LOCAL_CHANGES
RESULT_VARIABLE
O2_LOCAL_CHANGES_RETURN_STATUS
)
if
(O2_LOCAL_CHANGES_RETURN_STATUS
STREQUAL
"0"
AND
DEFINED
O2_LOCAL_CHANGES
AND
NOT
O2_LOCAL_CHANGES
STREQUAL
""
)
set
(O2_GIT_REVISION
"
${O2_GIT_REVISION}
(+local changes)"
)
endif
()
if
(
DEFINED
ENV{ALIBUILD_VERSION})
#
The build was done with alibuild
#
We record the alibuild version and alidist revision.
#
-- PLEASE KEEP comma separated format with key:value so that parsing is possible --
set
(BUILD_INFO_TEXT
"ALIBUILD:
$ENV{ALIBUILD_VERSION}
, ALIDIST-REV:
$ENV{ALIBUILD_ALIDIST_HASH}
"
)
else
()
#
The build was done by other means
set
(BUILD_INFO_TEXT
"--unavailable--"
)
endif
()
CONFIGURE_FILE
(
${
CMAKE_CURRENT_SOURCE_DIR
}
/O2Version.cxx.in
${
CMAKE_CURRENT_BINARY_DIR
}
/O2Version.cxx
@ONLY
)
#
provide a static lib for internal linking
add_library
(
version
STATIC
)
target_sources
(
version
PRIVATE
${
CMAKE_CURRENT_BINARY_DIR
}
/O2Version.cxx
)
target_include_directories
(
version
PUBLIC
${
CMAKE_CURRENT_SOURCE_DIR
}
)
add_library
(
O2::Version
ALIAS
version
)
#
provide also a shared lib + header so that we can query from outside (ROOT macros)
add_library
(
O2Version_shared
)
target_sources
(
O2Version_shared
PRIVATE
${
CMAKE_CURRENT_BINARY_DIR
}
/O2Version.cxx
)
target_include_directories
(
O2Version_shared
PUBLIC
${
CMAKE_CURRENT_SOURCE_DIR
}
)
add_library
(
O2::VersionShared
ALIAS
O2Version_shared
)
install
(
FILES
O2Version.h
DESTINATION
include)
install
(
TARGETS
O2Version_shared
DESTINATION
lib)
Back
|
FazBrowse Home
|
New Git URL