[asterisk-scf-commits] asterisk-scf/integration/slice-plugins.git branch "master" updated.
Commits to the Asterisk SCF project code repositories
asterisk-scf-commits at lists.digium.com
Tue Jan 18 06:55:20 CST 2011
branch "master" has been updated
via 339964f61298bd20c399f587fb0bb5fee470db7b (commit)
from 6cda871fc97e9cfe281a762fa5684c12e4b1744f (commit)
Summary of changes:
CMakeLists.txt | 118 +--------
cmake/FindIce.cmake | 299 ++++++++++++++++++++
cmake/FindPackageComponentHandleStandardArgs.cmake | 85 ++++++
src/CMakeLists.txt | 5 +-
4 files changed, 390 insertions(+), 117 deletions(-)
create mode 100644 cmake/FindIce.cmake
create mode 100644 cmake/FindPackageComponentHandleStandardArgs.cmake
- Log -----------------------------------------------------------------
commit 339964f61298bd20c399f587fb0bb5fee470db7b
Author: Kevin P. Fleming <kpfleming at digium.com>
Date: Tue Jan 18 06:55:08 2011 -0600
Use FindIce.cmake.
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2fb8905..2f1ad27 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,5 +1,7 @@
cmake_minimum_required(VERSION 2.6)
+list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
+
# If a build type has not been explicitly specified then use debug
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Debug CACHE STRING
@@ -19,113 +21,6 @@ macro(set_cache_var)
set(${ARGV} CACHE INTERNAL Bob FORCE)
endmacro()
-# Function which scans a path for matching files or directories,
-# whose names end with a standard version number string, and
-# returns the one with the 'highest' version found, or NOTFOUND
-# if there were no matches. Single-character globs (?) can
-# be used in the base string, but not multi-character globs (*).
-function(find_best_version output base)
- get_filename_component(base_full "${base}" ABSOLUTE)
- file(GLOB path_list "${base_full}*")
- string(LENGTH "${base_full}" base_length)
- foreach(path ${path_list})
- get_filename_component(path_full "${path}" ABSOLUTE)
- string(LENGTH "${path_full}" path_length)
- math(EXPR get "${path_length} - ${base_length}")
- string(SUBSTRING "${path_full}" ${base_length} ${get} ver)
- if(NOT DEFINED best_ver)
- set(best_ver ${ver})
- set(best_path "${path_full}")
- elseif(best_ver VERSION_LESS ver)
- set(best_ver ${ver})
- set(best_path "${path_full}")
- endif()
- endforeach()
- if(DEFINED best_ver)
- set(${output} "${best_path}" PARENT_SCOPE)
- else()
- set(${output} "NOTFOUND" PARENT_SCOPE)
- endif()
-endfunction()
-
-# Find Ice installation for a specific major/minor version
-function(find_ICE version)
- set(ice "$ENV{ICE_HOME}")
- if(NOT ice)
- if(WIN32)
- find_best_version(ice "C:/Ice-${version}")
- elseif(UNIX)
- find_best_version(ice "/opt/Ice-${version}")
- endif()
- endif()
-
- if(NOT ice)
- message(FATAL_ERROR "Could not find an installation of Ice with version ${version}")
- endif()
- find_path(ICE_SLICE_DIR Ice/Current.ice PATHS "${ice}/../slice" "${ice}/slice" NO_DEFAULT_PATH)
- if(ICE_SLICE_DIR)
- message(STATUS "Found Ice Slice definitions in ${ICE_SLICE_DIR}")
- else()
- message(FATAL_ERROR "Ice installation located at ${ice} is incomplete or broken (missing 'slice' directory)")
- endif()
- file(TO_CMAKE_PATH "${ice}" ice_cmake_path)
- set_cache_var(ICE_DIR "${ice_cmake_path}")
-endfunction()
-
-# Find Ice headers and libraries for CXX components
-function(find_ICE_CXX)
- find_path(ICE_CXX_INCLUDE_DIR Ice/Ice.h PATHS "${ICE_DIR}/include" NO_DEFAULT_PATH)
- if(ICE_CXX_INCLUDE_DIR)
- message(STATUS "Found Ice headers for CXX in ${ICE_CXX_INCLUDE_DIR}")
- else()
- message(FATAL_ERROR "Failed to find Ice headers for CXX")
- endif()
- # This block essentially tricks the GNU compiler into treating the Ice header files as system headers. This has
- # the benefit of having warnings emitted by the headers NOT treated as errors, even if the compiler has been told
- # to do so. This is currently being utilized by the C++0x support in this file so that Ice itself does not have to
- # be updated to be C++0x safe.
- if(CMAKE_COMPILER_IS_GNUCXX)
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -isystem ${ICE_CXX_INCLUDE_DIR}"
- CACHE STRING "Flags used by the compiler during release builds." FORCE)
- endif()
-endfunction()
-
-# Find an Ice library for CXX components
-function(find_ICE_CXX_library LIBRARY)
- if(NOT ICE_CXX_LIB_${LIBRARY})
- if(WIN32)
- string(TOLOWER ${LIBRARY} lib)
- find_library(ICE_CXX_LIB_RELEASE_${LIBRARY} ${lib} PATHS "${ICE_DIR}/lib" NO_DEFAULT_PATH)
- if(ICE_CXX_LIB_RELEASE_${LIBRARY})
- message(STATUS "Found Ice ${LIBRARY} library for CXX (release build) at ${ICE_CXX_LIB_RELEASE_${LIBRARY}}")
- list(APPEND ficxxl_libs optimized "${ICE_CXX_LIB_RELEASE_${LIBRARY}}")
- endif()
- find_library(ICE_CXX_LIB_DEBUG_${LIBRARY} ${lib}d PATHS "${ICE_DIR}/lib" NO_DEFAULT_PATH)
- if(ICE_CXX_LIB_DEBUG_${LIBRARY})
- message(STATUS "Found Ice ${LIBRARY} library for CXX (debug build) at ${ICE_CXX_LIB_DEBUG_${LIBRARY}}")
- list(APPEND ficxxl_libs debug "${ICE_CXX_LIB_DEBUG_${LIBRARY}}")
- endif()
- if(ficxxl_libs)
- set_cache_var(ICE_CXX_LIB_${LIBRARY} ${ficxxl_libs})
- else()
- message(FATAL_ERROR "Failed to find Ice ${LIBRARY} library for CXX")
- endif()
- elseif(UNIX)
- find_library(ICE_CXX_LIB_${LIBRARY} ${LIBRARY} PATHS "${ICE_DIR}/lib" "${ICE_DIR}/lib32" "${ICE_DIR}/lib64" NO_DEFAULT_PATH)
- if(ICE_CXX_LIB_${LIBRARY})
- message(STATUS "Found Ice ${LIBRARY} library for CXX at ${ICE_CXX_LIB_${LIBRARY}}")
- else()
- message(FATAL_ERROR "Failed to find Ice ${LIBRARY} library for CXX")
- endif()
- endif()
- endif()
-
- if(UNIX)
- get_filename_component(library_path ${ICE_CXX_LIB_${LIBRARY}} PATH)
- link_directories(${library_path})
- endif()
-endfunction()
-
project("Digium Slice Translator Plugins" CXX)
if(CMAKE_COMPILER_IS_GNUCXX)
@@ -146,14 +41,9 @@ if(WIN32)
set(CMAKE_DEBUG_POSTFIX "d")
endif()
-find_ICE(3.4)
-find_ICE_CXX()
-find_ICE_CXX_library(Ice)
-find_ICE_CXX_library(IceUtil)
-find_ICE_CXX_library(Slice)
+find_package(Ice 3.4 REQUIRED IceUtil Slice)
-message(STATUS "Include directories ${ICE_CXX_INCLUDE_DIR}")
-include_directories("${ICE_CXX_INCLUDE_DIR}")
+include_directories("${ICE_INCLUDE_DIR}")
set(CMAKE_INSTALL_PREFIX ${ICE_DIR})
diff --git a/cmake/FindIce.cmake b/cmake/FindIce.cmake
new file mode 100644
index 0000000..1b93fba
--- /dev/null
+++ b/cmake/FindIce.cmake
@@ -0,0 +1,299 @@
+#
+# FindIce.cmake - a CMake module for using ZeroC Ice
+#
+# 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, QUIET and EXACT. It *never* searches for Ice along the system
+# PATH or any other CMake-provided default paths; instead, it will only
+# search in predefined locations, which are:
+#
+# ENV{ICE_HOME} if the ICE_HOME environment variable is set,
+# only that location is checked
+# /opt/Ice-<version> on UNIX-type platforms, subdirectories
+# of /opt are checked
+# C:/Ice-<version> on Windows platforms, subdirectories of C: are
+# checked
+#
+# These are the standard locations for Ice installations performed by the
+# ZeroC Ice packages; if Ice is installed in a non-standard location, then
+# ICE_HOME should be set to indicate where it is located.
+#
+# Syntax:
+#
+# find_package(Ice <major>.<minor>[.<patch>] [...])
+#
+# On the first call to this module, a major and minor version number
+# *MUST* be provided; if they are provided on subsequent calls, they
+# are ignored. During the first call, the locations listed above are
+# checked to find the highest-numbered version of Ice installed that
+# is compatible with the requested major and minor versions, unless
+# EXACT is specified, in which case only the single version specified
+# will be found (if it is available). Note that not specifying a patch
+# version number means it defaults to '0' (zero), so specifying
+# "Ice 3.4 EXACT" would in fact look for Ice 3.4.0 and no other version.
+#
+# For any call to this module, one or more COMPONENTS can be specified,
+# (and REQUIRED can be used to indicate they are not optional); each
+# name specified is expected to be a library provided with Ice, and
+# suitable tests are performed to ensure that library is part of the
+# Ice installation that was found.
+#
+# 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.
+#
+# Variables set by this module:
+#
+# ICE_FOUND Will be set if a compatible version of Ice was found
+#
+# ICE_DIR The top-level directory of the Ice installation
+#
+# ICE_INCLUDE_DIR The directory containing C++ include files
+#
+# ICE_SLICE_DIR The directory containing Slice files for the
+# libraries provided with Ice
+#
+# ICE_CXX_FLAGS Any compiler flags that should be used when compiling
+# code that uses Ice
+#
+# ICE_VERSION The Ice version (complete)
+# ICE_VERSION_MAJOR The Ice major version
+# ICE_VERSION_MINOR The Ice minor version
+# ICE_VERSION_PATCH The Ice patch version
+#
+# For each component requested, sets (with <component> uppercased):
+#
+# ICE_<component>_FOUND Will be set if the component (library)
+# was found
+#
+# ICE_<component>_LIBRARY The path to the library, possibly
+# including both optimized and debug
+# if they are available
+#
+# ICE_<component>_LIBRARY_DEBUG The path to the library, as a debug
+# build if it is available, otherwise as
+# an optimized build
+#
+# ICE_<component>_LIBRARY_RELEASE The path to the library, as an optimized
+# build if it is available, otherwise as
+# a debug build
+#
+
+find_package(PackageHandleStandardArgs)
+find_package(PackageComponentHandleStandardArgs)
+
+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_library library)
+ string(TOUPPER "${library}" upper)
+
+ set(_ice_debug_suffix "${CMAKE_DEBUG_POSTFIX}")
+
+ find_library(ICE_${upper}_LIBRARY_RELEASE NAMES "${library}" NO_DEFAULT_PATH PATHS "${ICE_DIR}" PATH_SUFFIXES "lib" "lib32" "lib64")
+ find_library(ICE_${upper}_LIBRARY_DEBUG NAMES "${library}${_ice_debug_suffix}" NO_DEFAULT_PATH PATHS "${ICE_DIR}" PATH_SUFFIXES "lib" "lib32" "lib64")
+
+ mark_as_advanced(ICE_${upper}_LIBRARY_RELEASE ICE_${upper}_LIBRARY_DEBUG)
+
+ if(ICE_${upper}_LIBRARY_DEBUG OR ICE_${upper}_LIBRARY_RELEASE)
+ _ice_set_cache_string(ICE_${upper}_FOUND ON "The Ice ${library} library was found")
+ endif()
+
+ if(Ice_DEBUG)
+ message(STATUS
+ "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
+ "${library} library (release) found at ${ICE_${upper}_LIBRARY_RELEASE} "
+ "${library} library (debug) found at ${ICE_${upper}_LIBRARY_DEBUG} ")
+ endif()
+endfunction()
+
+# Lifted (and then modified) from FindBoost.cmake, which got it from FindQt4.cmake.
+function(_ice_adjust_lib_vars library)
+ string(TOUPPER "${library}" upper)
+ if(ICE_${upper}_LIBRARY_DEBUG AND ICE_${upper}_LIBRARY_RELEASE)
+ # if the generator supports configuration types then set
+ # optimized and debug libraries, or if the CMAKE_BUILD_TYPE has a value
+ if(CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE)
+ set(ICE_${upper}_LIBRARY optimized "${ICE_${upper}_LIBRARY_RELEASE}" debug "${ICE_${upper}_LIBRARY_DEBUG}")
+ else()
+ # if there are no configuration types and CMAKE_BUILD_TYPE has no value
+ # then just use the release libraries
+ set(ICE_${upper}_LIBRARY "${ICE_${upper}_LIBRARY_RELEASE}")
+ endif()
+ endif()
+
+ # if only the release version was found, set the debug variable also to the release version
+ if(ICE_${upper}_LIBRARY_RELEASE AND NOT ICE_${upper}_LIBRARY_DEBUG)
+ _ice_set_cache_filepath(ICE_${upper}_LIBRARY_DEBUG "${ICE_${upper}_LIBRARY_RELEASE}" "Path to a library.")
+ set(ICE_${upper}_LIBRARY "${ICE_${upper}_LIBRARY_RELEASE}")
+ endif()
+
+ # if only the debug version was found, set the release variable also to the debug version
+ if(ICE_${upper}_LIBRARY_DEBUG AND NOT ICE_${upper}_LIBRARY_RELEASE)
+ _ice_set_cache_filepath(ICE_${upper}_LIBRARY_RELEASE "${ICE_${upper}_LIBRARY_DEBUG}" "Path to a library.")
+ set(ICE_${upper}_LIBRARY "${ICE_${upper}_LIBRARY_DEBUG}")
+ endif()
+
+ if(ICE_${upper}_LIBRARY)
+ _ice_set_cache_string(ICE_${upper}_LIBRARY "${ICE_${upper}_LIBRARY}" "The Ice ${library} library")
+ endif()
+endfunction()
+
+if(NOT ICE_DIR)
+ if(NOT Ice_FIND_VERSION)
+ find_package_handle_standard_args(Ice "Major and minor version numbers (at least) must be supplied to find Ice." ICE_DIR)
+ endif()
+
+ if($ENV{ICE_HOME})
+ # if ICE_HOME is set, we will only look there; if the version present there
+ # does not satisfy the requested version, then the search will fail
+ list(APPEND _ice_candidate_dirs "$ENV{ICE_HOME}")
+ else()
+ if(Ice_FIND_VERSION_EXACT)
+ # we prefer to find an Ice directory without a patch version specified if possible, so put
+ # that in the list first
+ list(APPEND _ice_candidate_versions
+ "${Ice_FIND_VERSION_MAJOR}.${Ice_FIND_VERSION_MINOR}"
+ "${Ice_FIND_VERSION_MAJOR}.${Ice_FIND_VERSION_MINOR}.${Ice_FIND_VERSION_PATCH}")
+ else()
+ # we prefer to find an Ice directory without a patch version specified if possible, so put
+ # that in the list first
+ list(APPEND _ice_candidate_versions
+ "${Ice_FIND_VERSION_MAJOR}.${Ice_FIND_VERSION_MINOR}")
+
+ # next, search for any patch version greater-than or equal-to what was requested
+ foreach(patch RANGE 10 0 -1)
+ if(NOT "${Ice_FIND_VERSION_MAJOR}.${Ice_FIND_VERSION_MINOR}.${patch}" VERSION_LESS "${Ice_FIND_VERSION}")
+ list(APPEND _ice_candidate_versions
+ "${Ice_FIND_VERSION_MAJOR}.${Ice_FIND_VERSION_MINOR}.${patch}")
+ endif()
+ endforeach()
+
+ endif()
+
+ # now convert each candidate version into a directory path
+ foreach(version IN LISTS _ice_candidate_versions)
+ if(WIN32)
+ list(APPEND _ice_candidate_dirs "C:/Ice-${version}")
+ elseif(UNIX)
+ list(APPEND _ice_candidate_dirs "/opt/Ice-${version}")
+ endif()
+ endforeach()
+
+ endif()
+
+ if(Ice_DEBUG)
+ message(STATUS
+ "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
+ "will search for Ice in these directories: ${_ice_candidate_dirs}")
+ endif()
+
+ # since we may find a copy of Ice with a directory name that matches one of our candidates
+ # but does not provide an adequate version, we have to be prepared to search repeatedly
+ # until either an adequate version is found or all the candidates are exhausted
+ while(NOT ICE_DIR)
+ find_path(ICE_INCLUDE_DIR NAMES "IceUtil/Config.h" PATHS ${_ice_candidate_dirs} PATH_SUFFIXES "include" NO_DEFAULT_PATH)
+
+ # if nothing was found, then stop now
+ if(NOT ICE_INCLUDE_DIR)
+ break()
+ endif()
+
+ if(Ice_DEBUG)
+ message(STATUS
+ "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
+ "found Ice includes at: ${ICE_INCLUDE_DIR}")
+ endif()
+
+ get_filename_component(_ice_possible_dir "${ICE_INCLUDE_DIR}" PATH)
+
+ # now check the embedded version in the IceUtil/Config.h file to ensure it
+ # satisfies the version requested
+ file(READ "${ICE_INCLUDE_DIR}/IceUtil/Config.h" _ice_config_contents)
+ string(REGEX REPLACE ".*#define.*ICE_STRING_VERSION.*\"([0-9]+\\.[0-9]+\\.[0-9]+)\".*" "\\1" _ice_config_version "${_ice_config_contents}")
+
+ if(Ice_DEBUG)
+ message(STATUS
+ "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
+ "Ice version detected: ${_ice_config_version}")
+ endif()
+
+ if((NOT Ice_FIND_VERSION_EXACT) OR (${_ice_config_version} VERSION_EQUAL ${Ice_FIND_VERSION}))
+ _ice_set_cache_path(ICE_DIR "${_ice_possible_dir}" "Location of Ice")
+ _ice_set_cache_string(ICE_VERSION "${_ice_config_version}" "Version of Ice")
+ string(REGEX REPLACE "([0-9]+)\\.[0-9]+\\.[0-9]+" "\\1" _ice_version_major "${_ice_config_version}")
+ _ice_set_cache_string(ICE_VERSION_MAJOR "${_ice_version_major}" "Version of Ice (major)")
+ string(REGEX REPLACE "[0-9]+\\.([0-9]+)\\.[0-9]+" "\\1" _ice_version_minor "${_ice_config_version}")
+ _ice_set_cache_string(ICE_VERSION_MINOR "${_ice_version_minor}" "Version of Ice (minor)")
+ string(REGEX REPLACE "[0-9]+\\.[0-9]+\\.([0-9]+)" "\\1" _ice_version_patch "${_ice_config_version}")
+ _ice_set_cache_string(ICE_VERSION_PATCH "${_ice_version_patch}" "Version of Ice (patch)")
+ break()
+ endif()
+
+ if(Ice_DEBUG)
+ message(STATUS
+ "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
+ "Ice version ${_ice_config_version} does not match requested ${Ice_FIND_VERSION}")
+ endif()
+
+ # we are in EXACT find mode, and the version in the directory found
+ # does not satisfy the requested version... so remove this directory
+ # as a candidate and try again
+ list(REMOVE_ITEM _ice_candidate_dirs "${_ice_possible_dir}")
+ unset(ICE_INCLUDE_DIR CACHE)
+ endwhile()
+
+ if(ICE_DIR)
+ mark_as_advanced(FORCE ICE_INCLUDE_DIR)
+
+ find_path(ICE_SLICE_DIR "Ice/Current.ice" PATHS "${ICE_DIR}" PATH_SUFFIXES "slice" NO_DEFAULT_PATH)
+ if(NOT ICE_SLICE_DIR)
+ message(WARNING "Ice installation located at ${ICE_DIR} is incomplete or broken (missing 'slice' directory)")
+ else()
+ mark_as_advanced(FORCE ICE_SLICE_DIR)
+ endif()
+
+ # This block essentially tricks the GNU compiler into treating the Ice header files as system headers. This has
+ # the benefit of having warnings emitted by the headers NOT treated as errors, even if the compiler has been told
+ # to do so. This is being utilized so that Ice itself does not have to be updated to be C++0x safe.
+ if(CMAKE_COMPILER_IS_GNUCXX)
+ _ice_set_cache_string(ICE_CXX_FLAGS "-isystem ${ICE_INCLUDE_DIR}" "Ice-specific compiler flags")
+ endif()
+
+ endif()
+
+ find_package_handle_standard_args(Ice DEFAULT_MSG ICE_DIR ICE_SLICE_DIR ICE_INCLUDE_DIR)
+endif()
+
+if(ICE_DIR)
+ foreach(component IN LISTS Ice_FIND_COMPONENTS)
+ string(TOUPPER "${component}" upper)
+ if(NOT ICE_${upper}_FOUND)
+ _ice_find_library("${component}")
+ if(ICE_${upper}_FOUND)
+ _ice_adjust_lib_vars("${component}")
+ endif()
+ find_package_component_handle_standard_args(Ice "${component}" DEFAULT_MSG ICE_${upper}_LIBRARY)
+ endif()
+ endforeach()
+endif()
diff --git a/cmake/FindPackageComponentHandleStandardArgs.cmake b/cmake/FindPackageComponentHandleStandardArgs.cmake
new file mode 100644
index 0000000..bd95606
--- /dev/null
+++ b/cmake/FindPackageComponentHandleStandardArgs.cmake
@@ -0,0 +1,85 @@
+#=============================================================================
+# Copyright 2007-2009 Kitware, Inc.
+# Copyright 2011, Digium, Inc.
+#
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright notice,
+# this list of conditions and the following disclaimer.
+#
+# * Redistributions in binary form must reproduce the above copyright notice,
+# this list of conditions and the following disclaimer in the documentation
+# and/or other materials provided with the distribution.
+#
+# * The names of Kitware, Inc., the Insight Consortium, or the names of
+# any consortium members, or of any contributors, may not be used to
+# endorse or promote products derived from this software without
+# specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS ``AS IS''
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR
+# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#=============================================================================
+#
+# FIND_PACKAGE_COMPONENT_HANDLE_STANDARD_ARGS(NAME COMPONENT (DEFAULT_MSG|"Custom failure message") VAR1 ... )
+# This macro is intended to be used in FindXXX.cmake modules files.
+# It handles the REQUIRED and QUIET argument to FIND_PACKAGE().
+# The package is found if all variables listed are TRUE.
+
+INCLUDE(FindPackageMessage)
+FUNCTION(FIND_PACKAGE_COMPONENT_HANDLE_STANDARD_ARGS _NAME _COMP _FAIL_MSG _VAR1 )
+
+ IF("${_FAIL_MSG}" STREQUAL "DEFAULT_MSG")
+ SET(_FAIL_MESSAGE "Could NOT find ${_NAME} component ${_COMP}")
+ ELSE("${_FAIL_MSG}" STREQUAL "DEFAULT_MSG")
+ SET(_FAIL_MESSAGE "${_FAIL_MSG}")
+ ENDIF("${_FAIL_MSG}" STREQUAL "DEFAULT_MSG")
+
+ STRING(TOUPPER ${_COMP} _COMP_UPPER)
+
+ # collect all variables which were not found, so they can be printed, so the
+ # user knows better what went wrong (#6375)
+ SET(MISSING_VARS "")
+ SET(DETAILS "")
+ SET(${_COMP_UPPER}_FOUND TRUE)
+ IF(NOT ${_VAR1})
+ SET(${_COMP_UPPER}_FOUND FALSE)
+ SET(MISSING_VARS " ${_VAR1}")
+ ELSE(NOT ${_VAR1})
+ SET(DETAILS "${DETAILS}[${${_VAR1}}]")
+ ENDIF(NOT ${_VAR1})
+
+ # check if all passed variables are valid
+ FOREACH(_CURRENT_VAR ${ARGN})
+ IF(NOT ${_CURRENT_VAR})
+ SET(${_COMP_UPPER}_FOUND FALSE)
+ SET(MISSING_VARS "${MISSING_VARS} ${_CURRENT_VAR}")
+ ELSE(NOT ${_CURRENT_VAR})
+ SET(DETAILS "${DETAILS}[${${_CURRENT_VAR}}]")
+ ENDIF(NOT ${_CURRENT_VAR})
+ ENDFOREACH(_CURRENT_VAR)
+
+ IF (${_COMP_UPPER}_FOUND)
+ FIND_PACKAGE_MESSAGE(${_NAME} "Found ${_NAME} component ${_COMP}: ${${_VAR1}}" "${DETAILS}")
+ ELSE (${_COMP_UPPER}_FOUND)
+ IF (${_NAME}_FIND_REQUIRED)
+ MESSAGE(FATAL_ERROR "${_FAIL_MESSAGE} (missing: ${MISSING_VARS})")
+ ELSE (${_NAME}_FIND_REQUIRED)
+ IF (NOT ${_NAME}_FIND_QUIETLY)
+ MESSAGE(STATUS "${_FAIL_MESSAGE} (missing: ${MISSING_VARS})")
+ ENDIF (NOT ${_NAME}_FIND_QUIETLY)
+ ENDIF (${_NAME}_FIND_REQUIRED)
+ ENDIF (${_COMP_UPPER}_FOUND)
+
+ENDFUNCTION(FIND_PACKAGE_COMPONENT_HANDLE_STANDARD_ARGS)
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index c446890..b1245a1 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -1,4 +1,3 @@
-add_library(SliceVisitorPattern SHARED SliceVisitorPattern.cpp)
-target_link_libraries(SliceVisitorPattern ${ICE_CXX_LIB_Ice} ${ICE_CXX_LIB_IceUtil} ${ICE_CXX_LIB_Slice})
-
+add_library(SliceVisitorPattern MODULE SliceVisitorPattern.cpp)
+target_link_libraries(SliceVisitorPattern ${ICE_ICEUTIL_LIBRARY} ${ICE_SLICE_LIBRARY})
install(TARGETS SliceVisitorPattern LIBRARY DESTINATION lib RUNTIME DESTINATION bin)
-----------------------------------------------------------------------
--
asterisk-scf/integration/slice-plugins.git
More information about the asterisk-scf-commits
mailing list