Skip to content
Snippets Groups Projects
Commit bd578fd8 authored by Steffen Müthing's avatar Steffen Müthing
Browse files

[Release][CMake][Bugfix] Fix definition setup in dune_enable_all_packages()

We have to call add_definitions() in a loop because add_definitions() is
kind of broken: even though it is supposed to be *the* function for
adding compile definitions, it does not prepend "-D" (as opposed to
target_compile_definitions(), which does). Well, whatever...
parent c849d756
No related branches found
No related tags found
No related merge requests found
...@@ -145,7 +145,14 @@ function(dune_enable_all_packages) ...@@ -145,7 +145,14 @@ function(dune_enable_all_packages)
# add compile definitions to all targets in module # add compile definitions to all targets in module
get_property(all_defs GLOBAL PROPERTY ALL_PKG_DEFS) get_property(all_defs GLOBAL PROPERTY ALL_PKG_DEFS)
add_definitions(${all_defs}) # We have to do this in a loop because add_definitions() is kind of broken: even though it is supposed
# to be *the* function for adding compile definitions, it does not prepend "-D" (as opposed to
# target_compile_definitions(), which does). Well, whatever...
foreach(_definition ${all_defs})
if(_definition)
add_definitions("-D${_definition}")
endif()
endforeach()
# verbose output of compile definitions # verbose output of compile definitions
if(DUNE_ENABLE_ALL_PACKAGES_VERBOSE) if(DUNE_ENABLE_ALL_PACKAGES_VERBOSE)
message("Compile definitions for this project: ${all_defs}") message("Compile definitions for this project: ${all_defs}")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment