Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
oai
openairinterface5G
Commits
7c6e48d9
Commit
7c6e48d9
authored
Oct 02, 2016
by
Rohit Gupta
Browse files
detect nettle version using cmake
parent
93559037
Changes
1
Hide whitespace changes
Inline
Side-by-side
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
Supports
Markdown
0%
Try again
or
attach a new 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