summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt9
1 files changed, 9 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d57dd032..c829f4a2 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -33,11 +33,16 @@ elseif(READLINE_FOUND MATCHES FALSE)
list(APPEND ABC_READLINE_FLAGS "ABC_USE_NO_READLINE=1")
endif()
+if(ABC_USE_NAMESPACE)
+ set(ABC_USE_NAMESPACE "ABC_USE_NAMESPACE=${ABC_USE_NAMESPACE}")
+endif()
+
# run make to extract compiler options, linker options and list of source files
execute_process(
COMMAND
make
${ABC_READLINE_FLAGS}
+ ${ABC_USE_NAMESPACE}
ABC_MAKE_NO_DEPS=1
CC=${CMAKE_C_COMPILER}
CXX=${CMAKE_CXX_COMPILER}
@@ -62,6 +67,10 @@ extract_var(SEPARATOR_LIBS ABC_LIBS ${MAKE_OUTPUT})
extract_var(SEPARATOR_CFLAGS ABC_CFLAGS ${MAKE_OUTPUT})
extract_var(SEPARATOR_CXXFLAGS ABC_CXXFLAGS ${MAKE_OUTPUT})
+if(ABC_USE_NAMESPACE)
+ set_source_files_properties(${ABC_SRC} PROPERTIES LANGUAGE CXX)
+endif()
+
function(abc_properties target visibility)
target_include_directories(${target} ${visibility} ${CMAKE_CURRENT_SOURCE_DIR}/src )
target_compile_options_filtered(${target} ${visibility} ${ABC_CFLAGS} ${ABC_CXXFLAGS} -Wno-unused-but-set-variable )