From: Simon Rit Date: Mon, 1 Oct 2012 14:44:05 +0000 (+0200) Subject: Fix for old versions of gcc X-Git-Tag: v1.3.0~1 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=f581aa159486369f7083d15dfd7e92dad8751c23;p=clitk.git Fix for old versions of gcc --- diff --git a/cmake/FindGengetopt.cmake b/cmake/FindGengetopt.cmake index 78098f9..95f2a47 100644 --- a/cmake/FindGengetopt.cmake +++ b/cmake/FindGengetopt.cmake @@ -33,6 +33,10 @@ MACRO (WRAP_GGO GGO_SRCS) ENDFOREACH(GGO_FILE) SET_SOURCE_FILES_PROPERTIES(${${GGO_SRCS}} PROPERTIES GENERATED TRUE) IF(CMAKE_COMPILER_IS_GNUCXX) - SET_SOURCE_FILES_PROPERTIES(${${GGO_SRCS}} PROPERTIES COMPILE_FLAGS "-Wno-unused-but-set-variable") + FIND_PROGRAM(DEFAULT_GCC gcc) + EXEC_PROGRAM(${DEFAULT_GCC} ARGS "-dumpversion" OUTPUT_VARIABLE GCCVER) + IF("${GCCVER}" VERSION_GREATER "4.5.2") + SET_SOURCE_FILES_PROPERTIES(${${GGO_SRCS}} PROPERTIES COMPILE_FLAGS "-Wno-unused-but-set-variable") + ENDIF("${GCCVER}" VERSION_GREATER "4.5.2") ENDIF(CMAKE_COMPILER_IS_GNUCXX) ENDMACRO (WRAP_GGO)