[asterisk-scf-commits] asterisk-scf/integration/cmake.git branch "disable-ice-warnings" created.

Commits to the Asterisk SCF project code repositories asterisk-scf-commits at lists.digium.com
Tue Oct 25 08:50:54 CDT 2011


branch "disable-ice-warnings" has been created
        at  e86ed7d6c0ebfd2cd120798edd0fc19229649242 (commit)

- Log -----------------------------------------------------------------
commit e86ed7d6c0ebfd2cd120798edd0fc19229649242
Author: David M. Lee <dlee at digium.com>
Date:   Mon Oct 24 12:54:39 2011 -0500

    Disable warnings for generated code

diff --git a/AsteriskSCF.cmake b/AsteriskSCF.cmake
index 72947fb..f0e16eb 100644
--- a/AsteriskSCF.cmake
+++ b/AsteriskSCF.cmake
@@ -913,6 +913,8 @@ function(__astscf_component_add_one_slice COMPONENT COLLECTION COLLECTION_DIR SL
   # the Slice and generated_files are now sources for the component
   set(file_list ${${COMPONENT}_SOURCES} ${COLLECTION_DIR}/${SLICE} ${generated_files})
   set(${COMPONENT}_SOURCES ${file_list} PARENT_SCOPE)
+  # disable warnings for generated files.  rarely are these real bugs.
+  set_source_files_properties(${file_list} PROPERTIES COMPILE_FLAGS "-w")
 endfunction()
 
 # Function which collects Slice files used by a component, causing them

commit c11027fbdbb233f89a8a285939b05ce6c74fa8ab
Author: Brent Eagles <beagles at digium.com>
Date:   Wed Aug 10 19:58:37 2011 -0230

    Upping the test timer to allow for longer running tests and adding a function
    to disable warnings-as-errors on a project by project basis.

diff --git a/AsteriskSCF.cmake b/AsteriskSCF.cmake
index 799747e..72947fb 100644
--- a/AsteriskSCF.cmake
+++ b/AsteriskSCF.cmake
@@ -55,7 +55,7 @@
 #
 
 set(MIN_BOOST_VERSION 1.40)
-set(TEST_TIMEOUT_SEC 60)
+set(TEST_TIMEOUT_SEC 90)
 
 # CMake mistakenly thinks that GCC on OS X doesn't support -isystem.
 # See http://public.kitware.com/Bug/view.php?id=10837
@@ -271,6 +271,14 @@ macro(__astscf_compute_test_paths)
   endif()
 endmacro()
 
+function(astscf_allowwarnings)
+  if(CMAKE_COMPILER_IS_GNUCXX)
+    unset(_lv)
+    string(REPLACE "-Werror" "" _lv "${CMAKE_CXX_FLAGS_DEBUG}")
+    set(CMAKE_CXX_FLAGS_DEBUG "${_lv}" PARENT_SCOPE)
+  endif()
+endfunction()
+
 # Function which initializes project specific things
 function(astscf_project NAME ICE_VERSION)
   message(STATUS "Setting up project ${NAME} for Ice version ${ICE_VERSION}")

commit 2e3d895cfe70b95237d9d8461516b4a0f682702b
Author: Kevin P. Fleming <kpfleming at digium.com>
Date:   Tue Jul 19 14:00:47 2011 -0500

    Change to expect CMAKE_BUILD_TYPE to be uppercase.
    
    CMake doesn't allow string comparisons to be done case-insensitively; the
    main AsteriskSCF script was changed to set CMAKE_BUILD_TYPE to be uppercase
    instead of lowercase, and as a result the comparison here needs to also be
    uppercase.

diff --git a/modules/FindIceBox.cmake b/modules/FindIceBox.cmake
index 6c493e0..dc27d4f 100644
--- a/modules/FindIceBox.cmake
+++ b/modules/FindIceBox.cmake
@@ -88,7 +88,7 @@ endfunction()
 if(NOT ICEBOX_FOUND)
   _ice_find_program(icebox)
 
-  if(CMAKE_BUILD_TYPE STREQUAL debug)
+  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.")

commit ebde1b0550c4ce1ab1b61a3bc555278749e151ab
Author: Kevin P. Fleming <kpfleming at digium.com>
Date:   Tue Jul 19 13:38:48 2011 -0500

    Ensure that the project's compiler flags are used when building pjproject.
    
    With these changes, any compiler flags set by the CMake project that brings
    in pjproject.cmake will be provided to the pjproject 'configure' script, and
    will be applied to the builds made by its build system. This will allow
    debuggers to see into the pjproject code, if the containing project is being
    built in 'debug' mode.

diff --git a/modules/pjproject-configure.cmake.in b/modules/pjproject-configure.cmake.in
new file mode 100644
index 0000000..f4f17de
--- /dev/null
+++ b/modules/pjproject-configure.cmake.in
@@ -0,0 +1,2 @@
+set(ENV{CFLAGS} "${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_${CMAKE_BUILD_TYPE}} ${ADDITIONAL_CFLAGS}")
+execute_process(COMMAND "./configure" "--disable-sound")
diff --git a/modules/pjproject.cmake b/modules/pjproject.cmake
index d632a5a..8dd11c4 100644
--- a/modules/pjproject.cmake
+++ b/modules/pjproject.cmake
@@ -25,21 +25,44 @@ endif()
 
 # This is a simple check to see if we are doing a 64-bit build, if so we need to get pjproject to use -fPIC so the icebox services can get built
 if (CMAKE_SIZEOF_VOID_P MATCHES 8)
-  set(ADDITIONAL_CONFIGURE_ARGUMENTS "CFLAGS=-fPIC")
+  set(ADDITIONAL_CFLAGS "-fPIC")
 endif()
 
-add_custom_command(OUTPUT "${CMAKE_SOURCE_DIR}/pjproject/build.mak" COMMAND "./configure" "--disable-sound" ${ADDITIONAL_CONFIGURE_ARGUMENTS} WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/pjproject" COMMENT "Configuring pjproject")
-add_custom_command(OUTPUT "${CMAKE_SOURCE_DIR}/pjproject/pjlib/build/.pjlib-asteriskscf.depend" COMMAND "make" "dep" "TARGET_NAME=asteriskscf" WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/pjproject" COMMENT "Dependency generating pjproject" DEPENDS "${CMAKE_SOURCE_DIR}/pjproject/build.mak")
-add_custom_target(pjproject-clean COMMAND "make" "clean" "TARGET_NAME=asteriskscf" WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/pjproject" COMMENT "Cleaning pjproject")
-add_custom_target(pjproject-distclean COMMAND "make" "distclean" "TARGET_NAME=asteriskscf" WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/pjproject" COMMENT "Deep cleaning pjproject")
+configure_file("${CMAKE_SOURCE_DIR}/cmake/modules/pjproject-configure.cmake.in" pjproject-configure.cmake)
+
+add_custom_command(OUTPUT "${CMAKE_SOURCE_DIR}/pjproject/build.mak"
+                   COMMAND ${CMAKE_COMMAND} -P ${CMAKE_BINARY_DIR}/pjproject-configure.cmake
+		   WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/pjproject"
+		   COMMENT "Configuring pjproject")
+add_custom_command(OUTPUT "${CMAKE_SOURCE_DIR}/pjproject/pjlib/build/.pjlib-asteriskscf.depend"
+                   COMMAND "make" "dep" "TARGET_NAME=asteriskscf"
+		   WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/pjproject"
+		   COMMENT "Dependency generating pjproject"
+		   DEPENDS "${CMAKE_SOURCE_DIR}/pjproject/build.mak")
+add_custom_target(pjproject-clean
+                  COMMAND "make" "clean" "TARGET_NAME=asteriskscf"
+		  WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/pjproject"
+		  COMMENT "Cleaning pjproject")
+add_custom_target(pjproject-distclean
+                  COMMAND "make" "distclean" "TARGET_NAME=asteriskscf"
+		  WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/pjproject"
+		  COMMENT "Deep cleaning pjproject")
 
 # Function which adds build targets for the following supported pjproject components: pjlib, pjlib-util, pjnath, pjmedia, pjsip.
 function(pjproject_build PJPROJECT_COMPONENT)
   if(UNIX)
     if(${PJPROJECT_COMPONENT} STREQUAL "third_party")
-      add_custom_target("pjproject-third_party" COMMAND "make" "TARGET_NAME=asteriskscf" WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/pjproject/third_party/build" COMMENT "Building pjproject third party components" DEPENDS "${CMAKE_SOURCE_DIR}/pjproject/pjlib/build/.pjlib-asteriskscf.depend")
+      add_custom_target("pjproject-third_party"
+                        COMMAND "make" "TARGET_NAME=asteriskscf"
+			WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/pjproject/third_party/build"
+			COMMENT "Building pjproject third party components"
+			DEPENDS "${CMAKE_SOURCE_DIR}/pjproject/pjlib/build/.pjlib-asteriskscf.depend")
     else()
-      add_custom_target("pjproject-${PJPROJECT_COMPONENT}" COMMAND "make" "TARGET_NAME=asteriskscf" "DIRS=${PJPROJECT_COMPONENT}/build" WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/pjproject" COMMENT "Building pjproject-${PJPROJECT_COMPONENT}" DEPENDS "${CMAKE_SOURCE_DIR}/pjproject/pjlib/build/.pjlib-asteriskscf.depend")
+      add_custom_target("pjproject-${PJPROJECT_COMPONENT}"
+                        COMMAND "make" "TARGET_NAME=asteriskscf" "DIRS=${PJPROJECT_COMPONENT}/build"
+			WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/pjproject"
+			COMMENT "Building pjproject-${PJPROJECT_COMPONENT}"
+			DEPENDS "${CMAKE_SOURCE_DIR}/pjproject/pjlib/build/.pjlib-asteriskscf.depend")
       add_dependencies("pjproject-${PJPROJECT_COMPONENT}" "pjproject-pjlib")
     endif()
     if(${PJPROJECT_COMPONENT} STREQUAL "pjsip")

commit cff344199fa958787c5a949ba1c294a459ecba85
Author: Kevin P. Fleming <kpfleming at digium.com>
Date:   Tue Jul 19 13:37:39 2011 -0500

    Use proper variable for identifying GNU C compiler.
    
    The CMake variable that identifies the C compiler in use as 'GNU C' was not
    referenced properly; as a result, the script's attempts to set compiler flags
    for compiling C code did not take effect.

diff --git a/AsteriskSCF.cmake b/AsteriskSCF.cmake
index 51bc21c..799747e 100644
--- a/AsteriskSCF.cmake
+++ b/AsteriskSCF.cmake
@@ -359,7 +359,7 @@ function(astscf_project NAME ICE_VERSION)
     endif()
   endif()
 
-  if(CMAKE_COMPILER_IS_GNUC)
+  if(CMAKE_COMPILER_IS_GNUCC)
     list(APPEND c_flags_debug "-Wall" "-g3")
     list(APPEND c_flags_profile "-ftest-coverage" "-fprofile-arcs")
   endif()

commit fa9c9336f1c6065b512a1e5da3a39f332d0c699f
Author: Kevin P. Fleming <kpfleming at digium.com>
Date:   Tue Jul 19 13:36:24 2011 -0500

    Convert __astscf_append_to_var back to a macro.
    
    This really does need to be a macro, not a function, so that the variable it
    sets will be set in the *caller's* PARENT_SCOPE. In the current code, all of
    the logic to set compiler flags is effectively ignored, because those variables
    aren't set in the proper scope.

diff --git a/AsteriskSCF.cmake b/AsteriskSCF.cmake
index 0e13f2c..51bc21c 100644
--- a/AsteriskSCF.cmake
+++ b/AsteriskSCF.cmake
@@ -103,12 +103,13 @@ function(__astscf_set_cache_string var value reason)
   endforeach()
 endfunction()
 
-function(__astscf_append_to_var VAR)
+macro(__astscf_append_to_var VAR)
+  unset(_atv)
   foreach(item ${ARGN})
-    set(_altv "${_altv} ${item}")
+    set(_atv "${_atv} ${item}")
   endforeach()
-  set(${VAR} "${${VAR}} ${_altv}" PARENT_SCOPE)
-endfunction()
+  set(${VAR} "${${VAR}} ${_atv}" PARENT_SCOPE)
+endmacro()
 
 # installation directories (these are all relative to ${CMAKE_INSTALL_PREFIX})
 __astscf_set_cache_path(INSTALL_SYS_CONF_DIR etc "read-only data files that pertain to a single machine")
@@ -135,11 +136,11 @@ if(NOT CMAKE_BUILD_TYPE)
     FORCE)
 endif()
 
-# since Debug, debug and DeBuG all mean the same thing to cmake, tolower it
+# since Debug, debug and DeBuG all mean the same thing to cmake, toupper it
 # for consistency
-string(TOLOWER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE)
+string(TOUPPER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE)
 
-if(WIN32 AND ${CMAKE_BUILD_TYPE} STREQUAL profile)
+if(WIN32 AND ${CMAKE_BUILD_TYPE} STREQUAL PROFILE)
   message(FATAL_ERROR "Profile builds not supported")
 endif()
 
@@ -169,7 +170,7 @@ if(UNIX)
   set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS true)
 endif()
 
-if(${CMAKE_BUILD_TYPE} STREQUAL profile)
+if(${CMAKE_BUILD_TYPE} STREQUAL PROFILE)
   message(STATUS "Disabling shared libs.")
   set(BUILD_SHARED_LIBS false
     CACHE BOOL "Enables building shared libraries." FORCE)

commit cb52eb3c02ed74e61b05906858cdb5beb430565b
Author: Kevin P. Fleming <kpfleming at digium.com>
Date:   Thu Jun 30 15:24:50 2011 -0500

    Explicitly link components to libpthread on UNIX-type platforms.
    
    Fedora 14 and later require libraries and executables to be explicitly
    linked to all libraries they use; since most of our components use pthread
    facilities directly, they will now be linked to that library.
    
    (closes issue ASTSCF-207)

diff --git a/AsteriskSCF.cmake b/AsteriskSCF.cmake
index 64a5ccb..0e13f2c 100644
--- a/AsteriskSCF.cmake
+++ b/AsteriskSCF.cmake
@@ -921,6 +921,14 @@ endfunction()
 
 # Function which collects libraries needed by a component
 function(__astscf_component_libraries COMPONENT)
+  # On UNIX-type platforms, pretty much every component that gets built
+  # will end up using the pthread library; on Fedora 14 and later, this
+  # requirement is *not* satisfied by linking to other libraries that
+  # also link to libpthread; instead, the component must be explicitly
+  # linked to libpthread
+  if(UNIX)
+    list(APPEND target_libs "pthread")
+  endif()
   list(APPEND icelibs ${ASTSCF_ICE_LIBRARIES} ${${COMPONENT}_ICE_LIBRARIES})
   list(REMOVE_DUPLICATES icelibs)
   foreach(lib ${icelibs})

commit 7e84100cd48503054ec6a1654c8d089107add0ae
Author: Kevin P. Fleming <kpfleming at digium.com>
Date:   Fri Jun 24 16:02:04 2011 -0500

    Use consistent name for the 'flag' variable for components.
    
    astscf_component_init() sets a variable to indicate that a component has
    been initialized; in astscf_slice_collection_install(), this is checked to
    see if the library part of the collection is known component. Unfortunately
    the two functions did not use the same way of constructing the flag variable's
    name, and one of them was better... so now it is consistent throughout the
    script.

diff --git a/AsteriskSCF.cmake b/AsteriskSCF.cmake
index 0811c79..64a5ccb 100644
--- a/AsteriskSCF.cmake
+++ b/AsteriskSCF.cmake
@@ -431,7 +431,7 @@ endfunction()
 # Function which initializes a component for building
 function(astscf_component_init COMPONENT)
   message(STATUS "Setting up to build component ${COMPONENT}")
-  __astscf_set_cache_string(ASTSCF_${COMPONENT} Bob "" ADVANCED)
+  __astscf_set_cache_string(ASTSCF_COMPONENT_${COMPONENT} Bob "" ADVANCED)
 endfunction()
 
 # Function which adds Boost libraries needed by a component
@@ -439,7 +439,7 @@ function(astscf_component_add_boost_libraries COMPONENT)
   if(NOT ARGN)
     message(FATAL_ERROR "You must pass at least one library to this function")
   endif()
-  if(NOT ASTSCF_${COMPONENT})
+  if(NOT ASTSCF_COMPONENT_${COMPONENT})
     message(FATAL_ERROR "Component ${COMPONENT} has not been initialized.")
   endif()
   set(libs ${${COMPONENT}_BOOST_LIBRARIES})
@@ -462,7 +462,7 @@ function(astscf_component_add_files COMPONENT)
   if(NOT ARGN)
     message(FATAL_ERROR "You must pass at least one source file to this function")
   endif()
-  if(NOT ASTSCF_${COMPONENT})
+  if(NOT ASTSCF_COMPONENT_${COMPONENT})
     message(FATAL_ERROR "Component ${COMPONENT} has not been initialized.")
   endif()
   message(STATUS "Adding ${ARGN} to component ${COMPONENT}")
@@ -477,7 +477,7 @@ function(astscf_component_add_ice_libraries COMPONENT)
   if(NOT ARGN)
     message(FATAL_ERROR "You must pass at least one library to this function")
   endif()
-  if(NOT ASTSCF_${COMPONENT})
+  if(NOT ASTSCF_COMPONENT_${COMPONENT})
     message(FATAL_ERROR "Component ${COMPONENT} has not been initialized.")
   endif()
   set(libs ${${COMPONENT}_ICE_LIBRARIES})
@@ -620,7 +620,7 @@ function(astscf_component_add_slice_collection_libraries COMPONENT)
   if(NOT ARGN)
     message(FATAL_ERROR "You must pass at least one Slice collection to this function")
   endif()
-  if(NOT ASTSCF_${COMPONENT})
+  if(NOT ASTSCF_COMPONENT_${COMPONENT})
     message(FATAL_ERROR "Component ${COMPONENT} has not been initialized.")
   endif()
   set(libs ${${COMPONENT}_SLICE_LIBRARIES})
@@ -661,7 +661,7 @@ function(astscf_component_add_slices COMPONENT COLLECTION)
   if(NOT ARGN)
     message(FATAL_ERROR "You must pass at least one Slice file to this function")
   endif()
-  if(NOT ASTSCF_${COMPONENT})
+  if(NOT ASTSCF_COMPONENT_${COMPONENT})
     message(FATAL_ERROR "Component ${COMPONENT} has not been initialized.")
   endif()
   if(NOT SLICE_COLLECTION_${COLLECTION})
@@ -941,7 +941,7 @@ endfunction()
 
 # Function which builds a component as an IceBox service
 function(astscf_component_build_icebox COMPONENT)
-  if(NOT ASTSCF_${COMPONENT})
+  if(NOT ASTSCF_COMPONENT_${COMPONENT})
     message(FATAL_ERROR "Component ${COMPONENT} has not been initialized.")
   endif()
   message(STATUS "Building component ${COMPONENT} as an IceBox service")
@@ -959,7 +959,7 @@ endfunction()
 
 # Function which builds a component standalone
 function(astscf_component_build_standalone COMPONENT)
-  if(NOT ASTSCF_${COMPONENT})
+  if(NOT ASTSCF_COMPONENT_${COMPONENT})
     message(FATAL_ERROR "Component ${COMPONENT} has not been initialized.")
   endif()
   message(STATUS "Building component ${COMPONENT} as a standalone executable")
@@ -975,7 +975,7 @@ endfunction()
 
 function(astscf_component_build_library COMPONENT)
   cmake_parse_arguments("" "SHARED;STATIC;MODULE" "" "" ${ARGN})
-  if(NOT ASTSCF_${COMPONENT})
+  if(NOT ASTSCF_COMPONENT_${COMPONENT})
     message(FATAL_ERROR "Component ${COMPONENT} has not been initialized.")
   endif()
   if(NOT (_SHARED OR _STATIC OR _MODULE))
@@ -1002,7 +1002,7 @@ endfunction()
 
 # Install the given component to their proper location
 function(astscf_component_install COMPONENT)
-  if(NOT ASTSCF_${COMPONENT})
+  if(NOT ASTSCF_COMPONENT_${COMPONENT})
     message(FATAL_ERROR "Component ${COMPONENT} has not been initialized.")
   endif()
   if(${COMPONENT}_TYPE STREQUAL "icebox")

commit bf8f6d83b4f2b3b25dbffe99b20982c9a1c34f39
Author: Kevin P. Fleming <kpfleming at digium.com>
Date:   Thu Jun 23 15:09:43 2011 -0500

    Convert __astscf_append_to_var() to a function.
    
    This did not need to be a macro, and since macro scoping and argument rules
    in CMake are very strange, it's better for it to be a function.

diff --git a/AsteriskSCF.cmake b/AsteriskSCF.cmake
index c89a042..0811c79 100644
--- a/AsteriskSCF.cmake
+++ b/AsteriskSCF.cmake
@@ -103,13 +103,12 @@ function(__astscf_set_cache_string var value reason)
   endforeach()
 endfunction()
 
-macro(__astscf_append_to_var VAR)
-  unset(_altv)
+function(__astscf_append_to_var VAR)
   foreach(item ${ARGN})
     set(_altv "${_altv} ${item}")
   endforeach()
   set(${VAR} "${${VAR}} ${_altv}" PARENT_SCOPE)
-endmacro()
+endfunction()
 
 # installation directories (these are all relative to ${CMAKE_INSTALL_PREFIX})
 __astscf_set_cache_path(INSTALL_SYS_CONF_DIR etc "read-only data files that pertain to a single machine")

commit e28b4b692734af626abbec236f09535c450cfd30
Author: Kevin P. Fleming <kpfleming at digium.com>
Date:   Thu Jun 23 14:57:49 2011 -0500

    Ensure that bare filenames are properly converted to absolute paths.
    
    Some versions of CMake don't expand a bare filename into a full path when
    get_filename_component(REALPATH) is called, even though they should. In order
    to work around this bug, in __astscf_ensure_abs_paths, the script will now
    check for a bare filename as input, and if one is found, CMAKE_CURRENT_SOURCE_DIR
    will be prepended to the input filename.

diff --git a/AsteriskSCF.cmake b/AsteriskSCF.cmake
index 70fa132..c89a042 100644
--- a/AsteriskSCF.cmake
+++ b/AsteriskSCF.cmake
@@ -417,14 +417,17 @@ function(astscf_project NAME ICE_VERSION)
 endfunction()
 
 # Ensures that a list of paths are all absolute paths.
-macro(__astscf_ensure_abs_paths pathlist)
-  unset(eap_temp)
+function(__astscf_ensure_abs_paths pathlist)
   foreach(p ${${pathlist}})
+    get_filename_component(inpath "${p}" PATH)
+    if(NOT inpath)
+      set(p "${CMAKE_CURRENT_SOURCE_DIR}/${p}")
+    endif()
     get_filename_component(newpath "${p}" REALPATH)
     list(APPEND eap_temp "${newpath}")
   endforeach()
-  set(${pathlist} ${eap_temp})
-endmacro()
+  set(${pathlist} ${eap_temp} PARENT_SCOPE)
+endfunction()
 
 # Function which initializes a component for building
 function(astscf_component_init COMPONENT)

commit 29891bab0001cd9aad40e22ed7f30aec34b65daf
Author: Kevin P. Fleming <kpfleming at digium.com>
Date:   Thu Jun 23 08:54:13 2011 -0500

    Add CMakeParseArguments.cmake.
    
    Some 2.8.x versions of CMake don't include this module, which is now necessary
    for AsteriskSCF.cmake.

diff --git a/modules/CMakeParseArguments.cmake b/modules/CMakeParseArguments.cmake
new file mode 100644
index 0000000..7ce4c49
--- /dev/null
+++ b/modules/CMakeParseArguments.cmake
@@ -0,0 +1,138 @@
+# CMAKE_PARSE_ARGUMENTS(<prefix> <options> <one_value_keywords> <multi_value_keywords> args...)
+#
+# CMAKE_PARSE_ARGUMENTS() is intended to be used in macros or functions for
+# parsing the arguments given to that macro or function.
+# It processes the arguments and defines a set of variables which hold the
+# values of the respective options.
+#
+# The <options> argument contains all options for the respective macro,
+# i.e. keywords which can be used when calling the macro without any value
+# following, like e.g. the OPTIONAL keyword of the install() command.
+#
+# The <one_value_keywords> argument contains all keywords for this macro
+# which are followed by one value, like e.g. DESTINATION keyword of the
+# install() command.
+#
+# The <multi_value_keywords> argument contains all keywords for this macro
+# which can be followed by more than one value, like e.g. the TARGETS or
+# FILES keywords of the install() command.
+#
+# When done, CMAKE_PARSE_ARGUMENTS() will have defined for each of the
+# keywords listed in <options>, <one_value_keywords> and
+# <multi_value_keywords> a variable composed of the given <prefix>
+# followed by "_" and the name of the respective keyword.
+# These variables will then hold the respective value from the argument list.
+# For the <options> keywords this will be TRUE or FALSE.
+#
+# All remaining arguments are collected in a variable
+# <prefix>_UNPARSED_ARGUMENTS, this can be checked afterwards to see whether
+# your macro was called with unrecognized parameters.
+#
+# As an example here a my_install() macro, which takes similar arguments as the
+# real install() command:
+#
+#   function(MY_INSTALL)
+#     set(options OPTIONAL FAST)
+#     set(oneValueArgs DESTINATION RENAME)
+#     set(multiValueArgs TARGETS CONFIGURATIONS)
+#     cmake_parse_arguments(MY_INSTALL "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} )
+#     ...
+#
+# Assume my_install() has been called like this:
+#   my_install(TARGETS foo bar DESTINATION bin OPTIONAL blub)
+#
+# After the cmake_parse_arguments() call the macro will have set the following
+# variables:
+#   MY_INSTALL_OPTIONAL = TRUE
+#   MY_INSTALL_FAST = FALSE (this option was not used when calling my_install()
+#   MY_INSTALL_DESTINATION = "bin"
+#   MY_INSTALL_RENAME = "" (was not used)
+#   MY_INSTALL_TARGETS = "foo;bar"
+#   MY_INSTALL_CONFIGURATIONS = "" (was not used)
+#   MY_INSTALL_UNPARSED_ARGUMENTS = "blub" (no value expected after "OPTIONAL"
+#
+# You can the continue and process these variables.
+#
+# Keywords terminate lists of values, e.g. if directly after a one_value_keyword
+# another recognized keyword follows, this is interpreted as the beginning of
+# the new option.
+# E.g. my_install(TARGETS foo DESTINATION OPTIONAL) would result in
+# MY_INSTALL_DESTINATION set to "OPTIONAL", but MY_INSTALL_DESTINATION would
+# be empty and MY_INSTALL_OPTIONAL would be set to TRUE therefor.
+
+#=============================================================================
+# Copyright 2010 Alexander Neundorf <neundorf at kde.org>
+#
+# Distributed under the OSI-approved BSD License (the "License");
+# see accompanying file Copyright.txt for details.
+#
+# This software is distributed WITHOUT ANY WARRANTY; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the License for more information.
+#=============================================================================
+# (To distribute this file outside of CMake, substitute the full
+#  License text for the above reference.)
+
+
+if(__CMAKE_PARSE_ARGUMENTS_INCLUDED)
+  return()
+endif()
+set(__CMAKE_PARSE_ARGUMENTS_INCLUDED TRUE)
+
+
+function(CMAKE_PARSE_ARGUMENTS prefix _optionNames _singleArgNames _multiArgNames)
+  # first set all result variables to empty/FALSE
+  foreach(arg_name ${_singleArgNames} ${_multiArgNames})
+    set(${prefix}_${arg_name})
+  endforeach(arg_name)
+
+  foreach(option ${_optionNames})
+    set(${prefix}_${option} FALSE)
+  endforeach(option)
+
+  set(${prefix}_UNPARSED_ARGUMENTS)
+
+  set(insideValues FALSE)
+  set(currentArgName)
+
+  # now iterate over all arguments and fill the result variables
+  foreach(currentArg ${ARGN})
+    list(FIND _optionNames "${currentArg}" optionIndex)  # ... then this marks the end of the arguments belonging to this keyword
+    list(FIND _singleArgNames "${currentArg}" singleArgIndex)  # ... then this marks the end of the arguments belonging to this keyword
+    list(FIND _multiArgNames "${currentArg}" multiArgIndex)  # ... then this marks the end of the arguments belonging to this keyword
+
+    if(${optionIndex} EQUAL -1  AND  ${singleArgIndex} EQUAL -1  AND  ${multiArgIndex} EQUAL -1)
+      if(insideValues)
+        if("${insideValues}" STREQUAL "SINGLE")
+          set(${prefix}_${currentArgName} ${currentArg})
+          set(insideValues FALSE)
+        elseif("${insideValues}" STREQUAL "MULTI")
+          list(APPEND ${prefix}_${currentArgName} ${currentArg})
+        endif()
+      else(insideValues)
+        list(APPEND ${prefix}_UNPARSED_ARGUMENTS ${currentArg})
+      endif(insideValues)
+    else()
+      if(NOT ${optionIndex} EQUAL -1)
+        set(${prefix}_${currentArg} TRUE)
+        set(insideValues FALSE)
+      elseif(NOT ${singleArgIndex} EQUAL -1)
+        set(currentArgName ${currentArg})
+        set(${prefix}_${currentArgName})
+        set(insideValues "SINGLE")
+      elseif(NOT ${multiArgIndex} EQUAL -1)
+        set(currentArgName ${currentArg})
+        set(${prefix}_${currentArgName})
+        set(insideValues "MULTI")
+      endif()
+    endif()
+
+  endforeach(currentArg)
+
+  # propagate the result variables to the caller:
+  foreach(arg_name ${_singleArgNames} ${_multiArgNames} ${_optionNames})
+    set(${prefix}_${arg_name}  ${${prefix}_${arg_name}} PARENT_SCOPE)
+  endforeach(arg_name)
+  set(${prefix}_UNPARSED_ARGUMENTS ${${prefix}_UNPARSED_ARGUMENTS} PARENT_SCOPE)
+
+endfunction(CMAKE_PARSE_ARGUMENTS _options _singleArgs _multiArgs)

commit a96dd3658a0f95a2fefe77bcb65905ab2e2019ba
Author: Kevin P. Fleming <kpfleming at digium.com>
Date:   Fri Jun 17 11:45:06 2011 -0500

    Automatically add 'include' subdirectory to search path.
    
    If a project has a subdirectory named 'include', astscf_project() will now
    automatically add it to the include file search path for that project's
    directory and subdirectories.

diff --git a/AsteriskSCF.cmake b/AsteriskSCF.cmake
index b2cdefa..70fa132 100644
--- a/AsteriskSCF.cmake
+++ b/AsteriskSCF.cmake
@@ -273,6 +273,12 @@ endmacro()
 
 # Function which initializes project specific things
 function(astscf_project NAME ICE_VERSION)
+  message(STATUS "Setting up project ${NAME} for Ice version ${ICE_VERSION}")
+
+  if(IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/include")
+    include_directories(include)
+  endif()
+
   if(ASTSCF_MASTER_PROJECT)
     # this is a sub-project, so just record the name and
     # move on
@@ -290,8 +296,6 @@ function(astscf_project NAME ICE_VERSION)
     set(ASTSCF_MASTER_PROJECT true PARENT_SCOPE)
   endif()
 
-  message(STATUS "Setting up project ${NAME} for Ice version ${ICE_VERSION}")
-
   set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/lib" PARENT_SCOPE)
   set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/lib" PARENT_SCOPE)
   set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/bin" PARENT_SCOPE)

commit 6361a405ed365f5d5c70f3e507afffff9851f62f
Author: Kevin P. Fleming <kpfleming at digium.com>
Date:   Fri Jun 17 07:43:36 2011 -0500

    Update the one WIN32-specific call to __astscf_set_cache_string().

diff --git a/AsteriskSCF.cmake b/AsteriskSCF.cmake
index d83d3f6..b2cdefa 100644
--- a/AsteriskSCF.cmake
+++ b/AsteriskSCF.cmake
@@ -310,7 +310,7 @@ function(astscf_project NAME ICE_VERSION)
   # On Windows, 'debug' libraries should have a "d" suffix to indicate that they
   # are debug libraries
   if(WIN32)
-    __astscf_set_cache_string(CMAKE_DEBUG_POSTFIX "d")
+    __astscf_set_cache_string(CMAKE_DEBUG_POSTFIX "d" "" ADVANCED)
   endif()
 
   message(STATUS "Performing requirement checks for components")

commit af73b4c0eed57180257336641b83be07ac8d0a62
Author: Kevin P. Fleming <kpfleming at digium.com>
Date:   Thu Jun 16 17:09:43 2011 -0500

    Provide ability to automatically translate Slice files when needed.
    
    When a Slice file is added to a component (to be translated and compiled),
    other Slice files that it is dependent on may also need to be added to the
    component. This patch adds automatic addition of dependency Slice files. See
    the documentation for astscf_component_add_slices() to understand when this
    function is performed and why.

diff --git a/AsteriskSCF.cmake b/AsteriskSCF.cmake
index 8887518..d83d3f6 100644
--- a/AsteriskSCF.cmake
+++ b/AsteriskSCF.cmake
@@ -322,7 +322,7 @@ function(astscf_project NAME ICE_VERSION)
   # every component against those libraries at minimum
   set(ASTSCF_ICE_LIBRARIES ICE ICEUTIL PARENT_SCOPE)
 
-  astscf_slice_collection(GLOBAL NAME Ice PATH "${ICE_SLICE_DIR}" HEADERS "${ICE_INCLUDE_DIR}")
+  astscf_slice_collection(GLOBAL NOTRANSLATE NAME Ice PATH "${ICE_SLICE_DIR}" HEADERS "${ICE_INCLUDE_DIR}")
   astscf_slice_include_collection(Ice)
   set(SLICE_INCLUDE_DIRECTORIES ${SLICE_INCLUDE_DIRECTORIES} PARENT_SCOPE)
 
@@ -508,20 +508,25 @@ endfunction()
 # collection's details.
 #
 # Syntax:
-# astscf_slice_collection([OVERRIDE] [GLOBAL NAME <name> | LOCAL]
+# astscf_slice_collection([OVERRIDE] [GLOBAL NAME <name> | LOCAL] [TRANSLATE | NOTRANSLATE]
 #                         [PATH <path>] [LIBRARY <library] [HEADERS <path>])
 #
 # GLOBAL: defines a global collection; NAME is mandatory
 # LOCAL: (default) defines a local collection; NAME will be 'LOCAL'
 # OVERRIDE: must be specified in order to change PATH, LIBRARY or HEADERS
 #           for a previously-defined global collection
+# TRANSLATE: (default, unless the collection provides a library) Slice files
+#            in this collection should be translated into header/source files
+#            when used in a component
+# NOTRANSLATE: (default if the collection provides a library) Slice files in
+#              this collection should not be translated
 # NAME: name of the collection
 # PATH: path to the directory where the Slice files are located
 # HEADERS: path to the directory where Slice-generated headers are located
 # LIBRARY: path or target name of a library built from Slice-generated sources
 #
 function(astscf_slice_collection)
-  cmake_parse_arguments("" "OVERRIDE;GLOBAL;LOCAL" "NAME;PATH;LIBRARY;HEADERS" "" ${ARGN})
+  cmake_parse_arguments("" "OVERRIDE;GLOBAL;LOCAL;TRANSLATE;NOTRANSLATE" "NAME;PATH;LIBRARY;HEADERS" "" ${ARGN})
   if(_GLOBAL AND NOT _NAME)
     message(FATAL_ERROR "NAME argument to this function is mandatory for global Slice collections.")
   endif()
@@ -547,6 +552,9 @@ function(astscf_slice_collection)
     message(FATAL_ERROR "PATH argument to this function is mandatory.")
   endif()
   if(_GLOBAL)
+    list(APPEND collections ${_NAME} ${SLICE_GLOBAL_COLLECTIONS})
+    list(REMOVE_DUPLICATES collections)
+    __astscf_set_cache_string(SLICE_GLOBAL_COLLECTIONS "${collections}" "" ADVANCED)
     if(_PATH)
       __astscf_set_cache_path(SLICE_COLLECTION_${_NAME} "${real}" "Path to Slice files in collection ${_NAME}.")
     endif()
@@ -556,6 +564,11 @@ function(astscf_slice_collection)
     if(_HEADERS)
       __astscf_set_cache_path(SLICE_COLLECTION_${_NAME}_HEADERS "${_HEADERS}" "Path to generated headers for Slice collection ${_NAME}.")
     endif()
+    if(_NOTRANSLATE OR SLICE_COLLECTION_${_NAME}_LIBRARY)
+      __astscf_set_cache_string(SLICE_COLLECTION_${_NAME}_TRANSLATE "false" "" ADVANCED)
+    else()
+      __astscf_set_cache_string(SLICE_COLLECTION_${_NAME}_TRANSLATE "true" "" ADVANCED)
+    endif()
     message(STATUS "Added Slice collection '${_NAME}' at ${_PATH}")
   else()
     if(_PATH)
@@ -621,7 +634,12 @@ endfunction()
 
 # Function which records Slice files, from a collection, as being used by a
 # component. The Slice files will be translated and compiled when the component
-# is built.
+# is built. In addition, any Slice files that the specified files are dependent
+# on (via #include) that come from Slice collections which don't provide
+# libraries (or have been marked explicitly as needing translation) will also be
+# added to the component automatically. This will also occur for any Slice files
+# from the same collection as the specified files, even if that collection does
+# provide a library or has not been marked as needing translation.
 #
 # The Slice files are passed in as a list of globs, relative to the collection's
 # base directory.  The globs default to regular non-recursive expansion. If you
@@ -664,7 +682,10 @@ function(astscf_component_add_slices COMPONENT COLLECTION)
     endif()
   endif()
 
+  __astscf_slice_compiler_arguments(slice_compiler_arguments)
+
   set(collection_dir "${SLICE_COLLECTION_${COLLECTION}}")
+  set(collections ${${COMPONENT}_SLICE_COLLECTIONS})
   # default to glob syntax by default. not as useful as GLOB_RECURSE, but
   # follows the principle of least surprise
   set(glob_style GLOB)
@@ -678,70 +699,74 @@ function(astscf_component_add_slices COMPONENT COLLECTION)
       if(NOT slices)
 	message(FATAL_ERROR "Pattern '${slice_glob}' did not match any files in ${collection_dir}.")
       endif()
-      if(NOT found)
-	set(collections ${${COMPONENT}_SLICE_COLLECTIONS})
+      # if the component isn't already using any Slice files from this collection,
+      # record this collection in the list
+      list(FIND collections ${COLLECTION} index)
+      if(index EQUAL -1)
 	list(APPEND collections ${COLLECTION})
-	list(REMOVE_DUPLICATES collections)
-	__astscf_set_cache_string(${COMPONENT}_SLICE_COLLECTIONS "${collections}" "" ADVANCED)
       endif()
-      set(found true)
-      list(APPEND all_slices ${slices})
+      foreach(slice ${slices})
+	message(STATUS "Adding ${slice} from collection ${COLLECTION} to ${COMPONENT}")
+      endforeach()
+      list(APPEND new_slices ${slices})
     endif()
   endforeach()
-  list(APPEND all_slices ${${COMPONENT}_${COLLECTION}_SLICES})
+  list(APPEND all_slices ${${COMPONENT}_${COLLECTION}_SLICES} ${new_slices})
   list(REMOVE_DUPLICATES all_slices)
   __astscf_set_cache_string(${COMPONENT}_${COLLECTION}_SLICES "${all_slices}" "" ADVANCED)
+  # now use the Slice compiler to find Slice files that the ones that were just added are dependent on
+  foreach(slice ${new_slices})
+    __astscf_slice_get_targets_and_sources(${COLLECTION} "${collection_dir}" "${slice}" "${slice_compiler_arguments}" targets sources)
+    foreach(source ${sources})
+      # check to see if a dependency Slice file is located in a known collection; if so, then
+      # it might also need to be added to this component
+      foreach(collection ${SLICE_GLOBAL_COLLECTIONS} PROJECT LOCAL)
+	# the dependency file should be also be added to this component (to be translated)
+	# if the collection it comes from is marked to cause translation, *or* if it
+	# comes from the same collection as the one which is dependent on it
+	if(SLICE_COLLECTION_${collection}_TRANSLATE OR (collection STREQUAL COLLECTION))
+	  # check the initial parts of the path to the dependency file against the collection's
+	  # Slice file directory path
+	  if(SLICE_COLLECTION_${collection} AND ("${source}" MATCHES "${SLICE_COLLECTION_${collection}}/(.+)"))
+	    list(FIND ${COMPONENT}_${collection}_SLICES ${CMAKE_MATCH_1} index)
+	    if(index EQUAL -1)
+	      message(STATUS "Auto-adding ${CMAKE_MATCH_1} from collection ${collection} to ${COMPONENT}")
+	      # if the component isn't already using any Slice files from this collection,
+	      # record this collection in the list
+	      list(FIND collections ${collection} index)
+	      if(index EQUAL -1)
+		list(APPEND collections ${collection})
+	      endif()
+	      list(APPEND new_slices_${collection} ${CMAKE_MATCH_1})
+	    endif()
+	  endif()
+	endif()
+      endforeach()
+    endforeach()
+  endforeach()
+  # now append all the auto-discovered Slice files to the appropriate lists for this component
+  foreach(collection ${SLICE_GLOBAL_COLLECTIONS} PROJECT LOCAL)
+    if(new_slices_${collection})
+      unset(all_slices)
+      list(APPEND all_slices ${${COMPONENT}_${collection}_SLICES} ${new_slices_${collection}})
+      list(REMOVE_DUPLICATES all_slices)
+      __astscf_set_cache_string(${COMPONENT}_${collection}_SLICES "${all_slices}" "" ADVANCED)
+    endif()
+  endforeach()
+  list(REMOVE_DUPLICATES collections)
+  __astscf_set_cache_string(${COMPONENT}_SLICE_COLLECTIONS "${collections}" "" ADVANCED)
 endfunction()
 
-# Function which add a Slice file to a component. This handles all the magic of
-# creating the rules to run slice2cpp, adding the generated headers to the
-# include path, adding the generated .cpp file to the component, etc. The
-# generated files are placed in ${CMAKE_CURRENT_BINARY_DIR}/slice-<collection>.
+# Function which uses the Slice translator to discover the files that a particular Slice
+# file depends on, and the files the translator would generate from that Slice file. The
+# TARGETS argument specifies the name of a variable that will receive the list of generated
+# files; the SOURCES argument specifies the name of a variable that will receive the list
+# of dependency files.
 #
-function(__astscf_component_add_one_slice COMPONENT COLLECTION COLLECTION_DIR SLICE)
-  # Append the needed include directories for Slice definitions
-  foreach(include ${SLICE_INCLUDE_DIRECTORIES})
-    list(APPEND slice_compiler_arguments "-I${include}")
-  endforeach()
-
-  # Set some common Slice translator options:
-  # - generate support for the Ice streaming interface
-  # - generate checksums for definitions
-  # - allow underscores to be used in identifiers
-  list(APPEND slice_compiler_arguments "--stream" "--checksum" "--underscore")
-
-  # If any Slice plugins are to be used, include them in the
-  # compiler arguments
-  if(SLICE_PLUGINS)
-    foreach(plugin ${SLICE_PLUGINS})
-      list(APPEND slice_compiler_arguments "--plugin=${plugin}")
-    endforeach()
-  endif()
-
-  get_filename_component(slice_basename "${SLICE}" NAME_WE)
-  get_filename_component(slice_subdir "${SLICE}" PATH)
-
-  message(STATUS "Adding ${SLICE} from collection ${COLLECTION} to ${COMPONENT}")
-  # compute the directory in which to put the generated code and header files
-  set(slice_out_collection_dir "${CMAKE_CURRENT_BINARY_DIR}/${COMPONENT}/slice-${COLLECTION}")
-  if(slice_subdir)
-    set(slice_out_file_dir "${slice_out_collection_dir}/${slice_subdir}")
-  else()
-    set(slice_out_file_dir "${slice_out_collection_dir}")
-  endif()
-  # header files that refer to the one generated from this Slice file
-  # will try to find it from the base of the collection, so add that
-  # directory to the include path
-  include_directories(SYSTEM "${slice_out_collection_dir}")
-  # the C++ source file generated from this Slice file will try to find
-  # the generated header in the same directory as the source, so add
-  # the file's immediate directory to the include path as well
-  include_directories(SYSTEM "${slice_out_file_dir}")
-
-  # Determine this Slice file's dependencies
-  message(STATUS "Determining dependencies for ${SLICE}")
+function(__astscf_slice_get_targets_and_sources COLLECTION COLLECTION_DIR SLICE COMPILER_ARGS TARGETS SOURCES)
+  message(STATUS "Determining dependencies for ${SLICE} from ${COLLECTION}")
   execute_process(
-    COMMAND ${SLICE_COMPILER} ${slice_compiler_arguments} --depend ${COLLECTION_DIR}/${SLICE}
+    COMMAND ${SLICE_COMPILER} ${COMPILER_ARGS} --depend ${COLLECTION_DIR}/${SLICE}
     OUTPUT_VARIABLE raw_dependencies
     ERROR_VARIABLE slice_errors)
   if(slice_errors)
@@ -772,23 +797,41 @@ function(__astscf_component_add_one_slice COMPONENT COLLECTION COLLECTION_DIR SL
       list(APPEND expsources ${dep_sources})
     endforeach()
   endif()
-
   foreach(source ${expsources})
     # put the spaces back in.
     string(REPLACE "%20%" " " source ${source})
     list(APPEND sources ${source})
   endforeach()
 
-  # prepend the slice_out_dir to the targets
-  foreach(target ${targets})
-    list(APPEND generated_files "${slice_out_file_dir}/${target}")
+  if(targets)
+    get_filename_component(slice_basename "${SLICE}" NAME_WE)
+    list(APPEND targets "${slice_basename}.h")
+    list(REMOVE_DUPLICATES targets)
+    list(SORT targets)
+    set(${TARGETS} ${targets} PARENT_SCOPE)
+  endif()
+
+  if(sources)
+    list(SORT sources)
+    set(${SOURCES} ${sources} PARENT_SCOPE)
+  endif()
+endfunction()
+
+# Function which collects together all the arguments that should be specified
+# to the Slice compiler, if it is to be executed in the current scope. The list of
+# arguments is stored in the variable named in the ARGUMENTS argument.
+#
+function(__astscf_slice_compiler_arguments ARGUMENTS)
+  # Append the needed include directories for Slice definitions
+  foreach(include ${SLICE_INCLUDE_DIRECTORIES})
+    list(APPEND slice_compiler_arguments "-I${include}")
   endforeach()
-  # you would think that would be enough, but slice2cpp doesn't generate a
-  # dep for the .h file
-  list(APPEND generated_files "${slice_out_file_dir}/${slice_basename}.h")
-  # and be resilient in case it does so in the future...
-  list(REMOVE_DUPLICATES generated_files)
-  set_source_files_properties(${generated_files} PROPERTIES GENERATED 1)
+
+  # Set some common Slice translator options:
+  # - generate support for the Ice streaming interface
+  # - generate checksums for definitions
+  # - allow underscores to be used in identifiers
+  list(APPEND slice_compiler_arguments "--stream" "--checksum" "--underscore")
 
   # create a preprocessor definition in the generated CXX files that enables
   # the generated classes to be exported from the library (only necessary on
@@ -797,6 +840,53 @@ function(__astscf_component_add_one_slice COMPONENT COLLECTION COLLECTION_DIR SL
     list(APPEND slice_compiler_arguments "--dll-export" "ASTSCF_DLL_EXPORT")
   endif()
 
+  # If any Slice plugins are to be used, include them in the
+  # compiler arguments
+  if(SLICE_PLUGINS)
+    foreach(plugin ${SLICE_PLUGINS})
+      list(APPEND slice_compiler_arguments "--plugin=${plugin}")
+    endforeach()
+  endif()
+
+  set(${ARGUMENTS} ${slice_compiler_arguments} PARENT_SCOPE)
+endfunction()
+
+# Function which add a Slice file to a component. This handles all the magic of
+# creating the rules to run slice2cpp, adding the generated headers to the
+# include path, adding the generated .cpp file to the component, etc. The
+# generated files are placed in ${CMAKE_CURRENT_BINARY_DIR}/slice-<collection>.
+#
+function(__astscf_component_add_one_slice COMPONENT COLLECTION COLLECTION_DIR SLICE)
+  __astscf_slice_compiler_arguments(slice_compiler_arguments)
+
+  get_filename_component(slice_basename "${SLICE}" NAME_WE)
+  get_filename_component(slice_subdir "${SLICE}" PATH)
+
+  # compute the directory in which to put the generated code and header files
+  set(slice_out_collection_dir "${CMAKE_CURRENT_BINARY_DIR}/${COMPONENT}/slice-${COLLECTION}")
+  if(slice_subdir)
+    set(slice_out_file_dir "${slice_out_collection_dir}/${slice_subdir}")
+  else()
+    set(slice_out_file_dir "${slice_out_collection_dir}")
+  endif()
+
+  __astscf_slice_get_targets_and_sources(${COLLECTION} "${COLLECTION_DIR}" "${SLICE}" "${slice_compiler_arguments}" targets sources)
+
+  # prepend the slice_out_dir to the targets
+  foreach(target ${targets})
+    list(APPEND generated_files "${slice_out_file_dir}/${target}")
+  endforeach()
+  set_source_files_properties(${generated_files} PROPERTIES GENERATED 1)
+
+  # header files that refer to the one generated from this Slice file
+  # will try to find it from the base of the collection, so add that
+  # directory to the include path
+  include_directories(SYSTEM "${slice_out_collection_dir}")
+  # the C++ source file generated from this Slice file will try to find
+  # the generated header in the same directory as the source, so add
+  # the file's immediate directory to the include path as well
+  include_directories(SYSTEM "${slice_out_file_dir}")
+
   file(MAKE_DIRECTORY ${slice_out_file_dir})
   add_custom_command(
     OUTPUT ${generated_files}

commit df62a68703f9c80b2bad888dda3b739860a6f79d
Author: Kevin P. Fleming <kpfleming at digium.com>
Date:   Wed Jun 15 16:36:15 2011 -0500

    Support installation of Slice collections.
    
    Add the astscf_slice_collection_install() function, which will install the
    collection's Slice files, header files and library (if they are provided).

diff --git a/AsteriskSCF.cmake b/AsteriskSCF.cmake
index 5d299de..8887518 100644
--- a/AsteriskSCF.cmake
+++ b/AsteriskSCF.cmake
@@ -586,7 +586,7 @@ function(astscf_slice_include_collection COLLECTION)
   set(SLICE_INCLUDE_DIRECTORIES ${SLICE_INCLUDE_DIRECTORIES} PARENT_SCOPE)
   if(SLICE_COLLECTION_${COLLECTION}_HEADERS)
     set(path "${SLICE_COLLECTION_${COLLECTION}_HEADERS}")
-    message(STATUS "Using C++ headers for Slice collection ${COLLECTION} from: ${path}")
+    message(STATUS "Using C++ headers for Slice collection ${COLLECTION} from ${path}")
     # We mark the Slice include directory as a 'system' directory so that
     # the compiler will be less likely to generate warnings and/or errors
     # for the code in the generated header files.
@@ -912,44 +912,48 @@ function(astscf_component_install COMPONENT)
   if(${COMPONENT}_TYPE STREQUAL "icebox")
     install(
       TARGETS ${COMPONENT}
-      ARCHIVE DESTINATION ${ASTSCF_INSTALL_LIB_DIR}
-      LIBRARY DESTINATION ${ASTSCF_INSTALL_ICEBOX_DIR}
-      RUNTIME DESTINATION ${ASTSCF_INSTALL_ICEBOX_DIR}
+      ARCHIVE DESTINATION "${ASTSCF_INSTALL_LIB_DIR}"
+      LIBRARY DESTINATION "${ASTSCF_INSTALL_ICEBOX_DIR}"
+      RUNTIME DESTINATION "${ASTSCF_INSTALL_ICEBOX_DIR}"
       )
   else()
     install(
       TARGETS ${COMPONENT}
-      ARCHIVE DESTINATION ${ASTSCF_INSTALL_LIB_DIR}
-      LIBRARY DESTINATION ${ASTSCF_INSTALL_LIB_DIR}
-      RUNTIME DESTINATION ${ASTSCF_INSTALL_BIN_DIR}
+      ARCHIVE DESTINATION "${ASTSCF_INSTALL_LIB_DIR}"
+      LIBRARY DESTINATION "${ASTSCF_INSTALL_LIB_DIR}"
+      RUNTIME DESTINATION "${ASTSCF_INSTALL_BIN_DIR}"
       )
   endif()
 endfunction()
 
-# Install generated Slice header files to their proper location
-function(astscf_slice_headers_install)
-  install(
-    DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/generated/
-    DESTINATION ${ASTSCF_INSTALL_INCLUDE_DIR}
-    FILES_MATCHING PATTERN "*.h"
-    )
-endfunction()
-
-# Install Slice files to their proper location
-function(astscf_slice_install DIR)
-  install(
-    DIRECTORY ${DIR}
-    DESTINATION ${ASTSCF_INSTALL_SLICE_DIR}
-    FILES_MATCHING PATTERN "*.ice"
-    )
+function(astscf_slice_collection_install COLLECTION)
+  if(NOT SLICE_COLLECTION_${COLLECTION})
+    message(FATAL_ERROR "Slice collection ${COLLECTION} has not been defined.")
+  endif()
+  # install Slice files
+  install(DIRECTORY "${SLICE_COLLECTION_${COLLECTION}}/"
+          DESTINATION "${ASTSCF_INSTALL_SLICE_DIR}"
+	  FILES_MATCHING
+          PATTERN "*.ice"
+         )
+  # if the collection has a library that is a target in
+  # this build, install it
+  if(SLICE_COLLECTION_${COLLECTION}_LIBRARY AND ASTSCF_COMPONENT_${SLICE_COLLECTION_${COLLECTION}_LIBRARY})
+    astscf_component_install(${SLICE_COLLECTION_${COLLECTION}_LIBRARY})
+  endif()
+  # if the collection has headers, install them
+  if(SLICE_COLLECTION_${COLLECTION}_HEADERS)
+    astscf_headers_install("${SLICE_COLLECTION_${COLLECTION}_HEADERS}/")
+  endif()
 endfunction()
 
 # Install header files to their proper location
 function(astscf_headers_install DIR)
   install(
-    DIRECTORY ${DIR}
-    DESTINATION ${ASTSCF_INSTALL_INCLUDE_DIR}
-    FILES_MATCHING PATTERN "*.h"
+    DIRECTORY "${DIR}"
+    DESTINATION "${ASTSCF_INSTALL_INCLUDE_DIR}"
+    FILES_MATCHING
+    PATTERN "*.h"
     )
 endfunction()
 

commit 1b812c36754f0a85856c61f16899232f81ff0fc9
Author: Kevin P. Fleming <kpfleming at digium.com>
Date:   Tue Jun 14 17:41:27 2011 -0500

    Allow library type specific in astscf_build_library().
    
    astscf_build_library() can now be told to build a STATIC, SHARED or MODULE
    library; astscf_set_libtype() has been removed.

diff --git a/AsteriskSCF.cmake b/AsteriskSCF.cmake
index c225053..5d299de 100644
--- a/AsteriskSCF.cmake
+++ b/AsteriskSCF.cmake
@@ -877,21 +877,29 @@ function(astscf_component_build_standalone COMPONENT)
   target_link_libraries(${COMPONENT} ${component_libs})
 endfunction()
 
-function(astscf_set_libtype COMPONENT TYPE)
-  set("${COMPONENT}_LIBTYPE" ${TYPE} PARENT_SCOPE)
-endfunction()
-
 function(astscf_component_build_library COMPONENT)
+  cmake_parse_arguments("" "SHARED;STATIC;MODULE" "" "" ${ARGN})
   if(NOT ASTSCF_${COMPONENT})
     message(FATAL_ERROR "Component ${COMPONENT} has not been initialized.")
   endif()
-  message(STATUS "Building component ${COMPONENT} as a ${${COMPONENT}_LIBTYPE} library")
+  if(NOT (_SHARED OR _STATIC OR _MODULE))
+    set(libtype SHARED)
+  elseif(_SHARED AND NOT (_STATIC OR _MODULE))
+    set(libtype SHARED)
+  elseif(_STATIC AND NOT (_SHARED OR _MODULE))
+    set(libtype STATIC)
+  elseif(_MODULE AND NOT (_SHARED OR _STATIC))
+    set(libtype MODULE)
+  else()
+    message(FATAL_ERROR "Only one of STATIC, SHARED or MODULE may be specified.")
+  endif()
+  message(STATUS "Building component ${COMPONENT} as a ${libtype} library")
   __astscf_set_cache_string(${COMPONENT}_TYPE library "" ADVANCED)
   __astscf_component_slices(${COMPONENT})
   __astscf_component_libraries(${COMPONENT})
 
   # Now we actually create the component
-  add_library(${COMPONENT} ${${COMPONENT}_LIBTYPE} ${${COMPONENT}_SOURCES})
+  add_library(${COMPONENT} ${libtype} ${${COMPONENT}_SOURCES})
   # Link required libraries
   target_link_libraries(${COMPONENT} ${component_libs})
 endfunction()

commit b5b9a1bb420ad836744d90799618f5d13ea58d68
Author: Kevin P. Fleming <kpfleming at digium.com>
Date:   Tue Jun 14 17:30:59 2011 -0500

    Remove unnecessary variable references.

diff --git a/AsteriskSCF.cmake b/AsteriskSCF.cmake
index d888eeb..c225053 100644
--- a/AsteriskSCF.cmake
+++ b/AsteriskSCF.cmake
@@ -856,7 +856,7 @@ function(astscf_component_build_icebox COMPONENT)
   __astscf_component_libraries(${COMPONENT})
 
   # Now we actually create the shared module
-  add_library(${COMPONENT} MODULE ${${COMPONENT}_SLICES} ${${COMPONENT}_SOURCES})
+  add_library(${COMPONENT} MODULE ${${COMPONENT}_SOURCES})
   # Link required libraries
   target_link_libraries(${COMPONENT} ${component_libs})
 endfunction()
@@ -872,7 +872,7 @@ function(astscf_component_build_standalone COMPONENT)
   __astscf_component_libraries(${COMPONENT})
 
   # Now we actually create the component
-  add_executable(${COMPONENT} ${${COMPONENT}_SLICES} ${${COMPONENT}_SOURCES})
+  add_executable(${COMPONENT} ${${COMPONENT}_SOURCES})
   # Link required libraries
   target_link_libraries(${COMPONENT} ${component_libs})
 endfunction()
@@ -891,7 +891,7 @@ function(astscf_component_build_library COMPONENT)
   __astscf_component_libraries(${COMPONENT})
 
   # Now we actually create the component
-  add_library(${COMPONENT} ${${COMPONENT}_LIBTYPE} ${${COMPONENT}_SLICES} ${${COMPONENT}_SOURCES})
+  add_library(${COMPONENT} ${${COMPONENT}_LIBTYPE} ${${COMPONENT}_SOURCES})
   # Link required libraries
   target_link_libraries(${COMPONENT} ${component_libs})
 endfunction()

commit 700b3ed752084625fb5d638f2c3b2dbcbdfe356d
Author: Kevin P. Fleming <kpfleming at digium.com>
Date:   Tue Jun 14 17:07:17 2011 -0500

    Add initial support for Slice file 'collections'.
    
    Adds various functions to handle collections of Slice-defined interfaces in
    an easy-to-use manner; this insulates the scripts that build components
    from having to know the actual paths where Slice files, headers files and
    libraries are located.

diff --git a/AsteriskSCF.cmake b/AsteriskSCF.cmake
index b816283..d888eeb 100644
--- a/AsteriskSCF.cmake
+++ b/AsteriskSCF.cmake
@@ -184,6 +184,8 @@ endif()
 include(CTest)
 enable_testing()
 
+include(CMakeParseArguments)
+
 if(UNIX AND EXISTS "${CMAKE_SOURCE_DIR}/.git")
   add_custom_target(update COMMAND git pull WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}" COMMENT "Updating clone")
   add_custom_target(pull COMMAND git pull WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}" COMMENT "Updating clone")
@@ -320,15 +322,8 @@ function(astscf_project NAME ICE_VERSION)
   # every component against those libraries at minimum
   set(ASTSCF_ICE_LIBRARIES ICE ICEUTIL PARENT_SCOPE)
 
-  message(STATUS "Using Ice C++ headers from: ${ICE_INCLUDE_DIR}")
-  # We mark the Ice include directory as a 'system' directory so that
-  # the compiler will be less likely to generate warnings and/or errors
-  # for the code in the Ice header files.
-  include_directories(SYSTEM "${ICE_INCLUDE_DIR}")
-
-  set(SLICE_COLLECTION_Ice "${ICE_SLICE_DIR}")
-  list(APPEND SLICE_INCLUDE_DIRECTORIES "${ICE_SLICE_DIR}")
-  list(REMOVE_DUPLICATES SLICE_INCLUDE_DIRECTORIES)
+  astscf_slice_collection(GLOBAL NAME Ice PATH "${ICE_SLICE_DIR}" HEADERS "${ICE_INCLUDE_DIR}")
+  astscf_slice_include_collection(Ice)
   set(SLICE_INCLUDE_DIRECTORIES ${SLICE_INCLUDE_DIRECTORIES} PARENT_SCOPE)
 
   # threading support required
@@ -427,20 +422,6 @@ macro(__astscf_ensure_abs_paths pathlist)
   set(${pathlist} ${eap_temp})
 endmacro()
 
-# Function which remembers Slice plugins to be used for all targets in the
-# current directory and below
-function(astscf_slice_plugins)
-  if(NOT ARGN)
-    message(FATAL_ERROR "You must pass at least one plugin to this function")
-  endif()
-  set(plugins ${SLICE_PLUGINS})
-  foreach(plugin ${ARGN})
-    list(APPEND plugins ${plugin})
-  endforeach()
-  list(REMOVE_DUPLICATES plugins)
-  set(SLICE_PLUGINS ${plugins} PARENT_SCOPE)
-endfunction()
-
 # Function which initializes a component for building
 function(astscf_component_init COMPONENT)
   message(STATUS "Setting up to build component ${COMPONENT}")
@@ -503,22 +484,144 @@ function(astscf_component_add_ice_libraries COMPONENT)
   __astscf_set_cache_string(${COMPONENT}_ICE_LIBRARIES "${libs}" "" ADVANCED)
 endfunction()
 
-function(astscf_slice_collection COLLECTION PATH)
-  get_filename_component(real "${PATH}" REALPATH)
-  set(SLICE_COLLECTION_${COLLECTION} "${real}" PARENT_SCOPE)
-  message(STATUS "Added Slice collection '${COLLECTION}' at ${PATH}")
+# Function which remembers Slice plugins to be used for all targets in the
+# current directory and below
+function(astscf_slice_plugins)
+  if(NOT ARGN)
+    message(FATAL_ERROR "You must pass at least one plugin to this function")
+  endif()
+  set(plugins ${SLICE_PLUGINS})
+  foreach(plugin ${ARGN})
+    list(APPEND plugins ${plugin})
+  endforeach()
+  list(REMOVE_DUPLICATES plugins)
+  set(SLICE_PLUGINS ${plugins} PARENT_SCOPE)
+endfunction()
+
+# Function which defines a 'collection' of Slice interfaces; the collection
+# will consist of one or more Slice files, and optionally header/source files
+# generated in C++ from them, also optionally a compiled library produced
+# from the generated sources. Both global and local collections are supported;
+# local collections are unnamed and visible only to the directory they are defined
+# in and below. This function can be called more than once for the same global
+# collection if desired, using the 'OVERRIDE' flag, in order to 'update' the
+# collection's details.
+#
+# Syntax:
+# astscf_slice_collection([OVERRIDE] [GLOBAL NAME <name> | LOCAL]
+#                         [PATH <path>] [LIBRARY <library] [HEADERS <path>])
+#
+# GLOBAL: defines a global collection; NAME is mandatory
+# LOCAL: (default) defines a local collection; NAME will be 'LOCAL'
+# OVERRIDE: must be specified in order to change PATH, LIBRARY or HEADERS
+#           for a previously-defined global collection
+# NAME: name of the collection
+# PATH: path to the directory where the Slice files are located
+# HEADERS: path to the directory where Slice-generated headers are located
+# LIBRARY: path or target name of a library built from Slice-generated sources
+#
+function(astscf_slice_collection)
+  cmake_parse_arguments("" "OVERRIDE;GLOBAL;LOCAL" "NAME;PATH;LIBRARY;HEADERS" "" ${ARGN})
+  if(_GLOBAL AND NOT _NAME)
+    message(FATAL_ERROR "NAME argument to this function is mandatory for global Slice collections.")
+  endif()
+  if(_LOCAL AND _NAME)
+    message(FATAL_ERROR "NAME argument to this function is not allowed for local Slice collections.")
+  endif()
+  if(_NAME STREQUAL "LOCAL")
+    message(FATAL_ERROR "'LOCAL' name for Slice collections is reserved.")
+  endif()
+  if(_NAME STREQUAL "PROJECT")
+    message(FATAL_ERROR "'LOCAL' name for Slice collections is reserved.")
+  endif()
+  if(_LIBRARY)
+    if(_GLOBAL AND NOT (_HEADERS OR SLICE_COLLECTION_${_NAME}_HEADERS))
+      message(FATAL_ERROR "A collection with a library must also provide headers.")
+    elseif(_LOCAL AND NOT (_HEADERS OR SLICE_COLLECTION_LOCAL_HEADERS))
+      message(FATAL_ERROR "A collection with a library must also provide headers.")
+    endif()
+  endif()
+  if(_PATH)
+    get_filename_component(real "${_PATH}" REALPATH)
+  elseif(NOT (_OVERRIDE AND _GLOBAL AND SLICE_COLLECTION_${_NAME}))
+    message(FATAL_ERROR "PATH argument to this function is mandatory.")
+  endif()
+  if(_GLOBAL)
+    if(_PATH)
+      __astscf_set_cache_path(SLICE_COLLECTION_${_NAME} "${real}" "Path to Slice files in collection ${_NAME}.")
+    endif()
+    if(_LIBRARY)
+      __astscf_set_cache_string(SLICE_COLLECTION_${_NAME}_LIBRARY "${_LIBRARY}" "Library of generated code for Slice collection ${_NAME}.")
+    endif()
+    if(_HEADERS)
+      __astscf_set_cache_path(SLICE_COLLECTION_${_NAME}_HEADERS "${_HEADERS}" "Path to generated headers for Slice collection ${_NAME}.")
+    endif()
+    message(STATUS "Added Slice collection '${_NAME}' at ${_PATH}")
+  else()
+    if(_PATH)
+      set(SLICE_COLLECTION_LOCAL "${real}" PARENT_SCOPE)
+    endif()
+    if(_LIBRARY)
+      set(SLICE_COLLECTION_LOCAL_LIBRARY "${_LIBRARY}" PARENT_SCOPE)
+    endif()
+    if(_HEADERS)
+      set(SLICE_COLLECTION_LOCAL_HEADERS "${_HEADERS}" PARENT_SCOPE)
+    endif()
+    message(STATUS "Added local Slice collection at ${_PATH}")
+  endif()
 endfunction()
 
+# Function which makes the Slice files and header files from a collection
+# available to components in the current directory and below. The collection's
+# Slice file directory is added to SLICE_INCLUDE_DIRECTORIES (for later use
+# by the Slice translator), and the collection's header files directory
+# (if any) is added as a 'system' include directory for compilations.
+#
 function(astscf_slice_include_collection COLLECTION)
+  if(NOT SLICE_COLLECTION_${COLLECTION})
+    message(FATAL_ERROR "Slice collection ${COLLECTION} has not been defined.")
+  endif()
   list(APPEND SLICE_INCLUDE_DIRECTORIES "${SLICE_COLLECTION_${COLLECTION}}")
   list(REMOVE_DUPLICATES SLICE_INCLUDE_DIRECTORIES)
   set(SLICE_INCLUDE_DIRECTORIES ${SLICE_INCLUDE_DIRECTORIES} PARENT_SCOPE)
+  if(SLICE_COLLECTION_${COLLECTION}_HEADERS)
+    set(path "${SLICE_COLLECTION_${COLLECTION}_HEADERS}")
+    message(STATUS "Using C++ headers for Slice collection ${COLLECTION} from: ${path}")
+    # We mark the Slice include directory as a 'system' directory so that
+    # the compiler will be less likely to generate warnings and/or errors
+    # for the code in the generated header files.
+    include_directories(SYSTEM "${path}")
+  endif()
 endfunction()
 
-# Adds Slice files from a collection to a target. This handles all the magic of
-# creating the rules to run slice2cpp, adding the generated headers to the
-# include path, adding the generated .cpp file to the component, etc. The
-# generated files are placed in ${CMAKE_CURRENT_BINARY_DIR}/slice-<collection>.
+# Function which links the library associated with a Slice collection into
+# a component.
+#
+function(astscf_component_add_slice_collection_libraries COMPONENT)
+  if(NOT ARGN)
+    message(FATAL_ERROR "You must pass at least one Slice collection to this function")
+  endif()
+  if(NOT ASTSCF_${COMPONENT})
+    message(FATAL_ERROR "Component ${COMPONENT} has not been initialized.")
+  endif()
+  set(libs ${${COMPONENT}_SLICE_LIBRARIES})
+  foreach(lib ${ARGN})
+    if(NOT SLICE_COLLECTION_${lib})
+      message(FATAL_ERROR "Slice collection ${lib} has not been defined.")
+    endif()
+    if(NOT SLICE_COLLECTION_${lib}_LIBRARY)
+      message(FATAL_ERROR "Slice collection ${lib} does not provide a library.")
+    endif()
+    message(STATUS "Linking component ${COMPONENT} to library from Slice collection ${lib}")
+    list(APPEND libs ${lib})
+  endforeach()
+  list(REMOVE_DUPLICATES libs)
+  __astscf_set_cache_string(${COMPONENT}_SLICE_LIBRARIES "${libs}" "" ADVANCED)
+endfunction()
+
+# Function which records Slice files, from a collection, as being used by a
+# component. The Slice files will be translated and compiled when the component
+# is built.
 #
 # The Slice files are passed in as a list of globs, relative to the collection's
 # base directory.  The globs default to regular non-recursive expansion. If you
@@ -529,6 +632,7 @@ endfunction()
 #
 # See http://www.cmake.org/cmake/help/cmake-2-8-docs.html#command:file for more
 # details on the globbing syntax.
+#
 function(astscf_component_add_slices COMPONENT COLLECTION)
   if(NOT ARGN)
     message(FATAL_ERROR "You must pass at least one Slice file to this function")
@@ -571,14 +675,29 @@ function(astscf_component_add_slices COMPONENT COLLECTION)
     else()
       # expand the glob into a list of files
       file(${glob_style} slices RELATIVE "${collection_dir}" "${collection_dir}/${slice_glob}")
-      foreach(slice ${slices})
-        __astscf_component_add_one_slice(${COMPONENT} "${COLLECTION}" "${collection_dir}" "${slice}")
-      endforeach()
+      if(NOT slices)
+	message(FATAL_ERROR "Pattern '${slice_glob}' did not match any files in ${collection_dir}.")
+      endif()
+      if(NOT found)
+	set(collections ${${COMPONENT}_SLICE_COLLECTIONS})
+	list(APPEND collections ${COLLECTION})
+	list(REMOVE_DUPLICATES collections)
+	__astscf_set_cache_string(${COMPONENT}_SLICE_COLLECTIONS "${collections}" "" ADVANCED)
+      endif()
+      set(found true)
+      list(APPEND all_slices ${slices})
     endif()
   endforeach()
-  __astscf_set_cache_string(${COMPONENT}_SLICES "${${COMPONENT}_SLICES}" "" ADVANCED)
+  list(APPEND all_slices ${${COMPONENT}_${COLLECTION}_SLICES})
+  list(REMOVE_DUPLICATES all_slices)
+  __astscf_set_cache_string(${COMPONENT}_${COLLECTION}_SLICES "${all_slices}" "" ADVANCED)
 endfunction()
 
+# Function which add a Slice file to a component. This handles all the magic of
+# creating the rules to run slice2cpp, adding the generated headers to the
+# include path, adding the generated .cpp file to the component, etc. The
+# generated files are placed in ${CMAKE_CURRENT_BINARY_DIR}/slice-<collection>.
+#
 function(__astscf_component_add_one_slice COMPONENT COLLECTION COLLECTION_DIR SLICE)
   # Append the needed include directories for Slice definitions
   foreach(include ${SLICE_INCLUDE_DIRECTORIES})
@@ -620,7 +739,7 @@ function(__astscf_component_add_one_slice COMPONENT COLLECTION COLLECTION_DIR SL
   include_directories(SYSTEM "${slice_out_file_dir}")
 
   # Determine this Slice file's dependencies
-  message(STATUS "Determining dependencies for ${slice_basename}")
+  message(STATUS "Determining dependencies for ${SLICE}")
   execute_process(
     COMMAND ${SLICE_COMPILER} ${slice_compiler_arguments} --depend ${COLLECTION_DIR}/${SLICE}
     OUTPUT_VARIABLE raw_dependencies
@@ -687,8 +806,21 @@ function(__astscf_component_add_one_slice COMPONENT COLLECTION COLLECTION_DIR SL
     DEPENDS ${sources} ${SLICE_COMPILER})
 
   # the Slice and generated_files are now sources for the component
-  set(file_list ${${COMPONENT}_SLICES} ${COLLECTION_DIR}/${SLICE} ${generated_files})
-  set(${COMPONENT}_SLICES ${file_list} PARENT_SCOPE)
+  set(file_list ${${COMPONENT}_SOURCES} ${COLLECTION_DIR}/${SLICE} ${generated_files})
+  set(${COMPONENT}_SOURCES ${file_list} PARENT_SCOPE)
+endfunction()
+
+# Function which collects Slice files used by a component, causing them
+# to be translated, compiled and linked into the component
+#
+function(__astscf_component_slices COMPONENT)
+  foreach(collection ${${COMPONENT}_SLICE_COLLECTIONS})
+    set(collection_dir "${SLICE_COLLECTION_${collection}}")
+    foreach(slice ${${COMPONENT}_${collection}_SLICES})
+      __astscf_component_add_one_slice(${COMPONENT} ${collection} "${collection_dir}" "${slice}")
+    endforeach()
+  endforeach()
+  set(${COMPONENT}_SOURCES ${${COMPONENT}_SOURCES} PARENT_SCOPE)
 endfunction()
 
 # Function which collects libraries needed by a component
@@ -705,6 +837,9 @@ function(__astscf_component_libraries COMPONENT)
       list(APPEND target_libs "${Boost_${lib}_LIBRARY}")
     endforeach()
   endif()
+  foreach(lib ${${COMPONENT}_SLICE_LIBRARIES})
+    list(APPEND target_libs "${SLICE_COLLECTION_${lib}_LIBRARY}")
+  endforeach()
   set(component_libs ${target_libs} PARENT_SCOPE)
 endfunction()
 
@@ -717,6 +852,7 @@ function(astscf_component_build_icebox COMPONENT)
   __astscf_set_cache_string(${COMPONENT}_TYPE icebox "" ADVANCED)
   find_package(Ice REQUIRED IceBox)
   list(APPEND icelibs ${${COMPONENT}_ICE_LIBRARIES} ICEBOX)
+  __astscf_component_slices(${COMPONENT})
   __astscf_component_libraries(${COMPONENT})
 
   # Now we actually create the shared module
@@ -732,6 +868,7 @@ function(astscf_component_build_standalone COMPONENT)
   endif()
   message(STATUS "Building component ${COMPONENT} as a standalone executable")
   __astscf_set_cache_string(${COMPONENT}_TYPE standalone "" ADVANCED)
+  __astscf_component_slices(${COMPONENT})
   __astscf_component_libraries(${COMPONENT})
 
   # Now we actually create the component
@@ -750,6 +887,7 @@ function(astscf_component_build_library COMPONENT)
   endif()
   message(STATUS "Building component ${COMPONENT} as a ${${COMPONENT}_LIBTYPE} library")
   __astscf_set_cache_string(${COMPONENT}_TYPE library "" ADVANCED)
+  __astscf_component_slices(${COMPONENT})
   __astscf_component_libraries(${COMPONENT})
 
   # Now we actually create the component

commit 4353dabef3a6599a07d32c8f86c8a138e0ba51c7
Author: Kevin P. Fleming <kpfleming at digium.com>
Date:   Mon Jun 13 15:53:59 2011 -0500

    Ensure that shared objects have no unresolved symbols.
    
    When doing builds on Linux, the linker will now ensure that all symbols
    referenced by the object files linked into the module or library are
    resolvable at link time (in other words, all libraries needed by the
    code in the module/library have been specified to the linker). If any
    symbols cannot be resolved, an error will be generated at link time (rather
    than later at run time).

diff --git a/AsteriskSCF.cmake b/AsteriskSCF.cmake
index 5a6f8a6..b816283 100644
--- a/AsteriskSCF.cmake
+++ b/AsteriskSCF.cmake
@@ -369,6 +369,13 @@ function(astscf_project NAME ICE_VERSION)
     list(APPEND cxx_flags ${ICE_CXX_FLAGS})
     list(APPEND cxx_flags_debug "-Wall" "-Wextra" "-g3")
     list(APPEND cxx_flags_debug "-Wshadow" "-Wmissing-format-attribute" "-Wformat=2" "-Wpointer-arith" "-Wconversion")
+    # When building shared objects (libraries or modules), the linker normally
+    # doesn't try to ensure that all symbols referenced by the code linked
+    # into the object have been satisfied... which means that unresolved
+    # symbols won't be found until runtime. This flag tells the linker
+    # to do that resolution at link time, and report an error if a symbol
+    # is unresolved.
+    list(APPEND cxx_flags_debug "-Wl,--no-undefined")
     include(CheckCXXCompilerFlag)
     CHECK_CXX_COMPILER_FLAG(-Wlogical-op HAVE_W_LOGICAL_OP)
     if(HAVE_W_LOGICAL_OP)

commit 62977bc8bf24a29355caddb274e8b15db256d885
Author: Kevin P. Fleming <kpfleming at digium.com>
Date:   Tue Jun 7 16:29:01 2011 -0500

    Add support for a 'make uninstall' Makefile target.
    
    Code for this target came from the CMake wiki at www.cmake.org.

diff --git a/AsteriskSCF.cmake b/AsteriskSCF.cmake
index 0a72604..5a6f8a6 100644
--- a/AsteriskSCF.cmake
+++ b/AsteriskSCF.cmake
@@ -189,6 +189,16 @@ if(UNIX AND EXISTS "${CMAKE_SOURCE_DIR}/.git")
   add_custom_target(pull COMMAND git pull WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}" COMMENT "Updating clone")
 endif()
 
+configure_file(
+  "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules/cmake_uninstall.cmake.in"
+  "${CMAKE_CURRENT_BINARY_DIR}/cmake/modules/cmake_uninstall.cmake"
+  IMMEDIATE @ONLY
+  )
+add_custom_target(
+  uninstall
+  "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake/modules/cmake_uninstall.cmake"
+  )
+
 macro(__astscf_compute_test_paths)
   # We need to construct a PATH that will allow unit tests to be run
   # against the versions of Ice and Boost that the components and test
diff --git a/modules/cmake_uninstall.cmake.in b/modules/cmake_uninstall.cmake.in
new file mode 100644
index 0000000..9b093d4
--- /dev/null
+++ b/modules/cmake_uninstall.cmake.in
@@ -0,0 +1,22 @@
+if(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
+  message(FATAL_ERROR "Cannot find install manifest: @CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
+endif()
+
+file(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files)
+string(REGEX REPLACE "\n" ";" files "${files}")
+foreach(file ${files})
+  set(file "$ENV{DESTDIR}${file}")
+  message(STATUS "Uninstalling ${file}")
+  if(EXISTS "${file}")
+    exec_program(
+      "@CMAKE_COMMAND@" ARGS "-E remove "${file}""
+      OUTPUT_VARIABLE rm_out
+      RETURN_VALUE rm_retval
+      )
+    if(NOT rm_retval STREQUAL 0)
+      message(STATUS "Failed to remove ${file}.")
+    endif()
+  else()
+    message(STATUS "File ${file} does not exist.")
+  endif()
+endforeach()

commit ed9224e3705d15c916a63a083c1b494e2b9b28d6
Author: Kevin P. Fleming <kpfleming at digium.com>
Date:   Tue Jun 7 08:47:16 2011 -0500

    Generate slice2cpp output in a per-component directory.
    
    If multiple components in the same source directory use the same Slice
    files, they should have separate translator output files for those Slice files.

diff --git a/AsteriskSCF.cmake b/AsteriskSCF.cmake
index a6f54fb..0a72604 100644
--- a/AsteriskSCF.cmake
+++ b/AsteriskSCF.cmake
@@ -587,7 +587,7 @@ function(__astscf_component_add_one_slice COMPONENT COLLECTION COLLECTION_DIR SL
 
   message(STATUS "Adding ${SLICE} from collection ${COLLECTION} to ${COMPONENT}")
   # compute the directory in which to put the generated code and header files
-  set(slice_out_collection_dir "${CMAKE_CURRENT_BINARY_DIR}/slice-${COLLECTION}")
+  set(slice_out_collection_dir "${CMAKE_CURRENT_BINARY_DIR}/${COMPONENT}/slice-${COLLECTION}")
   if(slice_subdir)
     set(slice_out_file_dir "${slice_out_collection_dir}/${slice_subdir}")
   else()

commit b5567de5ab05f63fece29363b43c72563d713a71
Author: Kevin P. Fleming <kpfleming at digium.com>
Date:   Mon Jun 6 18:39:34 2011 -0500

    Implement Slice file 'collections'.
    
    Major upgrade to handle Slice files in 'collections'; groups provided by
    packages or in a component directory. This greatly simplifies the path
    handling for computing the generated file locations, and will ease the
    transition towards a fully disintegrated build.

diff --git a/AsteriskSCF.cmake b/AsteriskSCF.cmake
index cae209a..a6f54fb 100644
--- a/AsteriskSCF.cmake
+++ b/AsteriskSCF.cmake
@@ -266,6 +266,12 @@ function(astscf_project NAME ICE_VERSION)
     # move on
     set(ASTSCF_PROJECT "${NAME}" PARENT_SCOPE)
     set(ASTSCF_PROJECT_DIR "${CMAKE_CURRENT_SOURCE_DIR}" PARENT_SCOPE)
+    if(IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/slice")
+      set(SLICE_COLLECTION_PROJECT "${CMAKE_CURRENT_SOURCE_DIR}/slice" PARENT_SCOPE)
+      message(STATUS "Added project-specific Slice collection for '${NAME}' at ${CMAKE_CURRENT_SOURCE_DIR}/slice")
+      list(APPEND SLICE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}/slice")
+      set(SLICE_INCLUDE_DIRECTORIES ${SLICE_INCLUDE_DIRECTORIES} PARENT_SCOPE)
+    endif()
     return()
   else()
     set(ASTSCF_PROJECT "MASTER" PARENT_SCOPE)
@@ -310,10 +316,10 @@ function(astscf_project NAME ICE_VERSION)
   # for the code in the Ice header files.
   include_directories(SYSTEM "${ICE_INCLUDE_DIR}")
 
-  message(STATUS "Using Ice Slice files from: ${ICE_SLICE_DIR}")
-  # We can't use astscf_slice_include_directories here because
-  # the variable it sets will only be local to this function
-  set(SLICE_INCLUDE_DIRECTORIES "${ICE_SLICE_DIR}" PARENT_SCOPE)
+  set(SLICE_COLLECTION_Ice "${ICE_SLICE_DIR}")
+  list(APPEND SLICE_INCLUDE_DIRECTORIES "${ICE_SLICE_DIR}")
+  list(REMOVE_DUPLICATES SLICE_INCLUDE_DIRECTORIES)
+  set(SLICE_INCLUDE_DIRECTORIES ${SLICE_INCLUDE_DIRECTORIES} PARENT_SCOPE)
 
   # threading support required
   find_package(Threads REQUIRED)
@@ -401,21 +407,9 @@ macro(__astscf_ensure_abs_paths pathlist)
     get_filename_component(newpath "${p}" REALPATH)
     list(APPEND eap_temp "${newpath}")
   endforeach()
-  list(REMOVE_DUPLICATES eap_temp)
   set(${pathlist} ${eap_temp})
 endmacro()
 
-# Function which remembers include directories needed for translating
-# Slice files in the current directory and below
-function(astscf_slice_include_directories)
-  set(paths ${ARGN})
-  if(SLICE_INCLUDE_DIRECTORIES)
-    list(INSERT paths 0 ${SLICE_INCLUDE_DIRECTORIES})
-  endif()
-  __astscf_ensure_abs_paths(paths)
-  set(SLICE_INCLUDE_DIRECTORIES ${paths} PARENT_SCOPE)
-endfunction()
-
 # Function which remembers Slice plugins to be used for all targets in the
 # current directory and below
 function(astscf_slice_plugins)
@@ -460,7 +454,7 @@ function(astscf_component_add_boost_libraries COMPONENT)
 endfunction()
 
 # Function which adds source or header files to a component to be built
-function(astscf_component_add_file COMPONENT)
+function(astscf_component_add_files COMPONENT)
   if(NOT ARGN)
     message(FATAL_ERROR "You must pass at least one source file to this function")
   endif()
@@ -492,47 +486,43 @@ function(astscf_component_add_ice_libraries COMPONENT)
   __astscf_set_cache_string(${COMPONENT}_ICE_LIBRARIES "${libs}" "" ADVANCED)
 endfunction()
 
-# Adds Slice files to a target.  This handles all the magic of creating the
-# rules to run slice2cpp, adding the generated headers to the include path,
-# adding the generated .cpp file to the component, etc.  The generated files
-# are placed in ${CMAKE_CURRENT_BINARY_DIR}/generated.
+function(astscf_slice_collection COLLECTION PATH)
+  get_filename_component(real "${PATH}" REALPATH)
+  set(SLICE_COLLECTION_${COLLECTION} "${real}" PARENT_SCOPE)
+  message(STATUS "Added Slice collection '${COLLECTION}' at ${PATH}")
+endfunction()
+
+function(astscf_slice_include_collection COLLECTION)
+  list(APPEND SLICE_INCLUDE_DIRECTORIES "${SLICE_COLLECTION_${COLLECTION}}")
+  list(REMOVE_DUPLICATES SLICE_INCLUDE_DIRECTORIES)
+  set(SLICE_INCLUDE_DIRECTORIES ${SLICE_INCLUDE_DIRECTORIES} PARENT_SCOPE)
+endfunction()
+
+# Adds Slice files from a collection to a target. This handles all the magic of
+# creating the rules to run slice2cpp, adding the generated headers to the
+# include path, adding the generated .cpp file to the component, etc. The
+# generated files are placed in ${CMAKE_CURRENT_BINARY_DIR}/slice-<collection>.
 #
-# The Slice files are passed in as a list of globs, relative to
-# the current source directory.  The globs default to regular non-recursive
-# globs.  If you want to include subdirectories in you glob search, also
-# pass in GLOB_RECURSE.
+# The Slice files are passed in as a list of globs, relative to the collection's
+# base directory.  The globs default to regular non-recursive expansion. If you
+# want to include subdirectories in the glob search, also pass in GLOB_RECURSE.
 #
 # For example:
-#   astscf_component_add_slice(comp-name GLOB_RECURSE "*.ice")
+#   astscf_component_add_slice(comp-name ASTSCF GLOB_RECURSE "*.ice")
 #
 # See http://www.cmake.org/cmake/help/cmake-2-8-docs.html#command:file for more
 # details on the globbing syntax.
-function(astscf_component_add_slice COMPONENT)
+function(astscf_component_add_slices COMPONENT COLLECTION)
   if(NOT ARGN)
     message(FATAL_ERROR "You must pass at least one Slice file to this function")
   endif()
   if(NOT ASTSCF_${COMPONENT})
     message(FATAL_ERROR "Component ${COMPONENT} has not been initialized.")
   endif()
-  # default to glob syntax by default.  not as useful as GLOB_RECURSE, but
-  # follows the principle of least surprise
-  set(glob_style GLOB)
-  foreach(slice_glob ${ARGN})
-    if(${slice_glob} STREQUAL GLOB OR ${slice_glob} STREQUAL GLOB_RECURSE)
-      # change our globbing style
-      set(glob_style ${slice_glob})
-    else()
-      # expand the glob into a list of files
-      file(${glob_style} slices RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${slice_glob})
-      foreach(slice ${slices})
-        __astscf_component_add_one_slice(${COMPONENT} ${slice})
-      endforeach()
-    endif()
-  endforeach()
-  __astscf_set_cache_string(${COMPONENT}_SOURCES "${${COMPONENT}_SOURCES}" "" ADVANCED)
-endfunction()
+  if(NOT SLICE_COLLECTION_${COLLECTION})
+    message(FATAL_ERROR "Slice collection ${COLLECTION} has not been defined.")
+  endif()
 
-function(__astscf_component_add_one_slice COMPONENT SLICE)
   if(NOT SLICE_COMPILER)
     # Find the actual Slice compiler
     find_program(SLICE_COMPILER slice2cpp PATHS "${ICE_DIR}/bin"
@@ -545,18 +535,36 @@ function(__astscf_component_add_one_slice COMPONENT SLICE)
     else()
       message(FATAL_ERROR "Failed to find Slice compiler")
     endif()
-  endif()
 
-  if(MSVC_IDE)
-    # This makes the Slice definitions display in their own folder in the
-    # Visual Studio IDE
-    source_group("Slice Definitions" REGULAR_EXPRESSION "\\.ice$")
+    if(MSVC_IDE)
+      # This makes the Slice definitions display in their own folder in the
+      # Visual Studio IDE
+      source_group("Slice Definitions" REGULAR_EXPRESSION "\\.ice$")
+    endif()
   endif()
 
+  set(collection_dir "${SLICE_COLLECTION_${COLLECTION}}")
+  # default to glob syntax by default. not as useful as GLOB_RECURSE, but
+  # follows the principle of least surprise
+  set(glob_style GLOB)
+  foreach(slice_glob ${ARGN})
+    if(${slice_glob} STREQUAL GLOB OR ${slice_glob} STREQUAL GLOB_RECURSE)
+      # change our globbing style
+      set(glob_style ${slice_glob})
+    else()
+      # expand the glob into a list of files
+      file(${glob_style} slices RELATIVE "${collection_dir}" "${collection_dir}/${slice_glob}")
+      foreach(slice ${slices})
+        __astscf_component_add_one_slice(${COMPONENT} "${COLLECTION}" "${collection_dir}" "${slice}")
+      endforeach()
+    endif()
+  endforeach()
+  __astscf_set_cache_string(${COMPONENT}_SLICES "${${COMPONENT}_SLICES}" "" ADVANCED)
+endfunction()
+
+function(__astscf_component_add_one_slice COMPONENT COLLECTION COLLECTION_DIR SLICE)
   # Append the needed include directories for Slice definitions
   foreach(include ${SLICE_INCLUDE_DIRECTORIES})
-    # Each directory in this list will be in the source tree,
-    # which is what the Slice compiler will need
     list(APPEND slice_compiler_arguments "-I${include}")
   endforeach()
 
@@ -574,32 +582,30 @@ function(__astscf_component_add_one_slice COMPONENT SLICE)
     endforeach()
   endif()
 
-  message(STATUS "Adding ${SLICE} to ${COMPONENT}")
-  # get subdirectory slice is in
+  get_filename_component(slice_basename "${SLICE}" NAME_WE)
   get_filename_component(slice_subdir "${SLICE}" PATH)
 
-  # get the directory in which to put the generated code
-  set(slice_out_dir "${CMAKE_CURRENT_BINARY_DIR}/generated")
-  # if the slice file is in a subdirectory, maintain that structure
-  if(slice_subdir AND NOT ${slice_subdir} MATCHES "\\.\\.")
-    set(slice_out_dir "${slice_out_dir}/${slice_subdir}")
-  endif()
-  get_filename_component(slice_basename "${SLICE}" NAME_WE)
-  # headers are generated, so add them to the include path
-  # since we can't control them, treat them as system includes
-  include_directories(SYSTEM "${CMAKE_CURRENT_BINARY_DIR}/generated")
-  # generated .cpp files #include <.h> directly, which requires the out_dir
-  # itself to be in the include path
-  include_directories(SYSTEM "${slice_out_dir}")
-
-  # fully specify SLICE's path
-  set(SLICE "${CMAKE_CURRENT_SOURCE_DIR}/${SLICE}")
-
-  # Look for the dependencies for this Slice definition, we have to do it now
-  # since the target was just added
+  message(STATUS "Adding ${SLICE} from collection ${COLLECTION} to ${COMPONENT}")
+  # compute the directory in which to put the generated code and header files
+  set(slice_out_collection_dir "${CMAKE_CURRENT_BINARY_DIR}/slice-${COLLECTION}")
+  if(slice_subdir)
+    set(slice_out_file_dir "${slice_out_collection_dir}/${slice_subdir}")
+  else()
+    set(slice_out_file_dir "${slice_out_collection_dir}")
+  endif()
+  # header files that refer to the one generated from this Slice file
+  # will try to find it from the base of the collection, so add that
+  # directory to the include path
+  include_directories(SYSTEM "${slice_out_collection_dir}")
+  # the C++ source file generated from this Slice file will try to find
+  # the generated header in the same directory as the source, so add
+  # the file's immediate directory to the include path as well
+  include_directories(SYSTEM "${slice_out_file_dir}")
+
+  # Determine this Slice file's dependencies
   message(STATUS "Determining dependencies for ${slice_basename}")
   execute_process(
-    COMMAND ${SLICE_COMPILER} ${slice_compiler_arguments} --depend ${SLICE}
+    COMMAND ${SLICE_COMPILER} ${slice_compiler_arguments} --depend ${COLLECTION_DIR}/${SLICE}
     OUTPUT_VARIABLE raw_dependencies
     ERROR_VARIABLE slice_errors)
   if(slice_errors)
@@ -639,11 +645,11 @@ function(__astscf_component_add_one_slice COMPONENT SLICE)
 
   # prepend the slice_out_dir to the targets
   foreach(target ${targets})
-    list(APPEND generated_files "${slice_out_dir}/${target}")
+    list(APPEND generated_files "${slice_out_file_dir}/${target}")
   endforeach()
   # you would think that would be enough, but slice2cpp doesn't generate a
   # dep for the .h file
-  list(APPEND generated_files "${slice_out_dir}/${slice_basename}.h")
+  list(APPEND generated_files "${slice_out_file_dir}/${slice_basename}.h")
   # and be resilient in case it does so in the future...
   list(REMOVE_DUPLICATES generated_files)
   set_source_files_properties(${generated_files} PROPERTIES GENERATED 1)
@@ -655,18 +661,17 @@ function(__astscf_component_add_one_slice COMPONENT SLICE)
     list(APPEND slice_compiler_arguments "--dll-export" "ASTSCF_DLL_EXPORT")
   endif()
 
-  file(MAKE_DIRECTORY ${slice_out_dir})
+  file(MAKE_DIRECTORY ${slice_out_file_dir})
   add_custom_command(
     OUTPUT ${generated_files}
-    COMMAND ${SLICE_COMPILER} ${slice_compiler_arguments} ${SLICE}
-    --output-dir ${slice_out_dir}
+    COMMAND ${SLICE_COMPILER} ${slice_compiler_arguments} ${COLLECTION_DIR}/${SLICE}
+    --output-dir ${slice_out_file_dir}
     COMMENT "slice2cpp translating ${SLICE}"
     DEPENDS ${sources} ${SLICE_COMPILER})
 
-  # the Slice and generated_files are sources for the component
-  set(file_list ${COMPONENT}_SOURCES ${SLICE} ${generated_files})
-  __astscf_ensure_abs_paths(file_list)
-  set(${COMPONENT}_SOURCES ${file_list} PARENT_SCOPE)
+  # the Slice and generated_files are now sources for the component
+  set(file_list ${${COMPONENT}_SLICES} ${COLLECTION_DIR}/${SLICE} ${generated_files})
+  set(${COMPONENT}_SLICES ${file_list} PARENT_SCOPE)
 endfunction()
 
 # Function which collects libraries needed by a component
@@ -698,7 +703,7 @@ function(astscf_component_build_icebox COMPONENT)
   __astscf_component_libraries(${COMPONENT})
 
   # Now we actually create the shared module
-  add_library(${COMPONENT} MODULE ${${COMPONENT}_SOURCES})
+  add_library(${COMPONENT} MODULE ${${COMPONENT}_SLICES} ${${COMPONENT}_SOURCES})
   # Link required libraries
   target_link_libraries(${COMPONENT} ${component_libs})
 endfunction()
@@ -713,7 +718,7 @@ function(astscf_component_build_standalone COMPONENT)
   __astscf_component_libraries(${COMPONENT})
 
   # Now we actually create the component
-  add_executable(${COMPONENT} ${${COMPONENT}_SOURCES})
+  add_executable(${COMPONENT} ${${COMPONENT}_SLICES} ${${COMPONENT}_SOURCES})
   # Link required libraries
   target_link_libraries(${COMPONENT} ${component_libs})
 endfunction()
@@ -731,7 +736,7 @@ function(astscf_component_build_library COMPONENT)
   __astscf_component_libraries(${COMPONENT})
 
   # Now we actually create the component
-  add_library(${COMPONENT} ${${COMPONENT}_LIBTYPE} ${${COMPONENT}_SOURCES})
+  add_library(${COMPONENT} ${${COMPONENT}_LIBTYPE} ${${COMPONENT}_SLICES} ${${COMPONENT}_SOURCES})
   # Link required libraries
   target_link_libraries(${COMPONENT} ${component_libs})
 endfunction()

commit c9f4ffc9a7c90dbae4fbd4ff0ba81bd3c14317d9
Author: Kevin P. Fleming <kpfleming at digium.com>
Date:   Fri Jun 3 17:18:34 2011 -0500

    Ensure that all source file paths for a component are absolute.
    
    Slice file paths, and paths to files generated by the Slice translator,
    should be absolute and unique within the list of sources for a component.

diff --git a/AsteriskSCF.cmake b/AsteriskSCF.cmake
index 190be3e..cae209a 100644
--- a/AsteriskSCF.cmake
+++ b/AsteriskSCF.cmake
@@ -523,9 +523,7 @@ function(astscf_component_add_slice COMPONENT)
       set(glob_style ${slice_glob})
     else()
       # expand the glob into a list of files
-      file(${glob_style} slices RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
-        ${slice_glob})
-
+      file(${glob_style} slices RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${slice_glob})
       foreach(slice ${slices})
         __astscf_component_add_one_slice(${COMPONENT} ${slice})
       endforeach()
@@ -666,8 +664,9 @@ function(__astscf_component_add_one_slice COMPONENT SLICE)
     DEPENDS ${sources} ${SLICE_COMPILER})
 
   # the Slice and generated_files are sources for the component
-  list(APPEND ${COMPONENT}_SOURCES ${SLICE} ${generated_files})
-  set(${COMPONENT}_SOURCES ${${COMPONENT}_SOURCES} PARENT_SCOPE)
+  set(file_list ${COMPONENT}_SOURCES ${SLICE} ${generated_files})
+  __astscf_ensure_abs_paths(file_list)
+  set(${COMPONENT}_SOURCES ${file_list} PARENT_SCOPE)
 endfunction()
 
 # Function which collects libraries needed by a component

commit 4f089f19b7fa0573a284b9f3efb2b0216173d27b
Author: Kevin P. Fleming <kpfleming at digium.com>
Date:   Fri Jun 3 17:03:49 2011 -0500

    Ensure absolute paths are used in various places.
    
    * Make __astscf_ensure_abs_paths() use REALPATH instead of ABSOLUTE, so that
      paths which contain symlinks (including '..') are resolved to the simplest
      possible path.
    * Use __astscf_ensure_abs_paths() in astscf_component_add_file() to ensure
      that source file paths are stored in absolute form.

diff --git a/AsteriskSCF.cmake b/AsteriskSCF.cmake
index c1c1f3e..190be3e 100644
--- a/AsteriskSCF.cmake
+++ b/AsteriskSCF.cmake
@@ -398,7 +398,7 @@ endfunction()
 macro(__astscf_ensure_abs_paths pathlist)
   unset(eap_temp)
   foreach(p ${${pathlist}})
-    get_filename_component(newpath "${p}" ABSOLUTE)
+    get_filename_component(newpath "${p}" REALPATH)
     list(APPEND eap_temp "${newpath}")
   endforeach()
   list(REMOVE_DUPLICATES eap_temp)
@@ -409,11 +409,10 @@ endmacro()
 # Slice files in the current directory and below
 function(astscf_slice_include_directories)
   set(paths ${ARGN})
-  __astscf_ensure_abs_paths(paths)
... 30940 lines suppressed ...


-- 
asterisk-scf/integration/cmake.git



More information about the asterisk-scf-commits mailing list