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
alex037yang
OpenXG-RAN
Commits
f9739f2b
Commit
f9739f2b
authored
Nov 15, 2020
by
Robert Schmidt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move CMake micro definitions to separate file
parent
3f6df6b9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
83 additions
and
83 deletions
+83
-83
cmake_targets/CMakeLists.txt
cmake_targets/CMakeLists.txt
+1
-83
cmake_targets/macros.cmake
cmake_targets/macros.cmake
+82
-0
No files found.
cmake_targets/CMakeLists.txt
View file @
f9739f2b
...
...
@@ -23,6 +23,7 @@
cmake_minimum_required
(
VERSION 3.0
)
include
(
"macros.cmake"
)
# System packages that are required
# We use either the cmake buildin, in ubuntu are in: /usr/share/cmake*/Modules/
...
...
@@ -177,89 +178,6 @@ else (CUDA_FOUND)
message
(
"No CUDA tool installed"
)
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
)
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
()
####################################################
# compilation flags
#############################################
...
...
cmake_targets/macros.cmake
0 → 100644
View file @
f9739f2b
###########################################
# 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
)
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
()
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