[asterisk-scf-commits] asterisk-scf/release/cmake.git branch "master" updated.

Commits to the Asterisk SCF project code repositories asterisk-scf-commits at lists.digium.com
Tue Mar 22 14:58:15 CDT 2011


branch "master" has been updated
       via  d5f4736580b310e3cd5a0b399498be8b8dcd3ace (commit)
       via  63294faf382dbb3be3cdd68e6debfedeacf9b760 (commit)
      from  4af2764093ea2a710426efdcd96b0b752e7bf1f7 (commit)

Summary of changes:
 AsteriskSCF.cmake        |   11 +++--
 modules/FindIceBox.cmake |   96 ++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 103 insertions(+), 4 deletions(-)
 create mode 100644 modules/FindIceBox.cmake


- Log -----------------------------------------------------------------
commit d5f4736580b310e3cd5a0b399498be8b8dcd3ace
Merge: 4af2764 63294fa
Author: Kevin P. Fleming <kpfleming at digium.com>
Date:   Tue Mar 22 14:58:01 2011 -0500

    Merge branch 'icebox-package'


commit 63294faf382dbb3be3cdd68e6debfedeacf9b760
Author: Kevin P. Fleming <kpfleming at digium.com>
Date:   Tue Mar 22 14:01:07 2011 -0500

    Add a package for locating IceBox, and ensure it gets found when needed
    by tests for components.

diff --git a/AsteriskSCF.cmake b/AsteriskSCF.cmake
index 576b6bd..34be413 100644
--- a/AsteriskSCF.cmake
+++ b/AsteriskSCF.cmake
@@ -186,6 +186,7 @@ function(asterisk_scf_project NAME ICE_VERSION)
     endif()
 
     message(STATUS "Performing requirement checks for components")
+    # set(Ice_DEBUG on)
     find_package(Ice 3.4 REQUIRED Ice IceUtil)
 
     # All components need the Ice library, and it needs the
@@ -694,11 +695,13 @@ endfunction()
 # with 'make test' @param EXE - boost test executable.  Probably built
 # using asterisk_scf_component_build_standalone.
 function(boost_add_test EXE)
-    add_test(NAME ${EXE} COMMAND ${EXE}
-        --report_sink=${CMAKE_BINARY_DIR}/${EXE}-result.xml
-        --report_format=XML --report_level=detailed)
+    add_test(NAME "${EXE}" COMMAND "${EXE}"
+        "--report_sink=${CMAKE_BINARY_DIR}/${EXE}-result.xml"
+        "--report_format=XML"
+	"--report_level=detailed")
 endfunction()
 
 function(icebox_add_test NAME CONFIG)
-    add_test(NAME ${NAME} COMMAND ${ICEBOX} --Ice.Config=${CONFIG})
+    find_package(IceBox REQUIRED)
+    add_test(NAME "${NAME}" COMMAND "${ICEBOX_EXECUTABLE}" "--Ice.Config=${CONFIG}")
 endfunction()
diff --git a/modules/FindIceBox.cmake b/modules/FindIceBox.cmake
new file mode 100644
index 0000000..c014258
--- /dev/null
+++ b/modules/FindIceBox.cmake
@@ -0,0 +1,96 @@
+#
+# FindIceBox.cmake - a CMake module for using ZeroC IceBox
+#
+# Copyright (C) 2010-2011, Digium, Inc.
+#
+# This program is free software, distributed under the terms of
+# the GNU General Public License Version 2.
+#
+# Usage:
+#
+# This module supports the standard find_package() syntax, including
+# REQUIRED and QUIET. It requires that Ice has been previously found
+# and will fail otherwise. It uses the ICE_DIR set by FindIce.cmake
+# to locate IceBox.
+#
+# Syntax:
+#
+# find_package(IceBox [...])
+#
+# Variables used by this module:
+#
+# Ice_DEBUG		If this is set to any value, the module will emit
+#			debugging messages as each step of its operations
+#			are performed.
+#
+# CMAKE_DEBUG_POSTFIX	If this is set to any value, it will be used as a
+#                       a suffix when searching for a 'debug' version
+#                       of IceBox.
+#
+# Variables set by this module:
+#
+# ICEBOX_FOUND		Will be set if a compatible version of Ice was found
+#
+# ICEBOX_EXECUTABLE	The path to the located IceBox program
+
+find_package(PackageHandleStandardArgs)
+find_package(Ice REQUIRED)
+
+function(_ice_set_cache_path var value reason)
+  set("${var}" "${value}" CACHE PATH "${reason}" FORCE)
+  mark_as_advanced(FORCE "${var}")
+endfunction()
+
+function(_ice_set_cache_filepath var value reason)
+  set("${var}" "${value}" CACHE FILEPATH "${reason}" FORCE)
+  mark_as_advanced(FORCE "${var}")
+endfunction()
+
+function(_ice_set_cache_string var value reason)
+  set("${var}" "${value}" CACHE STRING "${reason}" FORCE)
+  mark_as_advanced(FORCE "${var}")
+endfunction()
+
+function(_ice_find_program program)
+  string(TOUPPER "${program}" upper)
+
+  set(_ice_debug_suffix "${CMAKE_DEBUG_POSTFIX}")
+
+  if(WIN32)
+    set(_ice_progdir "bin")
+    if(CMAKE_CL_64)
+      set(_ice_progdir "${_ice_progdir}/x64")
+    endif()
+    # first search the more specified progdir, as used by the .msi installer
+    # if it's not there, try just lib.  that's where make install puts it
+    list(APPEND _ice_progdirs "${_ice_progdir}" "bin")
+  elseif(UNIX)
+    list(APPEND _ice_progdirs "bin")
+  endif()
+
+  find_program(ICE_${upper}_PROGRAM_RELEASE NAMES "${program}" NO_DEFAULT_PATH HINTS "${ICE_DIR}" PATH_SUFFIXES ${_ice_progdirs})
+  find_program(ICE_${upper}_PROGRAM_DEBUG NAMES "${program}${_ice_debug_suffix}" NO_DEFAULT_PATH HINTS "${ICE_DIR}" PATH_SUFFIXES ${_ice_progdirs})
+  
+  mark_as_advanced(ICE_${upper}_PROGRAM_RELEASE ICE_${upper}_PROGRAM_DEBUG)
+
+  if(ICE_${upper}_PROGRAM_DEBUG OR ICE_${upper}_PROGRAM_RELEASE)
+    _ice_set_cache_string(ICE_${upper}_FOUND ON "The Ice ${program} program was found")
+  endif()
+
+  if(Ice_DEBUG)
+    message(STATUS
+      "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
+      "${program} program (release) found at ${ICE_${upper}_PROGRAM_RELEASE} "
+      "${program} program (debug) found at ${ICE_${upper}_PROGRAM_DEBUG} ")
+  endif()
+endfunction()
+
+_ice_find_program(icebox)
+
+if(CMAKE_BUILD_TYPE STREQUAL debug)
+  _ice_set_cache_filepath(ICEBOX_EXECUTABLE "${ICE_ICEBOX_PROGRAM_DEBUG}" "Path to a program.")
+else()
+  _ice_set_cache_filepath(ICEBOX_EXECUTABLE "${ICE_ICEBOX_PROGRAM_RELEASE}" "Path to a program.")
+endif()
+
+find_package_handle_standard_args(IceBox DEFAULT_MSG ICEBOX_EXECUTABLE)

-----------------------------------------------------------------------


-- 
asterisk-scf/release/cmake.git



More information about the asterisk-scf-commits mailing list