Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-RAN
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wangjie
OpenXG-RAN
Commits
7c6e48d9
Commit
7c6e48d9
authored
Oct 02, 2016
by
Rohit Gupta
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
detect nettle version using cmake
parent
93559037
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
20 deletions
+18
-20
cmake_targets/CMakeLists.txt
cmake_targets/CMakeLists.txt
+18
-20
No files found.
cmake_targets/CMakeLists.txt
View file @
7c6e48d9
...
...
@@ -186,25 +186,6 @@ set(GIT_BRANCH "UNKNOWN")
set
(
GIT_COMMIT_HASH
"UNKNOWN"
)
set
(
GIT_COMMIT_DATE
"UNKNOWN"
)
#This is to detect nettle version changes between Ubuntu 14.04/16.04
set
(
nettle_cmd
"nettle-hash"
)
set
(
nettle_arg
"-V"
)
execute_process
(
COMMAND
${
nettle_cmd
}
${
nettle_arg
}
RESULT_VARIABLE rv OUTPUT_VARIABLE ov ERROR_VARIABLE ev
)
string
(
REGEX MATCH
"[+-]?[0-9]+([.][0-9]+)?"
nv
${
ov
}
)
message
(
"NETTLE_VERSION =
${
nv
}
"
)
# we need to remove decimal as floating point arithematic does not work properly with C preprocessor
STRING
(
REGEX REPLACE
"[.]"
""
nv
${
nv
}
)
if
(
"
${
nv
}
"
STREQUAL
""
)
message
(
FATAL_ERROR
"The nettle version not detected properly. Try to run build_oai -I again"
)
endif
()
set
(
NETTLE_VERSION
"
${
nv
}
"
)
add_definitions
(
"-DNETTLE_VERSION=
${
NETTLE_VERSION
}
"
)
find_package
(
Git
)
if
(
GIT_FOUND
)
message
(
"git found:
${
GIT_EXECUTABLE
}
"
)
...
...
@@ -1550,11 +1531,28 @@ endif()
pkg_search_module
(
NETTLE nettle
)
if
(
NOT
${
NETTLE_FOUND
}
)
message
(
"PACKAGE nettle not found: some targets will fail
"
)
message
(
FATAL_ERROR
"PACKAGE nettle not found: some targets will fail. Run build_oai -I again!
"
)
else
()
include_directories
(
${
NETTLE_INCLUDE_DIRS
}
)
endif
()
message
(
"NETTLE VERSION_INSTALLED =
${
NETTLE_VERSION
}
"
)
string
(
REGEX MATCH
"[+-]?[0-9]+([.][0-9]+)?"
nv
${
NETTLE_VERSION
}
)
# WE only pass the major and first minor in the define and ignore the rest
#message("NETTLE_VERSION USED = ${nv}")
# we need to remove decimal as floating point arithematic does not work properly with C preprocessor
STRING
(
REGEX REPLACE
"[.]"
""
nv
${
nv
}
)
if
(
"
${
nv
}
"
STREQUAL
""
)
message
(
FATAL_ERROR
"The nettle version not detected properly. Try to run build_oai -I again"
)
endif
()
set
(
NETTLE_VERSION
"
${
nv
}
"
)
add_definitions
(
"-DNETTLE_VERSION=
${
NETTLE_VERSION
}
"
)
pkg_search_module
(
XPM xpm
)
if
(
NOT
${
XPM_FOUND
}
)
message
(
"PACKAGE xpm not found: some targets will fail"
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment