From f581aa159486369f7083d15dfd7e92dad8751c23 Mon Sep 17 00:00:00 2001 From: Simon Rit Date: Mon, 1 Oct 2012 16:44:05 +0200 Subject: [PATCH] Fix for old versions of gcc --- cmake/FindGengetopt.cmake | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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) -- 2.47.1