summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorBaruch Sterin <baruchs@gmail.com>2015-11-05 01:24:26 -0800
committerBaruch Sterin <baruchs@gmail.com>2015-11-05 01:24:26 -0800
commit211c7ebe14a2d69f0550ed12b1e5133032aba4b9 (patch)
tree4eb63d8e08ca0f912f7ae11024175717bcd400c4 /CMakeLists.txt
parent0f14713dbc4e68f5b87e0cac99c44db97d58f666 (diff)
downloadabc-211c7ebe14a2d69f0550ed12b1e5133032aba4b9.tar.gz
abc-211c7ebe14a2d69f0550ed12b1e5133032aba4b9.tar.bz2
abc-211c7ebe14a2d69f0550ed12b1e5133032aba4b9.zip
CMakeLists.txt: pass namespace mode to the Makefile
Diffstat (limited to 'CMakeLists.txt')
-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 )