diff --git a/cmake_modules/IMPFindCompilerFlags.cmake b/cmake_modules/IMPFindCompilerFlags.cmake index 0a6203e5f0..721b312879 100644 --- a/cmake_modules/IMPFindCompilerFlags.cmake +++ b/cmake_modules/IMPFindCompilerFlags.cmake @@ -15,10 +15,7 @@ endif() if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE) -message(STATUS "GCC version: ${GCC_VERSION}") -if (GCC_VERSION VERSION_GREATER 4.6 OR GCC_VERSION VERSION_EQUAL 4.6) -message(STATUS "No conversion issue") -elseif (GCC_VERSION VERSION_GREATER 4.3 OR GCC_VERSION VERSION_EQUAL 4.3) +if (GCC_VERSION VERSION_LESS 4.6 AND (GCC_VERSION VERSION_GREATER 4.3 OR GCC_VERSION VERSION_EQUAL 4.3)) add_definitions("-Wno-conversion") endif() endif()