[asterisk-scf-commits] asterisk-scf/integration/ice-util-cpp.git branch "disintegrated-build" created.

Commits to the Asterisk SCF project code repositories asterisk-scf-commits at lists.digium.com
Thu Jun 16 17:23:16 CDT 2011


branch "disintegrated-build" has been created
        at  0b138f0f33218ec1a27aec5a6fa97546730bee9a (commit)

- Log -----------------------------------------------------------------
commit 0b138f0f33218ec1a27aec5a6fa97546730bee9a
Merge: 10ecba0 0f67d36
Author: Kevin P. Fleming <kpfleming at digium.com>
Date:   Thu Jun 16 17:16:42 2011 -0500

    Merge branch 'disintegrated-build' of git://git.asterisk.org/team/kpfleming/wip-cmake into disintegrated-build

diff --cc cmake/modules/cmake_uninstall.cmake.in
index 0000000,9b093d4..9b093d4
mode 000000,100644..100644
--- a/cmake/modules/cmake_uninstall.cmake.in
+++ b/cmake/modules/cmake_uninstall.cmake.in

commit 0f67d364f49cfb4e0c8351a37de7035ca1cb84e5
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 10ecba071fe484b74fcc20463151555f7d25306f
Author: Kevin P. Fleming <kpfleming at digium.com>
Date:   Wed Jun 15 16:54:34 2011 -0500

    Add 'astscf' prefix to library name.
    
    In order to ensure that Asterisk SCF libraries do not conflict with others
    when installed, each library should have an 'astscf' prefix.

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 56c7240..accf48d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,6 +1,6 @@
-astscf_project(ice-util-cpp 3.4)
+astscf_project(astscf-ice-util-cpp 3.4)
 
