Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG UE
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
OpenXG
OpenXG UE
Commits
d8a8fbf0
Commit
d8a8fbf0
authored
Nov 15, 2020
by
Robert Schmidt
Committed by
Robert Schmidt
Feb 21, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move CMake macro definitions to separate file
parent
9ddc76c7
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
99 additions
and
100 deletions
+99
-100
cmake_targets/CMakeLists.txt
cmake_targets/CMakeLists.txt
+1
-100
cmake_targets/macros.cmake
cmake_targets/macros.cmake
+98
-0
No files found.
cmake_targets/CMakeLists.txt
View file @
d8a8fbf0
...
@@ -24,6 +24,7 @@
...
@@ -24,6 +24,7 @@
cmake_minimum_required
(
VERSION 2.8
)
cmake_minimum_required
(
VERSION 2.8
)
project
(
OpenAirInterface LANGUAGES C CXX
)
project
(
OpenAirInterface LANGUAGES C CXX
)
include
(
"macros.cmake"
)
# System packages that are required
# System packages that are required
# We use either the cmake buildin, in ubuntu are in: /usr/share/cmake*/Modules/
# We use either the cmake buildin, in ubuntu are in: /usr/share/cmake*/Modules/
...
@@ -185,106 +186,6 @@ else (CUDA_FOUND)
...
@@ -185,106 +186,6 @@ else (CUDA_FOUND)
message
(
"No CUDA tool installed"
)
message
(
"No CUDA tool installed"
)
endif
()
endif
()
###########################################
# macros to define options as there is numerous options in oai
################################################
macro
(
add_option name val helpstr
)
if
(
DEFINED
${
name
}
)
set
(
value
${${
name
}}
)
else
(
DEFINED
${
name
}
)
set
(
value
${
val
}
)
endif
()
set
(
${
name
}
${
value
}
CACHE STRING
"
${
helpstr
}
"
)
add_definitions
(
"-D
${
name
}
=
${
value
}
"
)
endmacro
(
add_option
)
macro
(
add_boolean_option name val helpstr
)
if
(
DEFINED
${
name
}
)
set
(
value
${${
name
}}
)
else
(
DEFINED
${
name
}
)
set
(
value
${
val
}
)
endif
()
set
(
${
name
}
${
value
}
CACHE STRING
"
${
helpstr
}
"
)
set_property
(
CACHE
${
name
}
PROPERTY TYPE BOOL
)
if
(
${
value
}
)
add_definitions
(
"-D
${
name
}
"
)
endif
(
${
value
}
)
endmacro
(
add_boolean_option
)
macro
(
add_integer_option name val helpstr
)
if
(
DEFINED
${
name
}
)
set
(
value
${${
name
}}
)
else
(
DEFINED
${
name
}
)
set
(
value
${
val
}
)
endif
()
set
(
${
name
}
${
value
}
CACHE STRING
"
${
helpstr
}
"
)
add_definitions
(
"-D
${
name
}
=
${
value
}
"
)
endmacro
(
add_integer_option
)
macro
(
add_list1_option name val helpstr
)
if
(
DEFINED
${
name
}
)
set
(
value
${${
name
}}
)
else
(
DEFINED
${
name
}
)
set
(
value
${
val
}
)
endif
()
set
(
${
name
}
${
value
}
CACHE STRING
"
${
helpstr
}
"
)
set_property
(
CACHE
${
name
}
PROPERTY STRINGS
${
ARGN
}
)
if
(
NOT
"
${
value
}
"
STREQUAL
"False"
)
add_definitions
(
"-D
${
name
}
=
${
value
}
"
)
endif
()
endmacro
(
add_list1_option
)
macro
(
add_list2_option name val helpstr
)
if
(
DEFINED
${
name
}
)
set
(
value
${${
name
}}
)
else
(
DEFINED
${
name
}
)
set
(
value
${
val
}
)
endif
()
set
(
${
name
}
${
value
}
CACHE STRING
"
${
helpstr
}
"
)
set_property
(
CACHE
${
name
}
PROPERTY STRINGS
${
ARGN
}
)
if
(
NOT
"
${
value
}
"
STREQUAL
"False"
)
add_definitions
(
"-D
${
value
}
=1"
)
endif
()
endmacro
(
add_list2_option
)
macro
(
add_list_string_option name val helpstr
)
if
(
DEFINED
${
name
}
)
set
(
value
${${
name
}}
)
else
(
DEFINED
${
name
}
)
set
(
value
${
val
}
)
endif
()
set
(
${
name
}
${
value
}
CACHE STRING
"
${
helpstr
}
"
)
set_property
(
CACHE
${
name
}
PROPERTY STRINGS
${
ARGN
}
)
if
(
NOT
"
${
value
}
"
STREQUAL
"False"
)
add_definitions
(
"-D
${
name
}
=
\"
${
value
}
\"
"
)
endif
()
endmacro
(
add_list_string_option
)
# this function should produce the same value as the macro MAKE_VERSION defined in the C code (file types.h)
function
(
make_version VERSION_VALUE
)
math
(
EXPR RESULT
"0"
)
foreach
(
ARG
${
ARGN
}
)
math
(
EXPR RESULT
"
${
RESULT
}
* 16 +
${
ARG
}
"
)
endforeach
()
set
(
${
VERSION_VALUE
}
"
${
RESULT
}
"
PARENT_SCOPE
)
endfunction
()
macro
(
compile_asn1 asn1Source asn1cCmd ResultFlag
)
# Warning: if you modify ASN.1 source file to generate new C files, cmake should be re-run instead of make
execute_process
(
COMMAND
${
asn1cCmd
}
${
asn1Source
}
RESULT_VARIABLE ret
)
if
(
NOT
${
ret
}
STREQUAL 0
)
message
(
FATAL_ERROR
"
${
ret
}
: error"
)
endif
(
NOT
${
ret
}
STREQUAL 0
)
add_custom_target
(
${
ResultFlag
}
ALL
${
asn1cCmd
}
${
asn1Source
}
DEPENDS
${
asn1Source
}
)
endmacro
(
compile_asn1
)
####################################################
####################################################
# compilation flags
# compilation flags
#############################################
#############################################
...
...
cmake_targets/macros.cmake
0 → 100644
View file @
d8a8fbf0
###########################################
# macros to define options as there is numerous options in oai
################################################
macro
(
add_option name val helpstr
)
if
(
DEFINED
${
name
}
)
set
(
value
${${
name
}}
)
else
(
DEFINED
${
name
}
)
set
(
value
${
val
}
)
endif
()
set
(
${
name
}
${
value
}
CACHE STRING
"
${
helpstr
}
"
)
add_definitions
(
"-D
${
name
}
=
${
value
}
"
)
endmacro
(
add_option
)
macro
(
add_boolean_option name val helpstr
)
if
(
DEFINED
${
name
}
)
set
(
value
${${
name
}}
)
else
(
DEFINED
${
name
}
)
set
(
value
${
val
}
)
endif
()
set
(
${
name
}
${
value
}
CACHE STRING
"
${
helpstr
}
"
)
set_property
(
CACHE
${
name
}
PROPERTY TYPE BOOL
)
if
(
${
value
}
)
add_definitions
(
"-D
${
name
}
"
)
endif
(
${
value
}
)
endmacro
(
add_boolean_option
)
macro
(
add_integer_option name val helpstr
)
if
(
DEFINED
${
name
}
)
set
(
value
${${
name
}}
)
else
(
DEFINED
${
name
}
)
set
(
value
${
val
}
)
endif
()
set
(
${
name
}
${
value
}
CACHE STRING
"
${
helpstr
}
"
)
add_definitions
(
"-D
${
name
}
=
${
value
}
"
)
endmacro
(
add_integer_option
)
macro
(
add_list1_option name val helpstr
)
if
(
DEFINED
${
name
}
)
set
(
value
${${
name
}}
)
else
(
DEFINED
${
name
}
)
set
(
value
${
val
}
)
endif
()
set
(
${
name
}
${
value
}
CACHE STRING
"
${
helpstr
}
"
)
set_property
(
CACHE
${
name
}
PROPERTY STRINGS
${
ARGN
}
)
if
(
NOT
"
${
value
}
"
STREQUAL
"False"
)
add_definitions
(
"-D
${
name
}
=
${
value
}
"
)
endif
()
endmacro
(
add_list1_option
)
macro
(
add_list2_option name val helpstr
)
if
(
DEFINED
${
name
}
)
set
(
value
${${
name
}}
)
else
(
DEFINED
${
name
}
)
set
(
value
${
val
}
)
endif
()
set
(
${
name
}
${
value
}
CACHE STRING
"
${
helpstr
}
"
)
set_property
(
CACHE
${
name
}
PROPERTY STRINGS
${
ARGN
}
)
if
(
NOT
"
${
value
}
"
STREQUAL
"False"
)
add_definitions
(
"-D
${
value
}
=1"
)
endif
()
endmacro
(
add_list2_option
)
macro
(
add_list_string_option name val helpstr
)
if
(
DEFINED
${
name
}
)
set
(
value
${${
name
}}
)
else
(
DEFINED
${
name
}
)
set
(
value
${
val
}
)
endif
()
set
(
${
name
}
${
value
}
CACHE STRING
"
${
helpstr
}
"
)
set_property
(
CACHE
${
name
}
PROPERTY STRINGS
${
ARGN
}
)
if
(
NOT
"
${
value
}
"
STREQUAL
"False"
)
add_definitions
(
"-D
${
name
}
=
\"
${
value
}
\"
"
)
endif
()
endmacro
(
add_list_string_option
)
# this function should produce the same value as the macro MAKE_VERSION defined in the C code (file types.h)
function
(
make_version VERSION_VALUE
)
math
(
EXPR RESULT
"0"
)
foreach
(
ARG
${
ARGN
}
)
math
(
EXPR RESULT
"
${
RESULT
}
* 16 +
${
ARG
}
"
)
endforeach
()
set
(
${
VERSION_VALUE
}
"
${
RESULT
}
"
PARENT_SCOPE
)
endfunction
()
macro
(
compile_asn1 asn1Source asn1cCmd ResultFlag
)
# Warning: if you modify ASN.1 source file to generate new C files, cmake should be re-run instead of make
execute_process
(
COMMAND
${
asn1cCmd
}
${
asn1Source
}
RESULT_VARIABLE ret
)
if
(
NOT
${
ret
}
STREQUAL 0
)
message
(
FATAL_ERROR
"
${
ret
}
: error"
)
endif
(
NOT
${
ret
}
STREQUAL 0
)
add_custom_target
(
${
ResultFlag
}
ALL
${
asn1cCmd
}
${
asn1Source
}
DEPENDS
${
asn1Source
}
)
endmacro
(
compile_asn1
)
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