summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt10
1 files changed, 10 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 892bf72..406a4d8 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -97,6 +97,16 @@ endif(SWIG)
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall" )
+execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpversion
+ OUTPUT_VARIABLE GCC_VERSION)
+if (GCC_VERSION VERSION_GREATER 4.7 OR GCC_VERSION VERSION_EQUAL 4.7)
+ message(STATUS "Version >= 4.7")
+ # gcc 4.7 no longer performs unqualified lookups by default, see: http://gcc.gnu.org/gcc-4.7/porting_to.html.
+ # This workaround is added for xsd code, which fails otherwise to compile. -fpermissive turns the errors into warnings.
+ # It's only temporary, and should be removed once xsd is fixed.
+ set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fpermissive" )
+endif()
+
# set( CMAKE_VERBOSE_MAKEFILE on )
set(CMAKE_BUILD_TYPE Debug)