-set(ice-util-cpp_dir ${CMAKE_CURRENT_SOURCE_DIR} PARENT_SCOPE)
+set(astscf-ice-util-cpp_dir ${CMAKE_CURRENT_SOURCE_DIR} PARENT_SCOPE)
 
 include_directories(include)
 include_directories(${logger_dir}/include)
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 44cfc4b..082821e 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -1,12 +1,12 @@
-astscf_component_init(ice-util-cpp)
+astscf_component_init(astscf-ice-util-cpp)
 file(GLOB_RECURSE project_headers ../include/*.h)
-astscf_component_add_files(ice-util-cpp ${project_headers})
+astscf_component_add_files(astscf-ice-util-cpp ${project_headers})
 add_subdirectory(CollocatedIceStorm)
 add_subdirectory(WorkQueue)
 add_subdirectory(ThreadPool)
-astscf_component_add_ice_libraries(ice-util-cpp IceStorm IceBox)
-astscf_component_add_boost_libraries(ice-util-cpp core thread date_time)
-astscf_component_add_slice_collection_libraries(ice-util-cpp ASTSCF)
-astscf_component_build_library(ice-util-cpp)
-target_link_libraries(ice-util-cpp logging-client)
-astscf_component_install(ice-util-cpp)
+astscf_component_add_ice_libraries(astscf-ice-util-cpp IceStorm IceBox)
+astscf_component_add_boost_libraries(astscf-ice-util-cpp core thread date_time)
+astscf_component_add_slice_collection_libraries(astscf-ice-util-cpp ASTSCF)
+astscf_component_build_library(astscf-ice-util-cpp)
+target_link_libraries(astscf-ice-util-cpp logging-client)
+astscf_component_install(astscf-ice-util-cpp)
diff --git a/src/CollocatedIceStorm/CMakeLists.txt b/src/CollocatedIceStorm/CMakeLists.txt
index 7faa392..668f756 100644
--- a/src/CollocatedIceStorm/CMakeLists.txt
+++ b/src/CollocatedIceStorm/CMakeLists.txt
@@ -1 +1 @@
-astscf_component_add_files(ice-util-cpp CollocatedIceStorm.cpp)
+astscf_component_add_files(astscf-ice-util-cpp CollocatedIceStorm.cpp)
diff --git a/src/ThreadPool/CMakeLists.txt b/src/ThreadPool/CMakeLists.txt
index e8fdad5..f16403e 100644
--- a/src/ThreadPool/CMakeLists.txt
+++ b/src/ThreadPool/CMakeLists.txt
@@ -1,2 +1,2 @@
-astscf_component_add_files(ice-util-cpp ThreadPool.cpp)
-astscf_component_add_files(ice-util-cpp WorkerThread.cpp)
+astscf_component_add_files(astscf-ice-util-cpp ThreadPool.cpp)
+astscf_component_add_files(astscf-ice-util-cpp WorkerThread.cpp)
diff --git a/src/WorkQueue/CMakeLists.txt b/src/WorkQueue/CMakeLists.txt
index 70fbe2c..a016def 100644
--- a/src/WorkQueue/CMakeLists.txt
+++ b/src/WorkQueue/CMakeLists.txt
@@ -1,3 +1,3 @@
-astscf_component_add_files(ice-util-cpp WorkQueue.cpp)
-astscf_component_add_files(ice-util-cpp SuspendableWorkQueue.cpp)
-astscf_component_add_files(ice-util-cpp DefaultQueueListener.cpp)
+astscf_component_add_files(astscf-ice-util-cpp WorkQueue.cpp)
+astscf_component_add_files(astscf-ice-util-cpp SuspendableWorkQueue.cpp)
+astscf_component_add_files(astscf-ice-util-cpp DefaultQueueListener.cpp)
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index d4784bc..ef44216 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -1,18 +1,18 @@
-astscf_component_init(ice-util-cpp-test)
+astscf_component_init(astscf-ice-util-cpp-test)
 astscf_slice_collection(LOCAL PATH .)
-astscf_component_add_slices(ice-util-cpp-test LOCAL ProxyHelper/SimpleIf.ice)
-astscf_component_add_files(ice-util-cpp-test LocatorRegistration/LocatorRegistrationTest.cpp)
-astscf_component_add_files(ice-util-cpp-test LocatorRegistration/LocatorRegistrationTest.h)
-astscf_component_add_files(ice-util-cpp-test PropertyHelper/PropertyHelperTest.cpp)
-astscf_component_add_files(ice-util-cpp-test PropertyHelper/PropertyHelperTest.h)
-astscf_component_add_files(ice-util-cpp-test ProxyHelper/ProxyHelperTests.cpp)
-astscf_component_add_files(ice-util-cpp-test ProxyHelper/ProxyHelperTests.h)
-astscf_component_add_files(ice-util-cpp-test UtilityTests.cpp)
-astscf_component_add_ice_libraries(ice-util-cpp-test IceBox)
-astscf_component_add_boost_libraries(ice-util-cpp-test unit_test_framework date_time thread)
-astscf_component_add_slice_collection_libraries(ice-util-cpp-test ASTSCF)
-astscf_component_build_icebox(ice-util-cpp-test)
-astscf_test_icebox(ice-util-cpp-test IceUtilCppTests.conf)
+astscf_component_add_slices(astscf-ice-util-cpp-test LOCAL ProxyHelper/SimpleIf.ice)
+astscf_component_add_files(astscf-ice-util-cpp-test LocatorRegistration/LocatorRegistrationTest.cpp)
+astscf_component_add_files(astscf-ice-util-cpp-test LocatorRegistration/LocatorRegistrationTest.h)
+astscf_component_add_files(astscf-ice-util-cpp-test PropertyHelper/PropertyHelperTest.cpp)
+astscf_component_add_files(astscf-ice-util-cpp-test PropertyHelper/PropertyHelperTest.h)
+astscf_component_add_files(astscf-ice-util-cpp-test ProxyHelper/ProxyHelperTests.cpp)
+astscf_component_add_files(astscf-ice-util-cpp-test ProxyHelper/ProxyHelperTests.h)
+astscf_component_add_files(astscf-ice-util-cpp-test UtilityTests.cpp)
+astscf_component_add_ice_libraries(astscf-ice-util-cpp-test IceBox)
+astscf_component_add_boost_libraries(astscf-ice-util-cpp-test unit_test_framework date_time thread)
+astscf_component_add_slice_collection_libraries(astscf-ice-util-cpp-test ASTSCF)
+astscf_component_build_icebox(astscf-ice-util-cpp-test)
+astscf_test_icebox(astscf-ice-util-cpp-test IceUtilCppTests.conf)
 
 add_subdirectory(Async)
 add_subdirectory(Replication)
diff --git a/test/ThreadPool/CMakeLists.txt b/test/ThreadPool/CMakeLists.txt
index e20835b..949333e 100644
--- a/test/ThreadPool/CMakeLists.txt
+++ b/test/ThreadPool/CMakeLists.txt
@@ -4,5 +4,5 @@ astscf_component_add_files(ThreadPoolTest test.cpp)
 astscf_component_add_boost_libraries(ThreadPoolTest unit_test_framework)
 astscf_component_add_slice_collection_libraries(ThreadPoolTest ASTSCF)
 astscf_component_build_standalone(ThreadPoolTest)
-target_link_libraries(ThreadPoolTest ice-util-cpp)
+target_link_libraries(ThreadPoolTest astscf-ice-util-cpp)
 astscf_test_boost(ThreadPoolTest)
diff --git a/test/WorkQueue/CMakeLists.txt b/test/WorkQueue/CMakeLists.txt
index 5b37d9f..9a7abb5 100644
--- a/test/WorkQueue/CMakeLists.txt
+++ b/test/WorkQueue/CMakeLists.txt
@@ -4,7 +4,7 @@ astscf_component_add_files(WorkQueueTest test.cpp)
 astscf_component_add_boost_libraries(WorkQueueTest unit_test_framework)
 astscf_component_add_slice_collection_libraries(WorkQueueTest ASTSCF)
 astscf_component_build_standalone(WorkQueueTest)
-target_link_libraries(WorkQueueTest ice-util-cpp)
+target_link_libraries(WorkQueueTest astscf-ice-util-cpp)
 astscf_test_boost(WorkQueueTest)
 
 astscf_component_init(SuspendableWorkQueueTest)
@@ -13,5 +13,5 @@ astscf_component_add_files(SuspendableWorkQueueTest test2.cpp)
 astscf_component_add_boost_libraries(SuspendableWorkQueueTest unit_test_framework thread)
 astscf_component_add_slice_collection_libraries(SuspendableWorkQueueTest ASTSCF)
 astscf_component_build_standalone(SuspendableWorkQueueTest)
-target_link_libraries(SuspendableWorkQueueTest ice-util-cpp)
+target_link_libraries(SuspendableWorkQueueTest astscf-ice-util-cpp)
 astscf_test_boost(SuspendableWorkQueueTest)

commit 511a822b3c569cb07c5f5f0712c925f9890c0e5d
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 1a08a1b3160492d844621bc176099953fc8b095a
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 dd47b0f4d2ffc34b0320708f73d74dde031a1bbe
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 adde8c770fe040ac6da87dd2f183a0ec2088db02
Author: Kevin P. Fleming <kpfleming at digium.com>
Date:   Tue Jun 14 17:24:31 2011 -0500

    Use Slice collections support in AsteriskSCF.cmake.

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 97f4a13..56c7240 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -3,7 +3,6 @@ astscf_project(ice-util-cpp 3.4)
 set(ice-util-cpp_dir ${CMAKE_CURRENT_SOURCE_DIR} PARENT_SCOPE)
 
 include_directories(include)
-include_directories(${API_INCLUDE_DIR})
 include_directories(${logger_dir}/include)
 
 add_subdirectory(src)
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 52679ea..44cfc4b 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -6,7 +6,7 @@ add_subdirectory(WorkQueue)
 add_subdirectory(ThreadPool)
 astscf_component_add_ice_libraries(ice-util-cpp IceStorm IceBox)
 astscf_component_add_boost_libraries(ice-util-cpp core thread date_time)
+astscf_component_add_slice_collection_libraries(ice-util-cpp ASTSCF)
 astscf_component_build_library(ice-util-cpp)
 target_link_libraries(ice-util-cpp logging-client)
-target_link_libraries(ice-util-cpp astscf-api)
 astscf_component_install(ice-util-cpp)
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index 1a9c251..d4784bc 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -1,6 +1,6 @@
 astscf_component_init(ice-util-cpp-test)
-astscf_slice_collection(local .)
-astscf_component_add_slices(ice-util-cpp-test local ProxyHelper/SimpleIf.ice)
+astscf_slice_collection(LOCAL PATH .)
+astscf_component_add_slices(ice-util-cpp-test LOCAL ProxyHelper/SimpleIf.ice)
 astscf_component_add_files(ice-util-cpp-test LocatorRegistration/LocatorRegistrationTest.cpp)
 astscf_component_add_files(ice-util-cpp-test LocatorRegistration/LocatorRegistrationTest.h)
 astscf_component_add_files(ice-util-cpp-test PropertyHelper/PropertyHelperTest.cpp)
@@ -10,8 +10,8 @@ astscf_component_add_files(ice-util-cpp-test ProxyHelper/ProxyHelperTests.h)
 astscf_component_add_files(ice-util-cpp-test UtilityTests.cpp)
 astscf_component_add_ice_libraries(ice-util-cpp-test IceBox)
 astscf_component_add_boost_libraries(ice-util-cpp-test unit_test_framework date_time thread)
+astscf_component_add_slice_collection_libraries(ice-util-cpp-test ASTSCF)
 astscf_component_build_icebox(ice-util-cpp-test)
-target_link_libraries(ice-util-cpp-test astscf-api)
 astscf_test_icebox(ice-util-cpp-test IceUtilCppTests.conf)
 
 add_subdirectory(Async)
diff --git a/test/Replication/CMakeLists.txt b/test/Replication/CMakeLists.txt
index 5eefb35..62758f2 100644
--- a/test/Replication/CMakeLists.txt
+++ b/test/Replication/CMakeLists.txt
@@ -1,9 +1,9 @@
 astscf_component_init(StateReplicatorTest)
-astscf_slice_collection(local slice)
+astscf_slice_collection(LOCAL PATH slice)
 astscf_component_add_files(StateReplicatorTest TestStateReplicator.cpp)
 astscf_component_add_files(StateReplicatorTest SharedTestData.h)
 astscf_component_add_files(StateReplicatorTest MockStateReplicatorListener.h)
-astscf_component_add_slices(StateReplicatorTest local StateReplicatorTestIf.ice)
+astscf_component_add_slices(StateReplicatorTest LOCAL StateReplicatorTestIf.ice)
 astscf_component_add_boost_libraries(StateReplicatorTest unit_test_framework thread date_time)
 astscf_component_build_standalone(StateReplicatorTest)
 astscf_test_boost(StateReplicatorTest)
diff --git a/test/ThreadPool/CMakeLists.txt b/test/ThreadPool/CMakeLists.txt
index eb02604..e20835b 100644
--- a/test/ThreadPool/CMakeLists.txt
+++ b/test/ThreadPool/CMakeLists.txt
@@ -2,7 +2,7 @@ astscf_component_init(ThreadPoolTest)
 astscf_component_add_files(ThreadPoolTest TestThreadPool.cpp)
 astscf_component_add_files(ThreadPoolTest test.cpp)
 astscf_component_add_boost_libraries(ThreadPoolTest unit_test_framework)
+astscf_component_add_slice_collection_libraries(ThreadPoolTest ASTSCF)
 astscf_component_build_standalone(ThreadPoolTest)
-target_link_libraries(ThreadPoolTest astscf-api)
 target_link_libraries(ThreadPoolTest ice-util-cpp)
 astscf_test_boost(ThreadPoolTest)
diff --git a/test/WorkQueue/CMakeLists.txt b/test/WorkQueue/CMakeLists.txt
index 9585e85..5b37d9f 100644
--- a/test/WorkQueue/CMakeLists.txt
+++ b/test/WorkQueue/CMakeLists.txt
@@ -2,8 +2,8 @@ astscf_component_init(WorkQueueTest)
 astscf_component_add_files(WorkQueueTest TestWorkQueue.cpp)
 astscf_component_add_files(WorkQueueTest test.cpp)
 astscf_component_add_boost_libraries(WorkQueueTest unit_test_framework)
+astscf_component_add_slice_collection_libraries(WorkQueueTest ASTSCF)
 astscf_component_build_standalone(WorkQueueTest)
-target_link_libraries(WorkQueueTest astscf-api)
 target_link_libraries(WorkQueueTest ice-util-cpp)
 astscf_test_boost(WorkQueueTest)
 
@@ -11,7 +11,7 @@ astscf_component_init(SuspendableWorkQueueTest)
 astscf_component_add_files(SuspendableWorkQueueTest TestSuspendableWorkQueue.cpp)
 astscf_component_add_files(SuspendableWorkQueueTest test2.cpp)
 astscf_component_add_boost_libraries(SuspendableWorkQueueTest unit_test_framework thread)
+astscf_component_add_slice_collection_libraries(SuspendableWorkQueueTest ASTSCF)
 astscf_component_build_standalone(SuspendableWorkQueueTest)
-target_link_libraries(SuspendableWorkQueueTest astscf-api)
 target_link_libraries(SuspendableWorkQueueTest ice-util-cpp)
 astscf_test_boost(SuspendableWorkQueueTest)

commit 59f28cd006a442312375e2366a22e90730bafac9
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 895cd13..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
@@ -339,6 +334,7 @@ function(astscf_project NAME ICE_VERSION)
       list(APPEND cxx_flags "${CMAKE_THREAD_LIBS_INIT}")
     else()
       list(APPEND linker_flags "${CMAKE_THREAD_LIBS_INIT}")
+    endif()
   endif()
 
   # If C++0x support is requested, use a compiler check to see if it is available
@@ -426,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}")
@@ -502,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
@@ -528,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")
@@ -570,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})
@@ -619,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
@@ -686,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
@@ -704,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()
 
@@ -716,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
@@ -731,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
@@ -749,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 3c5bc4cc404a86074860741767ea394556240183
Merge: 2997fd6 8cfea72
Author: Kevin P. Fleming <kpfleming at digium.com>
Date:   Mon Jun 13 15:58:03 2011 -0500

    Merge branch 'master' into disintegrated-build
    
    Conflicts:
    	AsteriskSCF.cmake

diff --cc AsteriskSCF.cmake
index eff7fc8,d039634..895cd13
--- a/AsteriskSCF.cmake
+++ b/AsteriskSCF.cmake
@@@ -264,146 -276,172 +270,150 @@@ macro(__astscf_compute_test_paths
  endmacro()
  
  # Function which initializes project specific things
 -function(asterisk_scf_project NAME ICE_VERSION)
 -    if(ASTERISK_SCF_MASTER_PROJECT)
 -       # this is a sub-project, so just record the name and
 -       # move on
 -       set(ASTERISK_SCF_PROJECT "${NAME}" PARENT_SCOPE)
 -       set(ASTERISK_SCF_PROJECT_DIR "${CMAKE_CURRENT_SOURCE_DIR}" PARENT_SCOPE)
 -       return()
 -    else()
 -       set(ASTERISK_SCF_PROJECT "MASTER" PARENT_SCOPE)
 -       set(ASTERISK_SCF_MASTER_PROJECT true PARENT_SCOPE)
 +function(astscf_project NAME ICE_VERSION)
 +  if(ASTSCF_MASTER_PROJECT)
 +    # this is a sub-project, so just record the name and
 +    # 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)
 +    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)
 -
 -    set(CMAKE_INCLUDE_CURRENT_DIR true)
 +  message(STATUS "Setting up project ${NAME} for Ice version ${ICE_VERSION}")
  
 -    # On Windows, IceBox C++ services must be compiled with some symbols exported;
 -    # the source code should use ASTERISK_SCF_ICEBOX_EXPORT to accomplish this, and this
 -    if(WIN32)
 -        message(STATUS "Setting ASTERISK_SCF_ICEBOX_EXPORT definition for Windows IceBox services")
 -        add_definitions(-DASTERISK_SCF_ICEBOX_EXPORT=__declspec\(dllexport\))
 -    else()
 -        add_definitions(-DASTERISK_SCF_ICEBOX_EXPORT=)
 -    endif()
 +  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)
  
 -    # On Windows, 'debug' libraries should have a "d" suffix to indicate that they
 -    # are debug libraries
 -    if(WIN32)
 -        set_cache_var(CMAKE_DEBUG_POSTFIX "d")
 -    endif()
 +  set(CMAKE_INCLUDE_CURRENT_DIR true)
  
 -    message(STATUS "Performing requirement checks for components")
 -    # set(Ice_DEBUG on)
 -    find_package(Ice 3.4 REQUIRED Ice IceUtil)
 -
 -    # All components need the Ice library, and it needs the
 -    # IceUtil library (as do most components), so link
 -    # every component against those libraries at minimum
 -    set(ASTERISK_SCF_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}")
 -
 -    message(STATUS "Using Ice Slice files from: ${ICE_SLICE_DIR}")
 -    # We can't use asterisk_scf_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)
 -
 -    # threading support required
 -    find_package(Threads REQUIRED)
 -    if(CMAKE_THREAD_LIBS_INIT)
 -        if(NOT CMAKE_HAVE_THREADS_LIBRARY)
 -            list(APPEND c_flags "${CMAKE_THREAD_LIBS_INIT}")
 -            list(APPEND cxx_flags "${CMAKE_THREAD_LIBS_INIT}")
 -        else()
 -	    list(APPEND linker_flags "${CMAKE_THREAD_LIBS_INIT}")
 -        endif()
 -    endif()
 +  # On Windows, IceBox C++ services and some other types of libraries  must be compiled
 +  # with some symbols exported; the source code should use ASTSCF_DLL_EXPORT to accomplish this
 +  if(WIN32)
 +    message(STATUS "Setting ASTSCF_DLL_EXPORT definition for Windows libraries")
 +    add_definitions(-DASTSCF_DLL_EXPORT=__declspec\(dllexport\))
 +  else()
 +    add_definitions(-DASTSCF_DLL_EXPORT=)
 +  endif()
  
 -    # If C++0x support is requested, use a compiler check to see if it is available
 -    # C++0x was on by default, but we disabled it due to problems with
 -    # Ubuntu 11.04.
 -    # See http://bugs.launchpad.net/ubuntu/+source/boost1.42/+bug/776860
 -    if(ENABLE_CPP0X)
 -        if(CMAKE_COMPILER_IS_GNUCXX)
 -            include(CheckCXXCompilerFlag)
 -            CHECK_CXX_COMPILER_FLAG(-std=c++0x HAVE_STD_CPP0X)
 -            if(HAVE_STD_CPP0X)
 -                add_definitions("-DCPP_ZEROX_SUPPORT")
 -                list(APPEND cxx_flags "-std=c++0x")
 -                message(STATUS "Support for C++0x Enabled")
 -            else()
 -                message(FATAL_ERROR "Compiler does not support C++0x")
 -            endif()
 -        endif()
 -    endif()
 +  # 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")
 +  endif()
  
 -    if(CMAKE_COMPILER_IS_GNUC)
 -        list(APPEND c_flags_debug "-Wall" "-g3")
 -	list(APPEND c_flags_profile "-ftest-coverage" "-fprofile-arcs")
 -    endif()
 +  message(STATUS "Performing requirement checks for components")
 +  # set(Ice_DEBUG on)
 +  find_package(Ice 3.4 REQUIRED Ice IceUtil)
 +
 +  # All components need the Ice library, and it needs the
 +  # IceUtil library (as do most components), so link
 +  # 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)
 +  set(SLICE_INCLUDE_DIRECTORIES ${SLICE_INCLUDE_DIRECTORIES} PARENT_SCOPE)
 +
 +  # threading support required
 +  find_package(Threads REQUIRED)
 +  if(CMAKE_THREAD_LIBS_INIT)
 +    if(NOT CMAKE_HAVE_THREADS_LIBRARY)
 +      list(APPEND c_flags "${CMAKE_THREAD_LIBS_INIT}")
 +      list(APPEND cxx_flags "${CMAKE_THREAD_LIBS_INIT}")
 +    else()
 +      list(APPEND linker_flags "${CMAKE_THREAD_LIBS_INIT}")
-     endif()
 +  endif()
  
-   # Use a compiler test for GCC to see if C++0x is supported; enable it if found.
-   if(CMAKE_COMPILER_IS_GNUCXX)
-     include(CheckCXXCompilerFlag)
-     CHECK_CXX_COMPILER_FLAG(-std=c++0x HAVE_STD_CPP0X)
-     if(HAVE_STD_CPP0X)
-       add_definitions("-DCPP_ZEROX_SUPPORT")
-       list(APPEND cxx_flags "-std=c++0x")
-       message(STATUS "Support for C++0x Enabled")
-     else()
-       message(STATUS "Support for C++0x Disabled")
++  # If C++0x support is requested, use a compiler check to see if it is available
++  # C++0x was on by default, but we disabled it due to problems with
++  # Ubuntu 11.04.
++  # See http://bugs.launchpad.net/ubuntu/+source/boost1.42/+bug/776860
++  if(ENABLE_CPP0X)
+     if(CMAKE_COMPILER_IS_GNUCXX)
 -        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")
 -	include(CheckCXXCompilerFlag)
 -	CHECK_CXX_COMPILER_FLAG(-Wlogical-op HAVE_W_LOGICAL_OP)
 -	if(HAVE_W_LOGICAL_OP)
 -	  list(APPEND cxx_flags_debug "-Wlogical-op")
 -	endif()
 -	list(APPEND cxx_flags_debug "-Werror")
 -	list(APPEND cxx_flags_profile "-ftest-coverage" "-fprofile-arcs")
 -    endif()
 -
 -    if(CMAKE_SYSTEM MATCHES "SunOS.*")
 -        list(APPEND cxx_flags "-pthreads")
++      include(CheckCXXCompilerFlag)
++      CHECK_CXX_COMPILER_FLAG(-std=c++0x HAVE_STD_CPP0X)
++      if(HAVE_STD_CPP0X)
++        add_definitions("-DCPP_ZEROX_SUPPORT")
++        list(APPEND cxx_flags "-std=c++0x")
++        message(STATUS "Support for C++0x Enabled")
++      else()
++        message(FATAL_ERROR "Compiler does not support C++0x")
++      endif()
      endif()
 +  endif()
  
 -    append_to_var(CMAKE_C_FLAGS ${c_flags})
 -    append_to_var(CMAKE_C_FLAGS_DEBUG ${c_flags_debug})
 -    append_to_var(CMAKE_C_FLAGS_PROFILE ${c_flags_profile} ${c_flags_debug})
 +  if(CMAKE_COMPILER_IS_GNUC)
 +    list(APPEND c_flags_debug "-Wall" "-g3")
 +    list(APPEND c_flags_profile "-ftest-coverage" "-fprofile-arcs")
 +  endif()
  
 -    append_to_var(CMAKE_CXX_FLAGS ${cxx_flags})
 -    append_to_var(CMAKE_CXX_FLAGS_DEBUG ${cxx_flags_debug})
 -    append_to_var(CMAKE_CXX_FLAGS_PROFILE ${cxx_flags_profile} ${cxx_flags_debug})
 +  if(CMAKE_COMPILER_IS_GNUCXX)
 +    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)
 +      list(APPEND cxx_flags_debug "-Wlogical-op")
 +    endif()
 +    list(APPEND cxx_flags_debug "-Werror")
 +    list(APPEND cxx_flags_profile "-ftest-coverage" "-fprofile-arcs")
 +  endif()
  
 -    append_to_var(CMAKE_EXE_LINKER_FLAGS ${linker_flags})
 -    append_to_var(CMAKE_MODULE_LINKER_FLAGS ${linker_flags})
 -    append_to_var(CMAKE_SHARED_LINKER_FLAGS ${linker_flags})
 +  if(CMAKE_SYSTEM MATCHES "SunOS.*")
 +    list(APPEND cxx_flags "-pthreads")
 +  endif()
  
 -    # Boost is required
 -    # Only specify those versions that are not "known" by default for
 -    # the oldest version of cmake supported.
 -    # 
 -    set(Boost_ADDITIONAL_VERSIONS "1.44" "1.44.0" "1.45" "1.45.0" "1.46" "1.46.0" "1.46.1")
 -    find_package(Boost ${MIN_BOOST_VERSION} REQUIRED)
 -    set(Boost_CORE_FOUND "bazinga" PARENT_SCOPE)
 -    set(Boost_CORE_FOUND "bazinga")
 +  __astscf_append_to_var(CMAKE_C_FLAGS ${c_flags})
 +  __astscf_append_to_var(CMAKE_C_FLAGS_DEBUG ${c_flags_debug})
 +  __astscf_append_to_var(CMAKE_C_FLAGS_PROFILE ${c_flags_profile} ${c_flags_debug})
  
 -    compute_test_paths()
 +  __astscf_append_to_var(CMAKE_CXX_FLAGS ${cxx_flags})
 +  __astscf_append_to_var(CMAKE_CXX_FLAGS_DEBUG ${cxx_flags_debug})
 +  __astscf_append_to_var(CMAKE_CXX_FLAGS_PROFILE ${cxx_flags_profile} ${cxx_flags_debug})
  
 -    message(STATUS "Passed requirement checks for CXX components")
 -endfunction()
 +  __astscf_append_to_var(CMAKE_EXE_LINKER_FLAGS ${linker_flags})
 +  __astscf_append_to_var(CMAKE_MODULE_LINKER_FLAGS ${linker_flags})
 +  __astscf_append_to_var(CMAKE_SHARED_LINKER_FLAGS ${linker_flags})
  
 -# Function which initializes a component for building
 -function(asterisk_scf_component_init COMPONENT)
 -    message(STATUS "Setting up to build component ${COMPONENT}")
 -    set(ASTERISK_SCF_${COMPONENT} Bob PARENT_SCOPE)
 -endfunction()
 +  # Boost is required
 +  # Only specify those versions that are not "known" by default for
 +  # the oldest version of CMake supported.
 +  # 
 +  set(Boost_ADDITIONAL_VERSIONS "1.44" "1.44.0" "1.45" "1.45.0" "1.46" "1.46.0" "1.46.1")
 +  find_package(Boost ${MIN_BOOST_VERSION} REQUIRED)
 +  set(Boost_CORE_FOUND "bazinga" PARENT_SCOPE)
 +  set(Boost_CORE_FOUND "bazinga")
 +  include_directories(SYSTEM ${Boost_INCLUDE_DIR})
 +  link_directories(${Boost_LIBRARY_DIRS})
  
 -# Find a Boost library.
 -function(find_Boost_library LIBRARY)
 -    string(TOUPPER ${LIBRARY} libtag)
 -    if(NOT Boost_${libtag}_FOUND)
 -        find_package(Boost REQUIRED ${LIBRARY})
 -    endif()
 -    if(NOT Boost_${libtag}_FOUND)
 -        message(FATAL_ERROR "Boost library ${LIBRARY} not found")
 -    endif()
 -endfunction()
 +  __astscf_compute_test_paths()
  
 -# Function which adds Boost libraries needed by a component
 -function(asterisk_scf_component_add_boost_libraries COMPONENT)
 -    if(NOT ARGN)
 -        message(FATAL_ERROR "You must pass at least one library to this function")
 -    endif()
 -    set(libs ${${COMPONENT}_BOOST_LIBRARIES})
 -    # By default we are disabling boost auto-linking and specifying dynamic linking.
 -    add_definitions(-DBOOST_ALL_NO_LIB -DBOOST_ALL_DYN_LINK)
 -    foreach(lib ${ARGN})
 -        find_Boost_library(${lib})
 -	string(TOUPPER "${lib}" lib)
 -        list(APPEND libs ${lib})
 -    endforeach()
 -    list(REMOVE_DUPLICATES libs)
 -    set(${COMPONENT}_BOOST_LIBRARIES ${libs} PARENT_SCOPE)
 -    include_directories(SYSTEM ${Boost_INCLUDE_DIR})
 -    link_directories(${Boost_LIBRARY_DIRS})
 +  message(STATUS "Passed requirement checks for CXX components")
  endfunction()
  
  # Ensures that a list of paths are all absolute paths.

commit 2997fd659feef09abd5026bbfc5ba953009cf266
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 4bdfcad..eff7fc8 100644
--- a/AsteriskSCF.cmake
+++ b/AsteriskSCF.cmake
@@ -358,6 +358,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 8cfea72afaa1a820910a25bcdfbe4bec3ed99c9d
Author: David M. Lee <dlee at digium.com>
Date:   Mon Jun 13 11:03:05 2011 -0500

    Removed cmake dep on pjproject's config_site.h
    
    This resolves a couple of issues.
    * make clean no longer trashes config_site.h
    * incremental builds no longer needlessly regenerate pjproject deps.

diff --git a/modules/pjproject.cmake b/modules/pjproject.cmake
index 5bd04f5..43a193b 100644
--- a/modules/pjproject.cmake
+++ b/modules/pjproject.cmake
@@ -29,24 +29,17 @@ if (CMAKE_SIZEOF_VOID_P MATCHES 8)
 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/include/pj/config_site.h" 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_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)
-  # Make sure that config_site.h exists.
-  # Only touch it if you have to to avoid triggering needless builds.
-  if(NOT EXISTS "${CMAKE_SOURCE_DIR}/pjproject/pjlib/include/pj/config_site.h")
-    message(STATUS "pjproject: Creating config_site.h")
-    file(WRITE "${CMAKE_SOURCE_DIR}/pjproject/pjlib/include/pj/config_site.h" "")
-  endif()
-
   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/include/pj/config_site.h")
+      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/include/pj/config_site.h")
+      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 965d3574c20c1d144407613a501a9b0016646508
Author: David M. Lee <dlee at digium.com>
Date:   Tue Jun 7 14:45:32 2011 -0500

    Disable compilation for C++0x by default.
    
    Added a CMake flag 'ENABLE_CPP0X' to optionally enable C++0x.

diff --git a/AsteriskSCF.cmake b/AsteriskSCF.cmake
index 0766521..d039634 100644
--- a/AsteriskSCF.cmake
+++ b/AsteriskSCF.cmake
@@ -33,6 +33,12 @@
 #
 
 #
+# CMake variables (can be defined using -D on the cmake command line)
+# * ENABLE_CPP0X - Enables C++0x features in the compiler.  Will error out if
+#                  compiler does not support C++0x.
+#
+
+#
 # Coding/style guidelines:
 #
 # * Variables local to a function should be named using lowercase.
@@ -336,16 +342,21 @@ function(asterisk_scf_project NAME ICE_VERSION)
         endif()
     endif()
 
-    # Use a compiler test for GCC to see if C++0x is supported; enable it if found.
-    if(CMAKE_COMPILER_IS_GNUCXX)
-	include(CheckCXXCompilerFlag)
-	CHECK_CXX_COMPILER_FLAG(-std=c++0x HAVE_STD_CPP0X)
-	if(HAVE_STD_CPP0X)
-          add_definitions("-DCPP_ZEROX_SUPPORT")
-	  list(APPEND cxx_flags "-std=c++0x")
-          message(STATUS "Support for C++0x Enabled")
-        else()
-          message(STATUS "Support for C++0x Disabled")
+    # If C++0x support is requested, use a compiler check to see if it is available
+    # C++0x was on by default, but we disabled it due to problems with
+    # Ubuntu 11.04.
+    # See http://bugs.launchpad.net/ubuntu/+source/boost1.42/+bug/776860
+    if(ENABLE_CPP0X)
+        if(CMAKE_COMPILER_IS_GNUCXX)
+            include(CheckCXXCompilerFlag)
+            CHECK_CXX_COMPILER_FLAG(-std=c++0x HAVE_STD_CPP0X)
+            if(HAVE_STD_CPP0X)
+                add_definitions("-DCPP_ZEROX_SUPPORT")
+                list(APPEND cxx_flags "-std=c++0x")
+                message(STATUS "Support for C++0x Enabled")
+            else()
+                message(FATAL_ERROR "Compiler does not support C++0x")
+            endif()
         endif()
     endif()
 

commit 57d18b7364c3b21cccba9b4943ed3548793fb222
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 ecd02c3..4bdfcad 100644
--- a/AsteriskSCF.cmake
+++ b/AsteriskSCF.cmake
@@ -183,6 +183,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 d5982f1b79d146f5c0b3947aa0acf93eb7be637f
Author: David M. Lee <dlee at digium.com>
Date:   Tue Jun 7 14:42:43 2011 -0500

    Removed old SharedPtr.cpp file.
    
    It has been replaced with a CHECK_CXX_COMPILER_FLAG call.

diff --git a/tests/SharedPtr.cpp b/tests/SharedPtr.cpp
deleted file mode 100644
index eb7339f..0000000
--- a/tests/SharedPtr.cpp
+++ /dev/null
@@ -1,7 +0,0 @@
-#include <memory>
-
-int main()
-{
-    std::shared_ptr<void> bob;
-    return 0;
-}

commit b2263b87ad918069db591ef5544727cbde1d3164
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 c09834b..ecd02c3 100644
--- a/AsteriskSCF.cmake
+++ b/AsteriskSCF.cmake
@@ -576,7 +576,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 d994093d01e604cecf2e1c7ccc0c65675a408d40
Author: Kevin P. Fleming <kpfleming at digium.com>
Date:   Mon Jun 6 18:50:27 2011 -0500

    Slice collections, and consistency of naming in various places.
    
    * Support Slice file 'collections'.
    
    * Make all Slice directories in repositories be called 'slice' and at the
      top level in the repository, so the automatic 'PROJECT' collection will
      be generated for them.
    
    * Build ice-util-cpp and util-cpp as single libraries.
    
    * Enable building and execution of ice-util-cpp top-level unit tests.

diff --git a/CMakeLists.txt b/CMakeLists.txt
index c710520..97f4a13 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -5,7 +5,6 @@ set(ice-util-cpp_dir ${CMAKE_CURRENT_SOURCE_DIR} PARENT_SCOPE)
 include_directories(include)
 include_directories(${API_INCLUDE_DIR})
 include_directories(${logger_dir}/include)
-astscf_slice_include_directories(${API_SLICE_DIR})
 
 add_subdirectory(src)
 if(BUILD_TESTING)
diff --git a/cmake/example/CMakeLists.txt b/cmake/example/CMakeLists.txt
index 3c7e71e..67f58c2 100644
--- a/cmake/example/CMakeLists.txt
+++ b/cmake/example/CMakeLists.txt
@@ -65,7 +65,7 @@ astscf_component_add_slice(examplebox fluxcapacitor.ice)
 
 # This function takes a component name and source file as parameters. The source file is added in so it gets
 # compiled into the component. This *must* be called from the same directory that the source file exists in.
-astscf_component_add_file(examplebox example.cpp)
+astscf_component_add_files(examplebox example.cpp)
 
 # This function takes a component name as the parameter. It builds an IceBox service that IceBox can load.
 astscf_component_build_icebox(examplebox)
@@ -85,7 +85,7 @@ astscf_component_install(examplebox LIBRARY lib "Icebox example component." Core
 # Now we move on to the next component, a standalone executable.
 astscf_component_init(example)
 astscf_component_add_slice(example fluxcapacitor.ice)
-astscf_component_add_file(example example.cpp)
+astscf_component_add_files(example example.cpp)
 
 # This function takes a component name as the parameter. It builds a standalone executable.
 astscf_component_build_standalone(example)
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 6b60669..52679ea 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -1,38 +1,12 @@
-# Ice Utilities for C++
-
 astscf_component_init(ice-util-cpp)
-astscf_component_add_file(ice-util-cpp ../include/AsteriskSCF/Discovery/SmartProxy.h)
-astscf_component_add_file(ice-util-cpp ../include/AsteriskSCF/Discovery/LocatorRegistrationWrapper.h)
-astscf_component_add_file(ice-util-cpp ../include/AsteriskSCF/Async/AmiCollector.h)
-astscf_component_add_file(ice-util-cpp ../include/AsteriskSCF/Async/ResponseCollector.h)
-astscf_component_add_file(ice-util-cpp ../include/AsteriskSCF/Helpers/PropertyHelper.h)
-astscf_component_add_file(ice-util-cpp ../include/AsteriskSCF/Helpers/ProxyHelper.h)
-astscf_component_add_file(ice-util-cpp ../include/AsteriskSCF/Helpers/Retry.h)
-astscf_component_add_file(ice-util-cpp ../include/AsteriskSCF/Listener/ListenerManager.h)
-astscf_component_add_file(ice-util-cpp ../include/AsteriskSCF/Replication/StateReplicator.h)
-astscf_component_add_file(ice-util-cpp ../include/AsteriskSCF/WorkQueue/WorkQueue.h)
-astscf_component_add_file(ice-util-cpp ../include/AsteriskSCF/WorkQueue/SuspendableWorkQueue.h)
-astscf_component_add_file(ice-util-cpp ../include/AsteriskSCF/WorkQueue/DefaultQueueListener.h)
-astscf_component_add_file(ice-util-cpp WorkQueue/WorkQueue.cpp)
-astscf_component_add_file(ice-util-cpp WorkQueue/SuspendableWorkQueue.cpp)
-astscf_component_add_file(ice-util-cpp WorkQueue/DefaultQueueListener.cpp)
-astscf_component_add_file(ice-util-cpp ../include/AsteriskSCF/ThreadPool/ThreadPool.h)
-astscf_component_add_file(ice-util-cpp ../include/AsteriskSCF/ThreadPool/WorkerThread.h)
-astscf_component_add_file(ice-util-cpp ThreadPool/ThreadPool.cpp)
-astscf_component_add_file(ice-util-cpp ThreadPool/WorkerThread.cpp)
-astscf_component_add_file(ice-util-cpp ../include/AsteriskSCF/CollocatedIceStorm/CollocatedIceStorm.h)
-astscf_component_add_file(ice-util-cpp CollocatedIceStorm/CollocatedIceStorm.cpp)
-#
-# Note, strictly speaking this isn't for component development, but as it is part of this
-# library it sort of belongs here.
-#
-astscf_component_add_file(ice-util-cpp ../include/AsteriskSCF/Testing/IceBoxBoostTest.h)
-astscf_component_add_file(ice-util-cpp IceUtilCpp.cpp)
-astscf_component_add_ice_libraries(ice-util-cpp IceStorm)
-astscf_component_add_ice_libraries(ice-util-cpp IceBox)
+file(GLOB_RECURSE project_headers ../include/*.h)
+astscf_component_add_files(ice-util-cpp ${project_headers})
+add_subdirectory(CollocatedIceStorm)
+add_subdirectory(WorkQueue)
+add_subdirectory(ThreadPool)
+astscf_component_add_ice_libraries(ice-util-cpp IceStorm IceBox)
 astscf_component_add_boost_libraries(ice-util-cpp core thread date_time)
 astscf_component_build_library(ice-util-cpp)
 target_link_libraries(ice-util-cpp logging-client)
-target_link_libraries(ice-util-cpp asterisk-scf-api)
+target_link_libraries(ice-util-cpp astscf-api)
 astscf_component_install(ice-util-cpp)
-
diff --git a/src/CollocatedIceStorm/CMakeLists.txt b/src/CollocatedIceStorm/CMakeLists.txt
new file mode 100644
index 0000000..7faa392
--- /dev/null
+++ b/src/CollocatedIceStorm/CMakeLists.txt
@@ -0,0 +1 @@
+astscf_component_add_files(ice-util-cpp CollocatedIceStorm.cpp)
diff --git a/src/IceUtilCpp.cpp b/src/IceUtilCpp.cpp
deleted file mode 100644
index d05edd5..0000000
--- a/src/IceUtilCpp.cpp
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * Asterisk SCF -- An open-source communications framework.
- *
- * Copyright (C) 2010, Digium, Inc.
- *
- * See http://www.asterisk.org for more information about
- * the Asterisk SCF project. Please do not directly contact
- * any of the maintainers of this project for assistance;
- * the project provides a web site, mailing lists and IRC
- * channels for your use.
- *
- * This program is free software, distributed under the terms of
- * the GNU General Public License Version 2. See the LICENSE.txt file
- * at the top of the source tree.
- */
-#include <Ice/Ice.h>
-#include <AsteriskSCF/Utilities.h>
-
-//
-// This .cpp is a temporary solution to get a CMakeProject that consists only of header files.
-//
diff --git a/src/ThreadPool/CMakeLists.txt b/src/ThreadPool/CMakeLists.txt
index 476e3dd..e8fdad5 100644
--- a/src/ThreadPool/CMakeLists.txt
+++ b/src/ThreadPool/CMakeLists.txt
@@ -1,10 +1,2 @@
-astscf_component_init(ThreadPool)
-astscf_component_add_file(ThreadPool ../include/AsteriskSCF/ThreadPool.h)
-astscf_component_add_file(ThreadPool ../include/AsteriskSCF/WorkerThread.h)
-astscf_component_add_file(ThreadPool ThreadPool.cpp)
-astscf_component_add_file(ThreadPool WorkerThread.cpp)
-astscf_component_add_boost_libraries(ThreadPool thread date_time)
-astscf_component_build_library(ThreadPool)
-target_link_libraries(ThreadPool WorkQueue)
-target_link_libraries(ThreadPool asterisk-scf-api)
-astscf_component_install(ThreadPool)
+astscf_component_add_files(ice-util-cpp ThreadPool.cpp)
+astscf_component_add_files(ice-util-cpp WorkerThread.cpp)
diff --git a/src/WorkQueue/CMakeLists.txt b/src/WorkQueue/CMakeLists.txt
index a80baa4..70fbe2c 100644
--- a/src/WorkQueue/CMakeLists.txt
+++ b/src/WorkQueue/CMakeLists.txt
@@ -1,11 +1,3 @@
-astscf_component_init(WorkQueue)
-astscf_component_add_file(WorkQueue ../include/AsteriskSCF/WorkQueue.h)
-astscf_component_add_file(WorkQueue ../include/AsteriskSCF/SuspendableWorkQueue.h)
-astscf_component_add_file(WorkQueue ../include/AsteriskSCF/DefaultQueueListener.h)
-astscf_component_add_file(WorkQueue WorkQueue.cpp)
-astscf_component_add_file(WorkQueue SuspendableWorkQueue.cpp)
-astscf_component_add_file(WorkQueue DefaultQueueListener.cpp)
-astscf_component_add_boost_libraries(WorkQueue thread date_time)
-astscf_component_build_library(WorkQueue)
-target_link_libraries(WorkQueue asterisk-scf-api)
-astscf_component_install(WorkQueue)
+astscf_component_add_files(ice-util-cpp WorkQueue.cpp)
+astscf_component_add_files(ice-util-cpp SuspendableWorkQueue.cpp)
+astscf_component_add_files(ice-util-cpp DefaultQueueListener.cpp)
diff --git a/test/Async/CMakeLists.txt b/test/Async/CMakeLists.txt
index d61ae7d..9367567 100644
--- a/test/Async/CMakeLists.txt
+++ b/test/Async/CMakeLists.txt
@@ -1,8 +1,8 @@
 astscf_component_init(ami-collector-test)
-astscf_component_add_file(ami-collector-test ResponseCollector-test.cpp)
-astscf_component_add_file(ami-collector-test IceIntegration-test.cpp)
-astscf_component_add_file(ami-collector-test TestAmiCollector.h)
-astscf_component_add_file(ami-collector-test test.cpp)
+astscf_component_add_files(ami-collector-test ResponseCollector-test.cpp)
+astscf_component_add_files(ami-collector-test IceIntegration-test.cpp)
+astscf_component_add_files(ami-collector-test TestAmiCollector.h)
+astscf_component_add_files(ami-collector-test test.cpp)
 astscf_component_add_boost_libraries(ami-collector-test unit_test_framework thread date_time)
 astscf_component_build_standalone(ami-collector-test)
 astscf_test_boost(ami-collector-test)
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index 084a866..1a9c251 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -1,16 +1,18 @@
 astscf_component_init(ice-util-cpp-test)
-astscf_component_add_slice(ice-util-cpp-test ProxyHelper/SimpleIf.ice)
-astscf_component_add_file(ice-util-cpp-test LocatorRegistration/LocatorRegistrationTest.cpp)
-astscf_component_add_file(ice-util-cpp-test LocatorRegistration/LocatorRegistrationTest.h)
-astscf_component_add_file(ice-util-cpp-test PropertyHelper/PropertyHelperTest.cpp)
-astscf_component_add_file(ice-util-cpp-test PropertyHelper/PropertyHelperTest.h)
-astscf_component_add_file(ice-util-cpp-test ProxyHelper/ProxyHelperTests.cpp)
-astscf_component_add_file(ice-util-cpp-test ProxyHelper/ProxyHelperTests.h)
-astscf_component_add_file(ice-util-cpp-test UtilityTests.cpp)
+astscf_slice_collection(local .)
+astscf_component_add_slices(ice-util-cpp-test local ProxyHelper/SimpleIf.ice)
+astscf_component_add_files(ice-util-cpp-test LocatorRegistration/LocatorRegistrationTest.cpp)
+astscf_component_add_files(ice-util-cpp-test LocatorRegistration/LocatorRegistrationTest.h)
+astscf_component_add_files(ice-util-cpp-test PropertyHelper/PropertyHelperTest.cpp)
+astscf_component_add_files(ice-util-cpp-test PropertyHelper/PropertyHelperTest.h)
+astscf_component_add_files(ice-util-cpp-test ProxyHelper/ProxyHelperTests.cpp)
+astscf_component_add_files(ice-util-cpp-test ProxyHelper/ProxyHelperTests.h)
+astscf_component_add_files(ice-util-cpp-test UtilityTests.cpp)
 astscf_component_add_ice_libraries(ice-util-cpp-test IceBox)
 astscf_component_add_boost_libraries(ice-util-cpp-test unit_test_framework date_time thread)
 astscf_component_build_icebox(ice-util-cpp-test)
-target_link_libraries(ice-util-cpp-test asterisk-scf-api)
+target_link_libraries(ice-util-cpp-test astscf-api)
+astscf_test_icebox(ice-util-cpp-test IceUtilCppTests.conf)
 
 add_subdirectory(Async)
 add_subdirectory(Replication)
diff --git a/test/Replication/CMakeLists.txt b/test/Replication/CMakeLists.txt
index 1abce94..5eefb35 100644
--- a/test/Replication/CMakeLists.txt
+++ b/test/Replication/CMakeLists.txt
@@ -1,8 +1,9 @@
 astscf_component_init(StateReplicatorTest)
-astscf_component_add_file(StateReplicatorTest TestStateReplicator.cpp)
-astscf_component_add_file(StateReplicatorTest SharedTestData.h)
-astscf_component_add_file(StateReplicatorTest MockStateReplicatorListener.h)
-astscf_component_add_slice(StateReplicatorTest ./slice/StateReplicatorTestIf.ice)
+astscf_slice_collection(local slice)
+astscf_component_add_files(StateReplicatorTest TestStateReplicator.cpp)
+astscf_component_add_files(StateReplicatorTest SharedTestData.h)
+astscf_component_add_files(StateReplicatorTest MockStateReplicatorListener.h)
+astscf_component_add_slices(StateReplicatorTest local StateReplicatorTestIf.ice)
 astscf_component_add_boost_libraries(StateReplicatorTest unit_test_framework thread date_time)
 astscf_component_build_standalone(StateReplicatorTest)
 astscf_test_boost(StateReplicatorTest)
diff --git a/test/ThreadPool/CMakeLists.txt b/test/ThreadPool/CMakeLists.txt
index 6f7015c..eb02604 100644
--- a/test/ThreadPool/CMakeLists.txt
+++ b/test/ThreadPool/CMakeLists.txt
@@ -1,8 +1,8 @@
 astscf_component_init(ThreadPoolTest)
-astscf_component_add_file(ThreadPoolTest TestThreadPool.cpp)
-astscf_component_add_file(ThreadPoolTest test.cpp)
+astscf_component_add_files(ThreadPoolTest TestThreadPool.cpp)
+astscf_component_add_files(ThreadPoolTest test.cpp)
 astscf_component_add_boost_libraries(ThreadPoolTest unit_test_framework)
 astscf_component_build_standalone(ThreadPoolTest)
-target_link_libraries(ThreadPoolTest asterisk-scf-api)
+target_link_libraries(ThreadPoolTest astscf-api)
 target_link_libraries(ThreadPoolTest ice-util-cpp)
 astscf_test_boost(ThreadPoolTest)
diff --git a/test/WorkQueue/CMakeLists.txt b/test/WorkQueue/CMakeLists.txt
index cb4769b..9585e85 100644
--- a/test/WorkQueue/CMakeLists.txt
+++ b/test/WorkQueue/CMakeLists.txt
@@ -1,17 +1,17 @@
 astscf_component_init(WorkQueueTest)
-astscf_component_add_file(WorkQueueTest TestWorkQueue.cpp)
-astscf_component_add_file(WorkQueueTest test.cpp)
+astscf_component_add_files(WorkQueueTest TestWorkQueue.cpp)
+astscf_component_add_files(WorkQueueTest test.cpp)
 astscf_component_add_boost_libraries(WorkQueueTest unit_test_framework)
 astscf_component_build_standalone(WorkQueueTest)
-target_link_libraries(WorkQueueTest asterisk-scf-api)
+target_link_libraries(WorkQueueTest astscf-api)
 target_link_libraries(WorkQueueTest ice-util-cpp)
 astscf_test_boost(WorkQueueTest)
 
 astscf_component_init(SuspendableWorkQueueTest)
-astscf_component_add_file(SuspendableWorkQueueTest TestSuspendableWorkQueue.cpp)
-astscf_component_add_file(SuspendableWorkQueueTest test2.cpp)
+astscf_component_add_files(SuspendableWorkQueueTest TestSuspendableWorkQueue.cpp)
+astscf_component_add_files(SuspendableWorkQueueTest test2.cpp)
 astscf_component_add_boost_libraries(SuspendableWorkQueueTest unit_test_framework thread)
 astscf_component_build_standalone(SuspendableWorkQueueTest)
-target_link_libraries(SuspendableWorkQueueTest asterisk-scf-api)
+target_link_libraries(SuspendableWorkQueueTest astscf-api)
 target_link_libraries(SuspendableWorkQueueTest ice-util-cpp)
 astscf_test_boost(SuspendableWorkQueueTest)

commit 255f664cfbe307a95e505fbec025557e20fa9d6d
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 39a91bb..c09834b 100644
--- a/AsteriskSCF.cmake
+++ b/AsteriskSCF.cmake
@@ -260,6 +260,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)
@@ -304,10 +310,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}")
... 32102 lines suppressed ...


-- 
asterisk-scf/integration/ice-util-cpp.git



More information about the asterisk-scf-commits mailing list