commit-gnuradio
[Top][All Lists]
Advanced

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

[Commit-gnuradio] [gnuradio] 05/14: cmake: fixing up FindICE to handle m


From: git
Subject: [Commit-gnuradio] [gnuradio] 05/14: cmake: fixing up FindICE to handle more possible install cases.
Date: Fri, 9 May 2014 22:28:43 +0000 (UTC)

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

jcorgan pushed a commit to branch master
in repository gnuradio.

commit e93322edd36ef955d7ce17064ecc101f1eb12c68
Author: Tom Rondeau <address@hidden>
Date:   Wed May 7 21:20:14 2014 -0400

    cmake: fixing up FindICE to handle more possible install cases.
    
    Dropping use of package-config files from Ice. They don't exist when 
installing by hand and seem incorrect on some Linux installations.
---
 cmake/Modules/FindICE-3.5.cmake | 212 +++++++++++++++++++-------------------
 cmake/Modules/FindICE.cmake     | 221 +++++++++++++++++++---------------------
 2 files changed, 209 insertions(+), 224 deletions(-)

diff --git a/cmake/Modules/FindICE-3.5.cmake b/cmake/Modules/FindICE-3.5.cmake
index d4421ab..f3dbb08 100644
--- a/cmake/Modules/FindICE-3.5.cmake
+++ b/cmake/Modules/FindICE-3.5.cmake
@@ -1,133 +1,127 @@
 # Override the search path for ICE; useful for manually installed libs.
 #    set(ICE_MANUAL_INSTALL_PATH /opt/Ice-3.5.0/)
 
-FIND_PACKAGE(PkgConfig)
-PKG_CHECK_MODULES(PC_ICE Ice-3.5 QUIET)
-
-if(NOT ICE_FOUND)
-  # Maybe we don't have a .pc file for Ice. Check for Config.h. If
-  # that exists, get the version string and parse it for the proper
-  # version.
-  FIND_PATH(
-    ICE_CONFIG_INCLUDE_DIR
-    NAMES IceUtil/Config.h
-    HINTS ${ICE_MANUAL_INSTALL_PATH}/include/ ${CMAKE_INSTALL_PREFIX}/include/
-    )
-  if(ICE_CONFIG_INCLUDE_DIR)
-    file(STRINGS "${ICE_CONFIG_INCLUDE_DIR}/IceUtil/Config.h"
-      ICE_STRING_VERSION REGEX "ICE_STRING_VERSION")
-    string(REGEX MATCH "3.5" ICE_FOUND ${ICE_STRING_VERSION})
-    if(ICE_FOUND)
-      set(ICE_FOUND TRUE)
-    endif(ICE_FOUND)
-  endif(ICE_CONFIG_INCLUDE_DIR)
-endif(NOT ICE_FOUND)
-
-if(NOT ICE_FOUND)
-  message(STATUS "  package 'Ice-3.5' not found")
-endif(NOT ICE_FOUND)
-
-# Recheck if we found the right version of ICE and proceed if true.
-if(ICE_FOUND)
-
-# Prepare the path hint for the libraries based on the include
-# directory found.
-string(REGEX REPLACE "/include" "" ICE_PATH ${ICE_CONFIG_INCLUDE_DIR})
+message(STATUS "Checking for Ice-3.5")
 
 FIND_PATH(
-  ICE_INCLUDE_DIR
-  NAMES IceUtil/IceUtil.h Ice/Ice.h
-  NO_DEFAULT_PATH
-  HINTS ${ICE_PATH}/include
+  ICE_CONFIG_INCLUDE_DIR
+  NAMES IceUtil/Config.h
+  HINTS ${ICE_MANUAL_INSTALL_PATH}/include/ ${CMAKE_INSTALL_PREFIX}/include/
 )
 
-set(ICE_LIBRARY )
+if(ICE_CONFIG_INCLUDE_DIR)
+  file(STRINGS "${ICE_CONFIG_INCLUDE_DIR}/IceUtil/Config.h"
+    ICE_STRING_VERSION REGEX "ICE_STRING_VERSION")
+  string(REGEX MATCH "3.5" ICE_FOUND ${ICE_STRING_VERSION})
+  if(ICE_FOUND)
+    set(ICE_FOUND TRUE)
+  endif(ICE_FOUND)
+endif(ICE_CONFIG_INCLUDE_DIR)
 
