commit-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commit-gnuradio] [gnuradio] 01/07: cmake: cmake doesn't have a FIND com


From: git
Subject: [Commit-gnuradio] [gnuradio] 01/07: cmake: cmake doesn't have a FIND command for STRING until 2.8.5, so we're just cehcking for that here before using it.
Date: Mon, 28 Jul 2014 18:42:38 +0000 (UTC)

This is an automated email from the git hooks/post-receive script.

trondeau pushed a commit to branch master
in repository gnuradio.

commit 7f847769126c3141aa1db0b24bb82f80b8524e87
Author: Tom Rondeau <address@hidden>
Date:   Mon Jul 28 10:41:10 2014 -0400

    cmake: cmake doesn't have a FIND command for STRING until 2.8.5, so we're 
just cehcking for that here before using it.
    
    Using cmake < 2.8.5 will not dedup the cflags, but this is non-critical.
---
 cmake/Modules/GrMiscUtils.cmake | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/cmake/Modules/GrMiscUtils.cmake b/cmake/Modules/GrMiscUtils.cmake
index 69eae0e..188c404 100644
--- a/cmake/Modules/GrMiscUtils.cmake
+++ b/cmake/Modules/GrMiscUtils.cmake
@@ -94,11 +94,13 @@ macro(GR_ADD_CXX_COMPILER_FLAG_IF_AVAILABLE flag have)
     include(CheckCXXCompilerFlag)
     CHECK_CXX_COMPILER_FLAG(${flag} ${have})
     if(${have})
-      STRING(FIND "${CMAKE_CXX_FLAGS}" "${flag}" flag_dup)
-      if(${flag_dup} EQUAL -1)
-        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}")
-        set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${flag}")
-      endif(${flag_dup} EQUAL -1)
+      if(${CMAKE_VERSION} VERSION_GREATER "2.8.4")
+        STRING(FIND "${CMAKE_CXX_FLAGS}" "${flag}" flag_dup)
+        if(${flag_dup} EQUAL -1)
+          set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}")
+          set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${flag}")
+        endif(${flag_dup} EQUAL -1)
+      endif(${CMAKE_VERSION} VERSION_GREATER "2.8.4")
     endif(${have})
 endmacro(GR_ADD_CXX_COMPILER_FLAG_IF_AVAILABLE)
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]