aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2018-10-08 17:32:54 +0200
committerGravatar Gael Guennebaud <g.gael@free.fr>2018-10-08 17:32:54 +0200
commitaa5820056ec1a21b23c716b2b6519c16f9fe4d04 (patch)
treed39f75bf9af583be241c96aa30561d71c08bcd51
parente21766c6f585e833aa7e4c02f3d50d7d276c0fd4 (diff)
Unify c++11 usage in doc's examples and snippets
-rw-r--r--doc/CMakeLists.txt3
-rw-r--r--doc/examples/CMakeLists.txt1
-rw-r--r--doc/snippets/CMakeLists.txt2
-rw-r--r--doc/special_examples/CMakeLists.txt1
4 files changed, 4 insertions, 3 deletions
diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt
index db413bc65..9f6730b9c 100644
--- a/doc/CMakeLists.txt
+++ b/doc/CMakeLists.txt
@@ -10,6 +10,9 @@ if(CMAKE_COMPILER_IS_GNUCXX)
endif(CMAKE_SYSTEM_NAME MATCHES Linux)
endif(CMAKE_COMPILER_IS_GNUCXX)
+# some examples and snippets needs c++11, so let's check it once
+check_cxx_compiler_flag("-std=c++11" EIGEN_COMPILER_SUPPORT_CPP11)
+
option(EIGEN_INTERNAL_DOCUMENTATION "Build internal documentation" OFF)
diff --git a/doc/examples/CMakeLists.txt b/doc/examples/CMakeLists.txt
index f7a19055f..4fa0b1019 100644
--- a/doc/examples/CMakeLists.txt
+++ b/doc/examples/CMakeLists.txt
@@ -15,7 +15,6 @@ foreach(example_src ${examples_SRCS})
add_dependencies(all_examples ${example})
endforeach(example_src)
-check_cxx_compiler_flag("-std=c++11" EIGEN_COMPILER_SUPPORT_CPP11)
if(EIGEN_COMPILER_SUPPORT_CPP11)
ei_add_target_property(nullary_indexing COMPILE_FLAGS "-std=c++11")
endif() \ No newline at end of file
diff --git a/doc/snippets/CMakeLists.txt b/doc/snippets/CMakeLists.txt
index d2f787424..cf3f6de4f 100644
--- a/doc/snippets/CMakeLists.txt
+++ b/doc/snippets/CMakeLists.txt
@@ -6,7 +6,7 @@ foreach(snippet_src ${snippets_SRCS})
get_filename_component(snippet ${snippet_src} NAME_WE)
set(compile_snippet_target compile_${snippet})
set(compile_snippet_src ${compile_snippet_target}.cpp)
- if((NOT ${snippet_src} MATCHES "cxx11") OR EIGEN_COMPILER_SUPPORT_CXX11)
+ if((NOT ${snippet_src} MATCHES "cxx11") OR EIGEN_COMPILER_SUPPORT_CPP11)
file(READ ${snippet_src} snippet_source_code)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/compile_snippet.cpp.in
${CMAKE_CURRENT_BINARY_DIR}/${compile_snippet_src})
diff --git a/doc/special_examples/CMakeLists.txt b/doc/special_examples/CMakeLists.txt
index 101fbc5f9..66ba4deee 100644
--- a/doc/special_examples/CMakeLists.txt
+++ b/doc/special_examples/CMakeLists.txt
@@ -19,7 +19,6 @@ if(QT4_FOUND)
add_dependencies(all_examples Tutorial_sparse_example)
endif(QT4_FOUND)
-check_cxx_compiler_flag("-std=c++11" EIGEN_COMPILER_SUPPORT_CPP11)
if(EIGEN_COMPILER_SUPPORT_CPP11)
add_executable(random_cpp11 random_cpp11.cpp)
target_link_libraries(random_cpp11 ${EIGEN_STANDARD_LIBRARIES_TO_LINK_TO})