-if(APPLE)
-  set(ICE_LIB_PREFIX "Zeroc")
-else()
-  set(ICE_LIB_PREFIX "")
-endif(APPLE)
+if(NOT ICE_FOUND)
+  message(STATUS "  package 'Ice-3.5' not found")
 
-FIND_LIBRARY(
-  ICE_ICE ${ICE_LIB_PREFIX}Ice
-  NO_DEFAULT_PATH
-  HINTS ${ICE_PATH}/lib ${ICE_PATH}/lib64
-)
-FIND_LIBRARY(
-  ICE_ICESTORM ${ICE_LIB_PREFIX}IceStorm
-  NO_DEFAULT_PATH
-  HINTS ${ICE_PATH}/lib ${ICE_PATH}/lib64
-)
-FIND_LIBRARY(
-  ICE_ICEGRID ${ICE_LIB_PREFIX}IceGrid
-  NO_DEFAULT_PATH
-  HINTS ${ICE_PATH}/lib ${ICE_PATH}/lib64
-)
-FIND_LIBRARY(
-  ICE_ICEUTIL ${ICE_LIB_PREFIX}IceUtil
-  NO_DEFAULT_PATH
-  HINTS ${ICE_PATH}/lib ${ICE_PATH}/lib64
-)
-FIND_LIBRARY(
-  ICE_GLACIER2 Glacier2
-  NO_DEFAULT_PATH
-  HINTS ${ICE_PATH}/lib ${ICE_PATH}/lib64
-)
+else(NOT ICE_FOUND)
+  message(STATUS "  ICE 3.5 Include directory found: 
${ICE_CONFIG_INCLUDE_DIR}")
 
-FIND_LIBRARY(
-  ICE_PTHREAD NAMES pthread pthread-2.13
-  HINTS ${CMAKE_INSTALL_PREFIX}/lib64/ ${CMAKE_INSTALL_PREFIX}/lib/
-  HINTS ${PC_ICE_LIBDIR} ${PC_ICE_LIBRARY_DIRS} /lib/i386-linux-gnu 
/lib/x86_64-linux-gnu /usr/lib /lib /lib64
-  ENV LD_LIBRARY_PATH
-)
+  # Prepare the path hint for the libraries based on the include
+  # directory found.
+  string(REGEX REPLACE "/include" "" ICE_PATH ${ICE_CONFIG_INCLUDE_DIR})
 
-set(ICE_FOUND FALSE)
+  FIND_PATH(
+    ICE_INCLUDE_DIR
+    NAMES IceUtil/IceUtil.h Ice/Ice.h
+    NO_DEFAULT_PATH
+    HINTS ${ICE_PATH}/include
+  )
+
+  set(ICE_LIBRARY )
+
+  if(APPLE)
+    set(ICE_LIB_PREFIX "Zeroc")
+  else()
+    set(ICE_LIB_PREFIX "")
+  endif(APPLE)
+
+  FIND_LIBRARY(
+    ICE_ICE ${ICE_LIB_PREFIX}Ice
+    HINTS ${ICE_PATH}/lib ${ICE_PATH}/lib64
+    )
+  FIND_LIBRARY(
+    ICE_ICESTORM ${ICE_LIB_PREFIX}IceStorm
+    HINTS ${ICE_PATH}/lib ${ICE_PATH}/lib64
+    )
+  FIND_LIBRARY(
+    ICE_ICEGRID ${ICE_LIB_PREFIX}IceGrid
+    HINTS ${ICE_PATH}/lib ${ICE_PATH}/lib64
+    )
+  FIND_LIBRARY(
+    ICE_ICEUTIL ${ICE_LIB_PREFIX}IceUtil
+    HINTS ${ICE_PATH}/lib ${ICE_PATH}/lib64
+    )
+  FIND_LIBRARY(
+    ICE_GLACIER2 Glacier2
+    HINTS ${ICE_PATH}/lib ${ICE_PATH}/lib64
+    )
 
-if(ICE_ICE AND ICE_ICEUTIL)
-  list(APPEND ICE_LIBRARY
-    ${ICE_ICE}
-    ${ICE_ICEUTIL}
+  FIND_LIBRARY(
+    ICE_PTHREAD NAMES pthread pthread-2.13
+    HINTS ${CMAKE_INSTALL_PREFIX}/lib64/ ${CMAKE_INSTALL_PREFIX}/lib/
+    HINTS ${PC_ICE_LIBDIR} ${PC_ICE_LIBRARY_DIRS} /lib/i386-linux-gnu 
/lib/x86_64-linux-gnu /usr/lib /lib /lib64
+    ENV LD_LIBRARY_PATH
     )
 
-  if(CMAKE_CROSSCOMPILING)
-    # When cross-compiling, we set up the environment/toolchain to put
-    # the right slice2cpp/py in the path. We just need to grab that here.
-    FIND_PROGRAM(ICE_SLICE2CPP slice2cpp)
-    FIND_PROGRAM(ICE_SLICE2PY slice2py)
+  set(ICE_FOUND FALSE)
 
-    # We also don't need to look for Python in this case, so just
-    # force this to TRUE here.
-    set(ICE_FOUND TRUE)
+  message(STATUS "  libIce: ${ICE_ICE}")
+  message(STATUS "  libIceUtil: ${ICE_ICEUTIL}")
 
-  else(CMAKE_CROSSCOMPILING)
+  # Make sure we have these two libs in particular
+  # - me might expand this list requirement in the future
+  if(ICE_ICE AND ICE_ICEUTIL)
+    list(APPEND ICE_LIBRARY
+      ${ICE_ICE}
+      ${ICE_ICEUTIL}
+      )
 
-    FIND_PROGRAM(ICE_SLICE2CPP slice2cpp
-      HINTS ${CMAKE_INSTALL_PREFIX}/bin ${ICE_MANUAL_INSTALL_PATH}/bin/)
-    FIND_PROGRAM(ICE_SLICE2PY slice2py
-      HINTS ${CMAKE_INSTALL_PREFIX}/bin ${ICE_MANUAL_INSTALL_PATH}/bin/)
+    if(CMAKE_CROSSCOMPILING)
+      # When cross-compiling, we set up the environment/toolchain to put
+      # the right slice2cpp/py in the path. We just need to grab that here.
+      FIND_PROGRAM(ICE_SLICE2CPP slice2cpp)
+      FIND_PROGRAM(ICE_SLICE2PY slice2py)
 
-    # Check that the ICE Python package is installed
-    include(GrPython)
-    GR_PYTHON_CHECK_MODULE("Ice >= 3.5" Ice "Ice.stringVersion() >= '3.5.0'" 
PYTHON_ICE_FOUND)
-    if(PYTHON_ICE_FOUND)
+      # We also don't need to look for Python in this case, so just
+      # force this to TRUE here.
       set(ICE_FOUND TRUE)
-    endif(PYTHON_ICE_FOUND)
-  endif(CMAKE_CROSSCOMPILING)
 
-  message(STATUS "  SLICE2CPP: ${ICE_SLICE2CPP}")
-  message(STATUS "  SLICE2PY: ${ICE_SLICE2PY}")
+    else(CMAKE_CROSSCOMPILING)
 
-  if(ICE_FOUND)
-    message(STATUS "Ice-3.5 found")
+      FIND_PROGRAM(ICE_SLICE2CPP slice2cpp
+        HINTS ${CMAKE_INSTALL_PREFIX}/bin ${ICE_MANUAL_INSTALL_PATH}/bin/)
+      FIND_PROGRAM(ICE_SLICE2PY slice2py
+        HINTS ${CMAKE_INSTALL_PREFIX}/bin ${ICE_MANUAL_INSTALL_PATH}/bin/)
 
-    set(ICE_LIBRARIES ${ICE_LIBRARY})
-    set(ICE_INCLUDE_DIRS ${ICE_INCLUDE_DIR})
+      # Check that the ICE Python package is installed
+      include(GrPython)
+      GR_PYTHON_CHECK_MODULE("Ice >= 3.5" Ice "Ice.stringVersion() >= '3.5.0'" 
PYTHON_ICE_FOUND)
+      if(PYTHON_ICE_FOUND)
+        set(ICE_FOUND TRUE)
+      endif(PYTHON_ICE_FOUND)
+    endif(CMAKE_CROSSCOMPILING)
 
-    include(FindPackageHandleStandardArgs)
-    find_package_handle_standard_args(ICE DEFAULT_MSG ICE_LIBRARY 
ICE_INCLUDE_DIR)
-    mark_as_advanced(ICE_INCLUDE_DIR ICE_LIBRARY)
-  endif(ICE_FOUND)
-endif(ICE_ICE AND ICE_ICEUTIL)
+    message(STATUS "  SLICE2CPP: ${ICE_SLICE2CPP}")
+    message(STATUS "  SLICE2PY: ${ICE_SLICE2PY}")
+
+    if(ICE_FOUND)
+      message(STATUS "Ice-3.5 found")
+
+      set(ICE_LIBRARIES ${ICE_LIBRARY})
+      set(ICE_INCLUDE_DIRS ${ICE_INCLUDE_DIR})
 
-endif(ICE_FOUND)
+      include(FindPackageHandleStandardArgs)
+      find_package_handle_standard_args(ICE DEFAULT_MSG ICE_LIBRARY 
ICE_INCLUDE_DIR)
+      mark_as_advanced(ICE_INCLUDE_DIR ICE_LIBRARY)
+    endif(ICE_FOUND)
+  endif(ICE_ICE AND ICE_ICEUTIL)
+
+endif(NOT ICE_FOUND)
diff --git a/cmake/Modules/FindICE.cmake b/cmake/Modules/FindICE.cmake
index 087ee9b..2a65cf6 100644
--- a/cmake/Modules/FindICE.cmake
+++ b/cmake/Modules/FindICE.cmake
@@ -1,136 +1,127 @@
 # Override the search path for ICE; useful for manually installed libs.
 #    set(ICE_MANUAL_INSTALL_PATH /opt/Ice-3.4.2/)
 
-FIND_PACKAGE(PkgConfig)
-PKG_CHECK_MODULES(PC_ICE Ice-3.4 QUIET)
+message(STATUS "Checking for Ice-3.4")
 
-if(NOT ICE_FOUND)
-  # Maybe we don't have a .pc file for Ice. Check for Config.h. If
-  # that exists, get the version string and parse it for the proper
-  # version.
-  FIND_PATH(
-    ICE_CONFIG_INCLUDE_DIR
-    NAMES IceUtil/Config.h
-    HINTS ${ICE_MANUAL_INSTALL_PATH}/include/ ${CMAKE_INSTALL_PREFIX}/include/
-    )
-  if(ICE_CONFIG_INCLUDE_DIR)
-    file(STRINGS "${ICE_CONFIG_INCLUDE_DIR}/IceUtil/Config.h"
-      ICE_STRING_VERSION REGEX "ICE_STRING_VERSION")
-    string(REGEX MATCH "3.4" ICE_FOUND ${ICE_STRING_VERSION})
-    if(ICE_FOUND)
-      set(ICE_FOUND TRUE)
-    endif(ICE_FOUND)
-  endif(ICE_CONFIG_INCLUDE_DIR)
-endif(NOT ICE_FOUND)
+FIND_PATH(
+  ICE_CONFIG_INCLUDE_DIR
+  NAMES IceUtil/Config.h
+  HINTS ${ICE_MANUAL_INSTALL_PATH}/include/ ${CMAKE_INSTALL_PREFIX}/include/
+)
+
+if(ICE_CONFIG_INCLUDE_DIR)
+  file(STRINGS "${ICE_CONFIG_INCLUDE_DIR}/IceUtil/Config.h"
+    ICE_STRING_VERSION REGEX "ICE_STRING_VERSION")
+  string(REGEX MATCH "3.4" ICE_FOUND ${ICE_STRING_VERSION})
+  if(ICE_FOUND)
+    set(ICE_FOUND TRUE)
+  endif(ICE_FOUND)
+endif(ICE_CONFIG_INCLUDE_DIR)
 
 if(NOT ICE_FOUND)
   message(STATUS "  package 'Ice-3.4' not found")
-endif(NOT ICE_FOUND)
 
+else(NOT ICE_FOUND)
+  message(STATUS "  ICE 3.4 Include directory found: 
${ICE_CONFIG_INCLUDE_DIR}")
 
-# Recheck if we found the right version of ICE and proceed if true.
-if(ICE_FOUND)
+  # Prepare the path hint for the libraries based on the include
+  # directory found.
+  string(REGEX REPLACE "/include" "" ICE_PATH ${ICE_CONFIG_INCLUDE_DIR})
 
-# Prepare the path hint for the libraries based on the include
-# directory found.
-string(REGEX REPLACE "/include" "" ICE_PATH ${ICE_CONFIG_INCLUDE_DIR})
+  FIND_PATH(
+    ICE_INCLUDE_DIR
+    NAMES IceUtil/IceUtil.h Ice/Ice.h
+    NO_DEFAULT_PATH
+    HINTS ${CMAKE_INSTALL_PREFIX}/include
+    HINTS ${ICE_PATH}/include
+    )
 
-FIND_PATH(
-  ICE_INCLUDE_DIR
-  NAMES IceUtil/IceUtil.h Ice/Ice.h
-  NO_DEFAULT_PATH
-  HINTS ${CMAKE_INSTALL_PREFIX}/include
-  HINTS ${ICE_PATH}/include
-)
+  set(ICE_LIBRARY )
 
-set(ICE_LIBRARY )
+  if(APPLE)
+    set(ICE_LIB_PREFIX "Zeroc")
+  else()
+    set(ICE_LIB_PREFIX "")
+  endif(APPLE)
 
-if(APPLE)
-  set(ICE_LIB_PREFIX "Zeroc")
-else()
-  set(ICE_LIB_PREFIX "")
-endif(APPLE)
+  FIND_LIBRARY(
+    ICE_ICE ${ICE_LIB_PREFIX}Ice
+    HINTS ${CMAKE_INSTALL_PREFIX}/lib ${CMAKE_INSTALL_PREFIX}/lib64
+    HINTS ${ICE_PATH}/lib ${ICE_PATH}/lib64
+    )
+  FIND_LIBRARY(
+    ICE_ICESTORM ${ICE_LIB_PREFIX}IceStorm
+    HINTS ${CMAKE_INSTALL_PREFIX}/lib ${CMAKE_INSTALL_PREFIX}/lib64
+    HINTS ${ICE_PATH}/lib ${ICE_PATH}/lib64
+    )
+  FIND_LIBRARY(
+    ICE_ICEGRID ${ICE_LIB_PREFIX}IceGrid
+    HINTS ${CMAKE_INSTALL_PREFIX}/lib ${CMAKE_INSTALL_PREFIX}/lib64
+    HINTS ${ICE_PATH}/lib ${ICE_PATH}/lib64
+    )
+  FIND_LIBRARY(
+    ICE_ICEUTIL ${ICE_LIB_PREFIX}IceUtil
+    HINTS ${CMAKE_INSTALL_PREFIX}/lib ${CMAKE_INSTALL_PREFIX}/lib64
+    HINTS ${ICE_PATH}/lib ${ICE_PATH}/lib64
+    )
+  FIND_LIBRARY(
+    ICE_GLACIER2 Glacier2
+    HINTS ${CMAKE_INSTALL_PREFIX}/lib ${CMAKE_INSTALL_PREFIX}/lib64
+    HINTS ${ICE_PATH}/lib ${ICE_PATH}/lib64
+    )
 
-FIND_LIBRARY(
-  ICE_ICE ${ICE_LIB_PREFIX}Ice
-  NO_DEFAULT_PATH
-  HINTS ${CMAKE_INSTALL_PREFIX}/lib ${CMAKE_INSTALL_PREFIX}/lib64
-  HINTS ${ICE_PATH}/lib ${ICE_PATH}/lib64
-)
-FIND_LIBRARY(
-  ICE_ICESTORM ${ICE_LIB_PREFIX}IceStorm
-  NO_DEFAULT_PATH
-  HINTS ${CMAKE_INSTALL_PREFIX}/lib ${CMAKE_INSTALL_PREFIX}/lib64
-  HINTS ${ICE_PATH}/lib ${ICE_PATH}/lib64
-)
-FIND_LIBRARY(
-  ICE_ICEGRID ${ICE_LIB_PREFIX}IceGrid
-  NO_DEFAULT_PATH
-  HINTS ${CMAKE_INSTALL_PREFIX}/lib ${CMAKE_INSTALL_PREFIX}/lib64
-  HINTS ${ICE_PATH}/lib ${ICE_PATH}/lib64
-)
-FIND_LIBRARY(
-  ICE_ICEUTIL ${ICE_LIB_PREFIX}IceUtil
-  NO_DEFAULT_PATH
-  HINTS ${CMAKE_INSTALL_PREFIX}/lib ${CMAKE_INSTALL_PREFIX}/lib64
-  HINTS ${ICE_PATH}/lib ${ICE_PATH}/lib64
-)
-FIND_LIBRARY(
-  ICE_GLACIER2 Glacier2
-  NO_DEFAULT_PATH
-  HINTS ${CMAKE_INSTALL_PREFIX}/lib ${CMAKE_INSTALL_PREFIX}/lib64
-  HINTS ${ICE_PATH}/lib ${ICE_PATH}/lib64
-)
+  FIND_LIBRARY(
+    ICE_PTHREAD NAMES pthread pthread-2.13
+    HINTS ${CMAKE_INSTALL_PREFIX}/lib64/ ${CMAKE_INSTALL_PREFIX}/lib/
+    HINTS ${PC_ICE_LIBDIR} ${PC_ICE_LIBRARY_DIRS} /lib/i386-linux-gnu 
/lib/x86_64-linux-gnu /usr/lib /lib /lib64
+    ENV LD_LIBRARY_PATH
+    )
 
-FIND_LIBRARY(
-  ICE_PTHREAD NAMES pthread pthread-2.13
-  HINTS ${CMAKE_INSTALL_PREFIX}/lib64/ ${CMAKE_INSTALL_PREFIX}/lib/
-  HINTS ${PC_ICE_LIBDIR} ${PC_ICE_LIBRARY_DIRS} /lib/i386-linux-gnu 
/lib/x86_64-linux-gnu /usr/lib /lib /lib64
-  ENV LD_LIBRARY_PATH
-)
+  set(ICE_FOUND FALSE)
 
-set(ICE_FOUND FALSE)
+  if(ICE_ICE AND ICE_ICEUTIL)
+    list(APPEND ICE_LIBRARY
+      ${ICE_ICE}
+      ${ICE_ICEUTIL}
+      )
 
-if(ICE_ICE AND ICE_ICEUTIL)
-  list(APPEND ICE_LIBRARY
-    ${ICE_ICE}
-    ${ICE_ICEUTIL}
-    )
+    message(STATUS "  libIce: ${ICE_ICE}")
+    message(STATUS "  libIceUtil: ${ICE_ICEUTIL}")
 
-  FIND_PROGRAM(ICE_SLICE2CPP slice2cpp
-    HINTS ${CMAKE_INSTALL_PREFIX}/bin ${ICE_MANUAL_INSTALL_PATH}/bin/)
-  FIND_PROGRAM(ICE_SLICE2PY slice2py
-    HINTS ${CMAKE_INSTALL_PREFIX}/bin ${ICE_MANUAL_INSTALL_PATH}/bin/)
+    FIND_PROGRAM(ICE_SLICE2CPP slice2cpp
+      HINTS ${CMAKE_INSTALL_PREFIX}/bin ${ICE_MANUAL_INSTALL_PATH}/bin/)
+    FIND_PROGRAM(ICE_SLICE2PY slice2py
+      HINTS ${CMAKE_INSTALL_PREFIX}/bin ${ICE_MANUAL_INSTALL_PATH}/bin/)
 
-  # Check that the ICE Python package is installed
-  include(GrPython)
-  GR_PYTHON_CHECK_MODULE("Ice >= 3.4" Ice "Ice.stringVersion() >= '3.4.0'" 
PYTHON_ICE_FOUND)
-  if(PYTHON_ICE_FOUND)
-    set(ICE_FOUND TRUE)
-  endif(PYTHON_ICE_FOUND)
+    # Check that the ICE Python package is installed
+    include(GrPython)
+    GR_PYTHON_CHECK_MODULE("Ice >= 3.4" Ice "Ice.stringVersion() >= '3.4.0'" 
PYTHON_ICE_FOUND)
+    if(PYTHON_ICE_FOUND)
+      set(ICE_FOUND TRUE)
+    endif(PYTHON_ICE_FOUND)
 
-  if(ICE_FOUND)
-    message(STATUS "Ice-3.4 found")
-
-    if(CMAKE_COMPILER_IS_GNUCXX)
-      execute_process(COMMAND ${CMAKE_CXX_COMPILER} --version
-        OUTPUT_VARIABLE gcc_version)
-      string(REGEX MATCH "[0-9].[0-9].[0-9]" gcc_version_num ${gcc_version})
-      if(NOT ${gcc_version_num} VERSION_LESS "4.7")
-        message(STATUS "-- Found GCC version: ${gcc_version_num}")
-        message(STATUS "-- GCC incompatible with Ice 3.4, disabling 
ControlPort")
-        set(ICE_FOUND FALSE)
-        return() # exit now
-      endif(NOT ${gcc_version_num} VERSION_LESS "4.7")
-    endif(CMAKE_COMPILER_IS_GNUCXX)
-
-    set(ICE_LIBRARIES ${ICE_LIBRARY})
-    set(ICE_INCLUDE_DIRS ${ICE_INCLUDE_DIR})
-
-    include(FindPackageHandleStandardArgs)
-    find_package_handle_standard_args(ICE DEFAULT_MSG ICE_LIBRARY 
ICE_INCLUDE_DIR)
-    mark_as_advanced(ICE_INCLUDE_DIR ICE_LIBRARY)
-  endif(ICE_FOUND)
-endif(ICE_ICE AND ICE_ICEUTIL)
+    if(ICE_FOUND)
+      message(STATUS "Ice-3.4 found")
+
+      if(CMAKE_COMPILER_IS_GNUCXX)
+        execute_process(COMMAND ${CMAKE_CXX_COMPILER} --version
+          OUTPUT_VARIABLE gcc_version)
+        string(REGEX MATCH "[0-9].[0-9].[0-9]" gcc_version_num ${gcc_version})
+        if(NOT ${gcc_version_num} VERSION_LESS "4.7")
+          message(STATUS "-- Found GCC version: ${gcc_version_num}")
+          message(STATUS "-- GCC incompatible with Ice 3.4, disabling 
ControlPort")
+          set(ICE_FOUND FALSE)
+          return() # exit now
+        endif(NOT ${gcc_version_num} VERSION_LESS "4.7")
+      endif(CMAKE_COMPILER_IS_GNUCXX)
+
+      set(ICE_LIBRARIES ${ICE_LIBRARY})
+      set(ICE_INCLUDE_DIRS ${ICE_INCLUDE_DIR})
+
+      include(FindPackageHandleStandardArgs)
+      find_package_handle_standard_args(ICE DEFAULT_MSG ICE_LIBRARY 
ICE_INCLUDE_DIR)
+      mark_as_advanced(ICE_INCLUDE_DIR ICE_LIBRARY)
+    endif(ICE_FOUND)
+  endif(ICE_ICE AND ICE_ICEUTIL)
 
-endif(ICE_FOUND)
+endif(NOT ICE_FOUND)



reply via email to

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