Some modules may still export definitions using -D, strip it.

This commit is contained in:
Markus Blatt 2021-03-17 17:27:26 +01:00
parent 213f0c0afa
commit 05128745cf

View File

@ -30,7 +30,9 @@ macro (opm_compile opm)
# create this library, if there are any compilation units
link_directories (${${opm}_LIBRARY_DIRS})
if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.12")
add_compile_definitions (${${opm}_DEFINITIONS})
# Some modules may still export definitions using -D, strip it
string(REGEX REPLACE "-D" "" _clean_defs "${${opm}_DEFINITIONS}")
add_compile_definitions(${_clean_defs})
else()
add_definitions(${${opm}_DEFINITIONS})
endif()