mirror of
https://gitlab.eurecom.fr/oai/openairinterface5g.git
synced 2026-07-13 04:30:28 +00:00
update CMakeLists for ubuntu 16.04
The previous version did not compile on ubuntu 16.04. I left the old version, commented, just in case.
This commit is contained in:
@@ -88,31 +88,47 @@ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -msse4.2 -std=gnu99 -Wall -Wstrict-prototype
|
||||
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -ggdb -DMALLOC_CHECK_=3")
|
||||
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} -ggdb -DMALLOC_CHECK_=3 -O2")
|
||||
|
||||
#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}")
|
||||
##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}")
|
||||
|
||||
include(FindPkgConfig)
|
||||
|
||||
INCLUDE(FindNettle)
|
||||
IF( NOT NETTLE_FOUND )
|
||||
MESSAGE( SEND_ERROR "Nettle is required" )
|
||||
ENDIF( NOT NETTLE_FOUND )
|
||||
pkg_search_module(NETTLE nettle)
|
||||
if(NOT ${NETTLE_FOUND})
|
||||
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 REPLACE "([0-9]+).*" "\\1" NETTLE_VERSION_MAJOR ${NETTLE_VERSION})
|
||||
string(REGEX REPLACE "[0-9]+\\.([0-9]+).*" "\\1" NETTLE_VERSION_MINOR ${NETTLE_VERSION})
|
||||
message ("NETTLE_VERSION_MAJOR = ${NETTLE_VERSION_MAJOR}")
|
||||
message ("NETTLE_VERSION_MINOR = ${NETTLE_VERSION_MINOR}")
|
||||
|
||||
if ("${NETTLE_VERSION_MAJOR}" STREQUAL "" OR "${NETTLE_VERSION_MINOR}" STREQUAL "")
|
||||
message( FATAL_ERROR "The nettle version not detected properly. Try to run build_oai -I again" )
|
||||
endif()
|
||||
|
||||
add_definitions("-DNETTLE_VERSION_MAJOR=${NETTLE_VERSION_MAJOR}")
|
||||
add_definitions("-DNETTLE_VERSION_MINOR=${NETTLE_VERSION_MINOR}")
|
||||
|
||||
|
||||
pkg_search_module(OPENSSL openssl REQUIRED)
|
||||
|
||||
Reference in New Issue
Block a user