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

Commits to the Asterisk SCF project code repositories asterisk-scf-commits at lists.digium.com
Wed Nov 3 15:19:51 CDT 2010


branch "master" has been updated
       via  efdcbf7711c72753a3cc90ad568760d163ffa097 (commit)
       via  5d28e94e0f3e7f7b1a73b8c4922083d4ece5d46d (commit)
       via  2fa7b754cc1b888a78b6c7dee8c1a94b485cd88b (commit)
      from  1af4041e6a8210e18b43437a60210cad8c2963c9 (commit)

Summary of changes:
 AsteriskSCF.cmake | 1408 +++++++++++++++++++++++++++--------------------------
 1 files changed, 711 insertions(+), 697 deletions(-)


- Log -----------------------------------------------------------------
commit efdcbf7711c72753a3cc90ad568760d163ffa097
Author: David M. Lee <dlee at digium.com>
Date:   Wed Nov 3 15:17:35 2010 -0500

    Changes spacing to 4 spaces, as per style guide.

diff --git a/AsteriskSCF.cmake b/AsteriskSCF.cmake
index b9df95a..9d86659 100644
--- a/AsteriskSCF.cmake
+++ b/AsteriskSCF.cmake
@@ -33,57 +33,57 @@
 #
 
 if(CMAKE_BINARY_DIR STREQUAL CMAKE_SOURCE_DIR)
-  message(FATAL_ERROR "This project must not be built in the source directory")
+    message(FATAL_ERROR "This project must not be built in the source directory")
 endif()
 
 list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules")
 
 # If a build type has not been explicitly specified then use debug
 if(NOT CMAKE_BUILD_TYPE)
-  set(CMAKE_BUILD_TYPE Debug CACHE STRING
-    "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel."
-    FORCE)
+    set(CMAKE_BUILD_TYPE Debug CACHE STRING
+        "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel."
+        FORCE)
 endif()
 
 if(WIN32)
-  message(WARNING "Profile builds not supported")
+    message(WARNING "Profile builds not supported")
 else()
-  message(STATUS "Adding profile flags")
-  set(CMAKE_C_FLAGS_PROFILE
-    "${CMAKE_C_FLAGS_DEBUG} -ftest-coverage -fprofile-arcs"
-    CACHE STRING "Flags used by the compiler during profile builds." FORCE)
-  set(CMAKE_CXX_FLAGS_PROFILE
-    "${CMAKE_CXX_FLAGS_DEBUG} -ftest-coverage -fprofile-arcs"
-    CACHE STRING "Flags used by the compiler during profile builds." FORCE)
-  set(CMAKE_EXE_LINKER_FLAGS_PROFILE
-    "${CMAKE_EXE_LINKER_FLAGS_DEBUG}"
-    CACHE STRING "Flags used by the linker during profile builds." FORCE)
+    message(STATUS "Adding profile flags")
+    set(CMAKE_C_FLAGS_PROFILE
+        "${CMAKE_C_FLAGS_DEBUG} -ftest-coverage -fprofile-arcs"
+        CACHE STRING "Flags used by the compiler during profile builds." FORCE)
+    set(CMAKE_CXX_FLAGS_PROFILE
+        "${CMAKE_CXX_FLAGS_DEBUG} -ftest-coverage -fprofile-arcs"
+        CACHE STRING "Flags used by the compiler during profile builds." FORCE)
+    set(CMAKE_EXE_LINKER_FLAGS_PROFILE
+        "${CMAKE_EXE_LINKER_FLAGS_DEBUG}"
+        CACHE STRING "Flags used by the linker during profile builds." FORCE)
 endif()
 
 if(${CMAKE_BUILD_TYPE} STREQUAL profile)
-  message(STATUS "Disabling shared libs.")
-  set(BUILD_SHARED_LIBS false
-    CACHE BOOL "Enables building shared libraries." FORCE)
+    message(STATUS "Disabling shared libs.")
+    set(BUILD_SHARED_LIBS false
+        CACHE BOOL "Enables building shared libraries." FORCE)
 endif()
 
 if(NOT DEFINED BUILD_SHARED_LIBS)
-  message(STATUS "Enabling shared libs.")
-  set(BUILD_SHARED_LIBS true
-    CACHE BOOL "Enables building shared libraries." FORCE)
+    message(STATUS "Enabling shared libs.")
+    set(BUILD_SHARED_LIBS true
+        CACHE BOOL "Enables building shared libraries." FORCE)
 endif()
 
 # Enable the use of CTest for running unit tests
 enable_testing()
 
 if(UNIX AND EXISTS "${CMAKE_SOURCE_DIR}/.svn")
-  add_custom_target(update COMMAND svn update WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}" COMMENT "Updating checkout")
+    add_custom_target(update COMMAND svn update WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}" COMMENT "Updating checkout")
 elseif(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")
+    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")
 endif()
 
 macro(set_cache_var)
-  set(${ARGV} CACHE INTERNAL Bob FORCE)
+    set(${ARGV} CACHE INTERNAL Bob FORCE)
 endmacro()
 
 # Function which scans a path for matching files or directories,
@@ -92,307 +92,307 @@ endmacro()
 # if there were no matches. Single-character globs (?) can
 # be used in the base string, but not multi-character globs (*).
 function(find_best_version output base)
-  get_filename_component(base_full "${base}" ABSOLUTE)
-  file(GLOB path_list "${base_full}*")
-  string(LENGTH "${base_full}" base_length)
-  foreach(path ${path_list})
-    get_filename_component(path_full "${path}" ABSOLUTE)
-    string(LENGTH "${path_full}" path_length)
-    math(EXPR get "${path_length} - ${base_length}")
-    string(SUBSTRING "${path_full}" ${base_length} ${get} ver)
-    if(NOT DEFINED best_ver)
-      set(best_ver ${ver})
-      set(best_path "${path_full}")
-    elseif(best_ver VERSION_LESS ver)
-      set(best_ver ${ver})
-      set(best_path "${path_full}")
-    endif()
-  endforeach()
-  if(DEFINED best_ver)
-    set(${output} "${best_path}" PARENT_SCOPE)
-  else()
-    set(${output} "NOTFOUND" PARENT_SCOPE)
-  endif()
+    get_filename_component(base_full "${base}" ABSOLUTE)
+    file(GLOB path_list "${base_full}*")
+    string(LENGTH "${base_full}" base_length)
+    foreach(path ${path_list})
+        get_filename_component(path_full "${path}" ABSOLUTE)
+        string(LENGTH "${path_full}" path_length)
+        math(EXPR get "${path_length} - ${base_length}")
+        string(SUBSTRING "${path_full}" ${base_length} ${get} ver)
+        if(NOT DEFINED best_ver)
+            set(best_ver ${ver})
+            set(best_path "${path_full}")
+        elseif(best_ver VERSION_LESS ver)
+            set(best_ver ${ver})
+            set(best_path "${path_full}")
+        endif()
+    endforeach()
+    if(DEFINED best_ver)
+        set(${output} "${best_path}" PARENT_SCOPE)
+    else()
+        set(${output} "NOTFOUND" PARENT_SCOPE)
+    endif()
 endfunction()
 
 # Find Ice installation for a specific major/minor version
 function(find_ICE version)
-  set(ice "$ENV{ICE_HOME}")
-  if(NOT ice)
-      if(WIN32)
-	find_best_version(ice "C:/Ice-${version}")
-      elseif(UNIX)
-	find_best_version(ice "/opt/Ice-${version}")
-      endif()
-  endif()
-
-  if(NOT ice)
-    message(FATAL_ERROR "Could not find an installation of Ice with version ${version}")
-  endif()
-  find_path(ICE_SLICE_DIR Ice/Current.ice PATHS "${ice}/../slice" "${ice}/slice" NO_DEFAULT_PATH)
-  if(ICE_SLICE_DIR)
-    message(STATUS "Found Ice Slice definitions in ${ICE_SLICE_DIR}")
-  else()
-    message(FATAL_ERROR "Ice installation located at ${ice} is incomplete or broken (missing 'slice' directory)")
-  endif()
-  file(TO_CMAKE_PATH "${ice}" ice_cmake_path)
-  set_cache_var(ICE_DIR "${ice_cmake_path}")
-
-  # find icebox executable
-  # XXX Need to look for iceboxd.exe for debug windows builds
-  find_program(ICEBOX icebox PATHS "${ICE_DIR}/bin" NO_DEFAULT_PATH)
-
-  if(ICEBOX)
-    message(STATUS "Found icebox at ${ICEBOX}")
-  else()
-    message(WARNING "Failed to find icebox ${ICE_DIR}")
-  endif()
+    set(ice "$ENV{ICE_HOME}")
+    if(NOT ice)
+        if(WIN32)
+	    find_best_version(ice "C:/Ice-${version}")
+        elseif(UNIX)
+	    find_best_version(ice "/opt/Ice-${version}")
+        endif()
+    endif()
+
+    if(NOT ice)
+        message(FATAL_ERROR "Could not find an installation of Ice with version ${version}")
+    endif()
+    find_path(ICE_SLICE_DIR Ice/Current.ice PATHS "${ice}/../slice" "${ice}/slice" NO_DEFAULT_PATH)
+    if(ICE_SLICE_DIR)
+        message(STATUS "Found Ice Slice definitions in ${ICE_SLICE_DIR}")
+    else()
+        message(FATAL_ERROR "Ice installation located at ${ice} is incomplete or broken (missing 'slice' directory)")
+    endif()
+    file(TO_CMAKE_PATH "${ice}" ice_cmake_path)
+    set_cache_var(ICE_DIR "${ice_cmake_path}")
+
+    # find icebox executable
+    # XXX Need to look for iceboxd.exe for debug windows builds
+    find_program(ICEBOX icebox PATHS "${ICE_DIR}/bin" NO_DEFAULT_PATH)
+
+    if(ICEBOX)
+        message(STATUS "Found icebox at ${ICEBOX}")
+    else()
+        message(WARNING "Failed to find icebox ${ICE_DIR}")
+    endif()
 endfunction()
 
 # Find Ice headers and libraries for CXX components
 function(find_ICE_CXX)
-  find_path(ICE_CXX_INCLUDE_DIR Ice/Ice.h PATHS "${ICE_DIR}/include" NO_DEFAULT_PATH)
-  if(ICE_CXX_INCLUDE_DIR)
-    message(STATUS "Found Ice headers for CXX in ${ICE_CXX_INCLUDE_DIR}")
-  else()
-    message(FATAL_ERROR "Failed to find Ice headers for CXX")
-  endif()
+    find_path(ICE_CXX_INCLUDE_DIR Ice/Ice.h PATHS "${ICE_DIR}/include" NO_DEFAULT_PATH)
+    if(ICE_CXX_INCLUDE_DIR)
+        message(STATUS "Found Ice headers for CXX in ${ICE_CXX_INCLUDE_DIR}")
+    else()
+        message(FATAL_ERROR "Failed to find Ice headers for CXX")
+    endif()
 endfunction()
 
 # Find an Ice library for CXX components
 function(find_ICE_CXX_library LIBRARY)
-  if(NOT ICE_CXX_LIB_${LIBRARY})
-    if(WIN32)
-      string(TOLOWER ${LIBRARY} lib)
-      find_library(ICE_CXX_LIB_RELEASE_${LIBRARY} ${lib} PATHS "${ICE_DIR}/lib" NO_DEFAULT_PATH)
-      if(ICE_CXX_LIB_RELEASE_${LIBRARY})
-	message(STATUS "Found Ice ${LIBRARY} library for CXX (release build) at ${ICE_CXX_LIB_RELEASE_${LIBRARY}}")
-	list(APPEND ficxxl_libs optimized "${ICE_CXX_LIB_RELEASE_${LIBRARY}}")
-      endif()
-      find_library(ICE_CXX_LIB_DEBUG_${LIBRARY} ${lib}d PATHS "${ICE_DIR}/lib" NO_DEFAULT_PATH)
-      if(ICE_CXX_LIB_DEBUG_${LIBRARY})
-	message(STATUS "Found Ice ${LIBRARY} library for CXX (debug build) at ${ICE_CXX_LIB_DEBUG_${LIBRARY}}")
-	list(APPEND ficxxl_libs debug "${ICE_CXX_LIB_DEBUG_${LIBRARY}}")
-      endif()
-      if(ficxxl_libs)
-	set_cache_var(ICE_CXX_LIB_${LIBRARY} ${ficxxl_libs})
-      else()
-	message(FATAL_ERROR "Failed to find Ice ${LIBRARY} library for CXX")
-      endif()
-    elseif(UNIX)
-      find_library(ICE_CXX_LIB_${LIBRARY} ${LIBRARY} PATHS "${ICE_DIR}/lib" "${ICE_DIR}/lib32" "${ICE_DIR}/lib64" NO_DEFAULT_PATH)
-      if(ICE_CXX_LIB_${LIBRARY})
-	get_filename_component(library_path ${ICE_CXX_LIB_${LIBRARY}} PATH)
-	link_directories(${library_path})
-	message(STATUS "Found Ice ${LIBRARY} library for CXX at ${ICE_CXX_LIB_${LIBRARY}}")
-      else()
-	message(FATAL_ERROR "Failed to find Ice ${LIBRARY} library for CXX")
-      endif()
-    endif()
-  endif()
+    if(NOT ICE_CXX_LIB_${LIBRARY})
+        if(WIN32)
+            string(TOLOWER ${LIBRARY} lib)
+            find_library(ICE_CXX_LIB_RELEASE_${LIBRARY} ${lib} PATHS "${ICE_DIR}/lib" NO_DEFAULT_PATH)
+            if(ICE_CXX_LIB_RELEASE_${LIBRARY})
+	        message(STATUS "Found Ice ${LIBRARY} library for CXX (release build) at ${ICE_CXX_LIB_RELEASE_${LIBRARY}}")
+	        list(APPEND ficxxl_libs optimized "${ICE_CXX_LIB_RELEASE_${LIBRARY}}")
+            endif()
+            find_library(ICE_CXX_LIB_DEBUG_${LIBRARY} ${lib}d PATHS "${ICE_DIR}/lib" NO_DEFAULT_PATH)
+            if(ICE_CXX_LIB_DEBUG_${LIBRARY})
+	        message(STATUS "Found Ice ${LIBRARY} library for CXX (debug build) at ${ICE_CXX_LIB_DEBUG_${LIBRARY}}")
+	        list(APPEND ficxxl_libs debug "${ICE_CXX_LIB_DEBUG_${LIBRARY}}")
+            endif()
+            if(ficxxl_libs)
+	        set_cache_var(ICE_CXX_LIB_${LIBRARY} ${ficxxl_libs})
+            else()
+	        message(FATAL_ERROR "Failed to find Ice ${LIBRARY} library for CXX")
+            endif()
+        elseif(UNIX)
+            find_library(ICE_CXX_LIB_${LIBRARY} ${LIBRARY} PATHS "${ICE_DIR}/lib" "${ICE_DIR}/lib32" "${ICE_DIR}/lib64" NO_DEFAULT_PATH)
+            if(ICE_CXX_LIB_${LIBRARY})
+	        get_filename_component(library_path ${ICE_CXX_LIB_${LIBRARY}} PATH)
+	        link_directories(${library_path})
+	        message(STATUS "Found Ice ${LIBRARY} library for CXX at ${ICE_CXX_LIB_${LIBRARY}}")
+            else()
+	        message(FATAL_ERROR "Failed to find Ice ${LIBRARY} library for CXX")
+            endif()
+        endif()
+    endif()
 endfunction()
 
 # Find an Ice assembly for CSharp components
 function(find_ICE_CSharp_library LIBRARY)
-  if(NOT ICE_CSharp_LIB_${LIBRARY})
-    find_file(ICE_CSharp_LIB_${LIBRARY} ${LIBRARY}.dll PATHS "${ICE_DIR}/bin" NO_DEFAULT_PATH)
-    if(ICE_CSharp_LIB_${LIBRARY})
-      message(STATUS "Found Ice ${LIBRARY} assembly for CSharp at ${ICE_CSharp_LIB_${LIBRARY}}")
-    else()
-      message(FATAL_ERROR "Failed to find Ice ${LIBRARY} assembly for CSharp")
+    if(NOT ICE_CSharp_LIB_${LIBRARY})
+        find_file(ICE_CSharp_LIB_${LIBRARY} ${LIBRARY}.dll PATHS "${ICE_DIR}/bin" NO_DEFAULT_PATH)
+        if(ICE_CSharp_LIB_${LIBRARY})
+            message(STATUS "Found Ice ${LIBRARY} assembly for CSharp at ${ICE_CSharp_LIB_${LIBRARY}}")
+        else()
+            message(FATAL_ERROR "Failed to find Ice ${LIBRARY} assembly for CSharp")
+        endif()
     endif()
-  endif()
 endfunction()
 
 # Find an Ice module for Java components
 function(find_ICE_Java_library LIBRARY)
-  if(NOT ICE_Java_LIB_${LIBRARY})
-    find_file(ICE_Java_LIB_${LIBRARY} ${LIBRARY}.jar PATHS "${ICE_DIR}/lib" NO_DEFAULT_PATH)
-    if(ICE_Java_LIB_${LIBRARY})
-      message(STATUS "Found Ice ${LIBRARY} module for Java at ${ICE_Java_LIB_${LIBRARY}}")
-    else()
-      message(FATAL_ERROR "Failed to find Ice ${LIBRARY} module for Java")
+    if(NOT ICE_Java_LIB_${LIBRARY})
+        find_file(ICE_Java_LIB_${LIBRARY} ${LIBRARY}.jar PATHS "${ICE_DIR}/lib" NO_DEFAULT_PATH)
+        if(ICE_Java_LIB_${LIBRARY})
+            message(STATUS "Found Ice ${LIBRARY} module for Java at ${ICE_Java_LIB_${LIBRARY}}")
+        else()
+            message(FATAL_ERROR "Failed to find Ice ${LIBRARY} module for Java")
+        endif()
     endif()
-  endif()
 endfunction()
 
 # Find a Boost library for CXX components
 function(find_Boost_library LIBRARY)
-  if(NOT Boost_FOUND)
-    set(Boost_ADDITIONAL_VERSIONS "1.39" "1.39.0" "1.40" "1.40.0" "1.41" "1.41.0" "1.42" "1.42.0" "1.44" "1.44.0")
-    find_package(Boost)
     if(NOT Boost_FOUND)
-      message(FATAL_ERROR "Boost libraries not found")
-    endif()
-    set(Boost_CORE_FOUND "bazinga" PARENT_SCOPE)
-    set(Boost_CORE_FOUND "bazinga")
-  endif()
-  string(TOUPPER ${LIBRARY} libtag)
-  if(NOT Boost_${libtag}_FOUND)
-    find_package(Boost COMPONENTS ${LIBRARY})
+        set(Boost_ADDITIONAL_VERSIONS "1.39" "1.39.0" "1.40" "1.40.0" "1.41" "1.41.0" "1.42" "1.42.0" "1.44" "1.44.0")
+        find_package(Boost)
+        if(NOT Boost_FOUND)
+            message(FATAL_ERROR "Boost libraries not found")
+        endif()
+        set(Boost_CORE_FOUND "bazinga" PARENT_SCOPE)
+        set(Boost_CORE_FOUND "bazinga")
+    endif()
+    string(TOUPPER ${LIBRARY} libtag)
     if(NOT Boost_${libtag}_FOUND)
-      message(FATAL_ERROR "Failed to find Boost library ${LIBRARY}")
+        find_package(Boost COMPONENTS ${LIBRARY})
+        if(NOT Boost_${libtag}_FOUND)
+            message(FATAL_ERROR "Failed to find Boost library ${LIBRARY}")
+        endif()
     endif()
-  endif()
 endfunction()
 
 # Function which initializes project specific things
 function(asterisk_scf_project NAME ICE_VERSION)
-  if(NOT ARGN)
-    message(FATAL_ERROR "You must pass at least one language to this function")
-  endif()
-  message(STATUS "Setting up project ${NAME} for languages ${ARGN}")
-  set(ASTERISK_SCF_PROJECT_LANGUAGES ${ARGN} PARENT_SCOPE)
-  set(ASTERISK_SCF_ICE_VERSION ${ICE_VERSION} PARENT_SCOPE)
-  project(${NAME} ${ARGN})
-  # 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
-  # block will ensure it contains the correct value.
-  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()
-  # On Windows, 'debug' libraries should have a "d" suffix to indicate that they
-  # are debug libraries
-  if(WIN32)
-    set(CMAKE_DEBUG_POSTFIX "d" PARENT_SCOPE)
-  endif()
-  find_ICE(${ICE_VERSION})
-  foreach(l ${ARGN})
-    set(ASTERISK_SCF_ICE_LIBRARIES_${l} Ice PARENT_SCOPE)
-    # Perform requirement checking for each language to be used in the project
-    if(l STREQUAL "Java")
-      message(STATUS "Performing requirement checks for Java components")
-      find_ICE_Java_library(Ice)
-      message(STATUS "Passed requirement checks for Java components")
-    elseif(l STREQUAL "CSharp")
-      message(STATUS "Performing requirement checks for CSharp components")
-      find_ICE_CSharp_library(Ice)
-      message(STATUS "Passed requirement checks for CSharp components")
-    elseif(l STREQUAL "CXX")
-      message(STATUS "Performing requirement checks for CXX components")
-      if(CMAKE_COMPILER_IS_GNUCXX)
-	set(CMAKE_CXX_FLAGS_DEBUG "-g3 -Wall")
-      endif()
-      find_ICE_CXX()
-      find_ICE_CXX_library(Ice)
-      find_ICE_CXX_library(IceUtil)
-      if(WIN32)
-	# On Windows, the IceUtil library must be explicitly linked
-	set(ASTERISK_SCF_ICE_LIBRARIES_${l} Ice IceUtil PARENT_SCOPE)
-      endif()
-      message(STATUS "Include directories ${ICE_CXX_INCLUDE_DIR}")
-      include_directories("${ICE_CXX_INCLUDE_DIR}")
-      message(STATUS "Passed requirement checks for CXX components")
+    if(NOT ARGN)
+        message(FATAL_ERROR "You must pass at least one language to this function")
+    endif()
+    message(STATUS "Setting up project ${NAME} for languages ${ARGN}")
+    set(ASTERISK_SCF_PROJECT_LANGUAGES ${ARGN} PARENT_SCOPE)
+    set(ASTERISK_SCF_ICE_VERSION ${ICE_VERSION} PARENT_SCOPE)
+    project(${NAME} ${ARGN})
+    # 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
+    # block will ensure it contains the correct value.
+    if(WIN32)
+        message(STATUS "Setting ASTERISK_SCF_ICEBOX_EXPORT definition for Windows IceBox services")
+        add_definitions(-DASTERISK_SCF_ICEBOX_EXPORT=__declspec\(dllexport\))
     else()
-      message(FATAL_ERROR "Unsupported component language ${l}")
+        add_definitions(-DASTERISK_SCF_ICEBOX_EXPORT=)
+    endif()
+    # On Windows, 'debug' libraries should have a "d" suffix to indicate that they
+    # are debug libraries
+    if(WIN32)
+        set(CMAKE_DEBUG_POSTFIX "d" PARENT_SCOPE)
     endif()
-  endforeach()
+    find_ICE(${ICE_VERSION})
+    foreach(l ${ARGN})
+        set(ASTERISK_SCF_ICE_LIBRARIES_${l} Ice PARENT_SCOPE)
+        # Perform requirement checking for each language to be used in the project
+        if(l STREQUAL "Java")
+            message(STATUS "Performing requirement checks for Java components")
+            find_ICE_Java_library(Ice)
+            message(STATUS "Passed requirement checks for Java components")
+        elseif(l STREQUAL "CSharp")
+            message(STATUS "Performing requirement checks for CSharp components")
+            find_ICE_CSharp_library(Ice)
+            message(STATUS "Passed requirement checks for CSharp components")
+        elseif(l STREQUAL "CXX")
+            message(STATUS "Performing requirement checks for CXX components")
+            if(CMAKE_COMPILER_IS_GNUCXX)
+	        set(CMAKE_CXX_FLAGS_DEBUG "-g3 -Wall")
+            endif()
+            find_ICE_CXX()
+            find_ICE_CXX_library(Ice)
+            find_ICE_CXX_library(IceUtil)
+            if(WIN32)
+	        # On Windows, the IceUtil library must be explicitly linked
+	        set(ASTERISK_SCF_ICE_LIBRARIES_${l} Ice IceUtil PARENT_SCOPE)
+            endif()
+            message(STATUS "Include directories ${ICE_CXX_INCLUDE_DIR}")
+            include_directories("${ICE_CXX_INCLUDE_DIR}")
+            message(STATUS "Passed requirement checks for CXX components")
+        else()
+            message(FATAL_ERROR "Unsupported component language ${l}")
+        endif()
+    endforeach()
 endfunction()
 
 # Function which adds Ice libraries to all components in the current
 # directory and below
 function(asterisk_scf_add_ice_libraries)
-  if(NOT ARGN)
-    message(FATAL_ERROR "You must pass at least one library to this function")
-  endif()
-  foreach(lang ${ASTERISK_SCF_PROJECT_LANGUAGES})
-    set(libs ${ASTERISK_SCF_ICE_LIBRARIES_${lang}})
-    foreach(lib ${ARGN})
-      if(lang STREQUAL "Java")
-	find_ICE_Java_library(${lib})
-      elseif(lang STREQUAL "CSharp")
-	find_ICE_CSharp_library(${lib})
-      elseif(lang STREQUAL "CXX")
-	find_ICE_CXX_library(${lib})
-      endif()
-      list(APPEND libs ${lib})
+    if(NOT ARGN)
+        message(FATAL_ERROR "You must pass at least one library to this function")
+    endif()
+    foreach(lang ${ASTERISK_SCF_PROJECT_LANGUAGES})
+        set(libs ${ASTERISK_SCF_ICE_LIBRARIES_${lang}})
+        foreach(lib ${ARGN})
+            if(lang STREQUAL "Java")
+	        find_ICE_Java_library(${lib})
+            elseif(lang STREQUAL "CSharp")
+	        find_ICE_CSharp_library(${lib})
+            elseif(lang STREQUAL "CXX")
+	        find_ICE_CXX_library(${lib})
+            endif()
+            list(APPEND libs ${lib})
+        endforeach()
+        list(REMOVE_DUPLICATES libs)
+        set(ASTERISK_SCF_ICE_LIBRARIES_${lang} ${libs} PARENT_SCOPE)
     endforeach()
-    list(REMOVE_DUPLICATES libs)
-    set(ASTERISK_SCF_ICE_LIBRARIES_${lang} ${libs} PARENT_SCOPE)
-  endforeach()
 endfunction()
 
 # Function which adds Boost libraries to all components in the current
 # directory and below
 function(asterisk_scf_add_boost_libraries)
-  if(NOT ARGN)
-    message(FATAL_ERROR "You must pass at least one library to this function")
-  endif()
-  set(libs ${ASTERISK_SCF_BOOST_LIBRARIES})
-  foreach(lib ${ARGN})
-    find_Boost_library(${lib})
-    list(APPEND libs ${lib})
-  endforeach()
-  list(REMOVE_DUPLICATES libs)
-  set(ASTERISK_SCF_BOOST_LIBRARIES ${libs} PARENT_SCOPE)
-  include_directories(${Boost_INCLUDE_DIR})
-  link_directories(${Boost_LIBRARY_DIRS})
+    if(NOT ARGN)
+        message(FATAL_ERROR "You must pass at least one library to this function")
+    endif()
+    set(libs ${ASTERISK_SCF_BOOST_LIBRARIES})
+    foreach(lib ${ARGN})
+        find_Boost_library(${lib})
+        list(APPEND libs ${lib})
+    endforeach()
+    list(REMOVE_DUPLICATES libs)
+    set(ASTERISK_SCF_BOOST_LIBRARIES ${libs} PARENT_SCOPE)
+    include_directories(${Boost_INCLUDE_DIR})
+    link_directories(${Boost_LIBRARY_DIRS})
 endfunction()
 
 # Ensures that a list of paths are all absolute paths.
 macro(ensure_abs_paths pathlist)
-  unset(eap_temp)
-  foreach(p ${${pathlist}})
-    get_filename_component(newpath "${p}" ABSOLUTE)
-    list(APPEND eap_temp "${newpath}")
-  endforeach()
-  list(REMOVE_DUPLICATES eap_temp)
-  set(${pathlist} ${eap_temp})
+    unset(eap_temp)
+    foreach(p ${${pathlist}})
+        get_filename_component(newpath "${p}" ABSOLUTE)
+        list(APPEND eap_temp "${newpath}")
+    endforeach()
+    list(REMOVE_DUPLICATES eap_temp)
+    set(${pathlist} ${eap_temp})
 endmacro()
 
 # Function which remembers include directories needed for a particular Slice target
 function(asterisk_scf_slice_include_directories)
-  set(paths ${ARGN})
-  ensure_abs_paths(paths)
-  if(SLICE_INCLUDE_DIRECTORIES)
-    list(INSERT paths 0 ${SLICE_INCLUDE_DIRECTORIES})
-  endif()
-  list(REMOVE_DUPLICATES paths)
-  set(SLICE_INCLUDE_DIRECTORIES ${paths} PARENT_SCOPE)
+    set(paths ${ARGN})
+    ensure_abs_paths(paths)
+    if(SLICE_INCLUDE_DIRECTORIES)
+        list(INSERT paths 0 ${SLICE_INCLUDE_DIRECTORIES})
+    endif()
+    list(REMOVE_DUPLICATES paths)
+    set(SLICE_INCLUDE_DIRECTORIES ${paths} PARENT_SCOPE)
 endfunction()
 
 # Function which remembers definitions needed for a particular Slice target
 function(asterisk_scf_slice_compile_definitions SLICE_FILE)
-  get_filename_component(SLICE ${SLICE_FILE} NAME_WE)
-  set(SLICE_COMPILE_DEFINITIONS_${SLICE} ${ARGN} PARENT_SCOPE)
+    get_filename_component(SLICE ${SLICE_FILE} NAME_WE)
+    set(SLICE_COMPILE_DEFINITIONS_${SLICE} ${ARGN} PARENT_SCOPE)
 endfunction()
 
 # Function which remembers Ice libraries needed by a Slice target
 function(asterisk_scf_slice_add_ice_libraries TARGET)
-  if(NOT ARGN)
-    message(FATAL_ERROR "You must pass at least one library to this function")
-  endif()
-  set(libs ${${TARGET}_ICE_LIBRARIES})
-  foreach(lib ${ARGN})
-    foreach(lang ${ASTERISK_SCF_PROJECT_LANGUAGES})
-      if(lang STREQUAL "Java")
-	find_ICE_Java_library(${lib})
-      elseif(lang STREQUAL "CSharp")
-	find_ICE_CSharp_library(${lib})
-      elseif(lang STREQUAL "CXX")
-	find_ICE_CXX_library(${lib})
-      endif()
+    if(NOT ARGN)
+        message(FATAL_ERROR "You must pass at least one library to this function")
+    endif()
+    set(libs ${${TARGET}_ICE_LIBRARIES})
+    foreach(lib ${ARGN})
+        foreach(lang ${ASTERISK_SCF_PROJECT_LANGUAGES})
+            if(lang STREQUAL "Java")
+	        find_ICE_Java_library(${lib})
+            elseif(lang STREQUAL "CSharp")
+	        find_ICE_CSharp_library(${lib})
+            elseif(lang STREQUAL "CXX")
+	        find_ICE_CXX_library(${lib})
+            endif()
+        endforeach()
+        list(APPEND libs ${lib})
     endforeach()
-    list(APPEND libs ${lib})
-  endforeach()
-  list(REMOVE_DUPLICATES libs)
-  set(${TARGET}_ICE_LIBRARIES ${libs} PARENT_SCOPE)
+    list(REMOVE_DUPLICATES libs)
+    set(${TARGET}_ICE_LIBRARIES ${libs} PARENT_SCOPE)
 endfunction()
 
 # Function which adds a dependency for a Slice definition
 function(asterisk_scf_slice_add_dependencies TARGET)
-  if(NOT ARGN)
-    message(FATAL_ERROR "You must pass at least one dependency to this function")
-  endif()
-  foreach(l ${ASTERISK_SCF_PROJECT_LANGUAGES})
-    foreach(d ${ARGN})
-      message(STATUS "Adding dependency on slice definition ${d} to ${TARGET} for ${l} language")
-      add_dependencies(${TARGET}_${l} ${d}_${l})
+    if(NOT ARGN)
+        message(FATAL_ERROR "You must pass at least one dependency to this function")
+    endif()
+    foreach(l ${ASTERISK_SCF_PROJECT_LANGUAGES})
+        foreach(d ${ARGN})
+            message(STATUS "Adding dependency on slice definition ${d} to ${TARGET} for ${l} language")
+            add_dependencies(${TARGET}_${l} ${d}_${l})
+        endforeach()
     endforeach()
-  endforeach()
 endfunction()
 
 # Function which compiles one or more Slice definition files;
@@ -420,517 +420,517 @@ endfunction()
 #  directories where generated header files needed for this target live
 #  (only for C++)
 function(asterisk_scf_compile_slice TARGET_IN DIR_IN DESC_IN GROUP_IN)
-  if(ARGN)
-    foreach(arg ${ARGN})
-      if(NOT source_mode)
-	if(arg STREQUAL "SOURCES")
-	  set(source_mode true)
-	else()
-	  message(FATAL_ERROR "Unsupported argument '${arg}' passed to asterisk_scf_compile_slice")
-	endif()
-      else()
-	list(APPEND inputs "${arg}")
-      endif()
-    endforeach()
-    set(TARGET "${TARGET_IN}")
-  else()
-    set(slice_files "${CMAKE_CURRENT_SOURCE_DIR}/${TARGET_IN}")
-    get_filename_component(file "${TARGET_IN}" NAME_WE)
-    set(TARGET "${file}")
-  endif()
-
-  # Now that we have the list of inputs, convert any of them
-  # that are glob-patterns into the list of files that match
-  if(source_mode)
-    foreach(input ${inputs})
-      if(IS_ABSOLUTE "${input}")
-	file(GLOB globbed "${input}")
-      else()
-	file(GLOB globbed "${CMAKE_CURRENT_SOURCE_DIR}/${input}")
-      endif()
-      if(globbed)
-	foreach (glob ${globbed})
-	  file(TO_CMAKE_PATH "${glob}" cmake_path)
-	  if(glob MATCHES "\\.ice$")
-	    list(APPEND slice_files "${cmake_path}")
-	  endif()
-	endforeach()
-      else()
-	if(input MATCHES "\\.ice$")
-	  list(APPEND slice_files "${input}")
-	endif()
-      endif()
-    endforeach()
-  endif()
-
-  # This makes the Slice definitions display in their own folder in the IDE,
-  # specifically Visual Studio
-  source_group("Slice Definitions" REGULAR_EXPRESSION "\\.ice$")
-
-  # Append the needed include directories for Slice definitions
-  # (global and the ones stored for this target)
-  if(ICE_SLICE_DIR)
-    list(APPEND slice_compiler_arguments "-I${ICE_SLICE_DIR}")
-  endif()
-  foreach(include ${SLICE_INCLUDE_DIRECTORIES})
-    # Each directory in this list will be in the source tree,
-    # which is what the Slice compiler will need
-    list(APPEND slice_compiler_arguments "-I${include}")
-    # If there are any CXX targets that depend on this target,
-    # they'll need a path the *parallel* directory in the build
-    # tree where the Slice compiler will have generated the
-    # header file(s) for the Slice definitions in the source tree
-    # but only if the Slice include path is actually part of the
-    # source tree... if it's not, it is assumed that the relevant
-    # header files live in the same directory as the Slice files
-    file(RELATIVE_PATH relpath "${CMAKE_SOURCE_DIR}" "${include}")
-    if(relpath MATCHES "^../")
-      # The directory is not located in the source tree, so use the
-      # original path
-      list(APPEND target_CXX_includes "${include}")
+    if(ARGN)
+        foreach(arg ${ARGN})
+            if(NOT source_mode)
+	        if(arg STREQUAL "SOURCES")
+	            set(source_mode true)
+	        else()
+	            message(FATAL_ERROR "Unsupported argument '${arg}' passed to asterisk_scf_compile_slice")
+	        endif()
+            else()
+	        list(APPEND inputs "${arg}")
+            endif()
+        endforeach()
+        set(TARGET "${TARGET_IN}")
     else()
-      # The directory is located in the source tree, so use the
-      # parallel path in the build tree
-      list(APPEND target_CXX_includes "${CMAKE_BINARY_DIR}/${relpath}")
-    endif()
-  endforeach()
-
-  # Append any definitions stored for this target
-  foreach(SLICEDEF ${SLICE_COMPILE_DEFINITIONS_${TARGET}})
-    list(APPEND slice_compiler_arguments "-D${SLICEDEF}")
-  endforeach()
-  list(REMOVE_DUPLICATES slice_compiler_arguments)
-
-  foreach(file ${slice_files})
-    file(RELATIVE_PATH relpath "${CMAKE_SOURCE_DIR}" "${file}")
-    string(REPLACE "/" "_" file_variable ${relpath})
-    set_cache_var(TARGET_${file_variable} ${TARGET})
-  endforeach()
-
-  foreach(lang ${ASTERISK_SCF_PROJECT_LANGUAGES})
-    unset(generated_files)
-    unset(target_dependencies)
-    unset(source_dependencies)
-    unset(raw_dependencies)
-    unset(target_libs)
-    unset(slice_export_arguments)
-    if(lang STREQUAL "Java")
-      message(STATUS "Building Slice target ${TARGET} as Java classes")
-    elseif(lang STREQUAL "CSharp")
-      message(STATUS "Building Slice target ${TARGET} as a CSharp assembly")
-      set(compiler slice2cs)
-      set(suffixes cs)
-    elseif(lang STREQUAL "CXX")
-      message(STATUS "Building Slice target ${TARGET} as a CXX library")
-      set(compiler slice2cpp)
-      set(suffixes cpp h)
-      include_directories("${CMAKE_CURRENT_BINARY_DIR}")
-    else()
-      message(FATAL_ERROR "Unsupported Slice compiled language ${lang}")
-    endif()
-
-    if(NOT SLICE_COMPILER_${lang})
-      # Find the actual Slice compiler
-      find_program(SLICE_COMPILER_${lang} ${compiler} PATHS "${ICE_DIR}/bin" NO_DEFAULT_PATH)
-
-      # If we fail to find it we have to abort here, we can go no further
-      if(SLICE_COMPILER_${lang})
-	message(STATUS "Found Slice compiler for ${lang} at ${SLICE_COMPILER_${lang}}")
-      else()
-	message(FATAL_ERROR "Failed to find Slice compiler ${compiler}")
-      endif()
-    endif()
-
-    # Look for the dependencies for this slice definition, we have to do it now since the target was just added
-    message(STATUS "Determining dependencies for Slice target ${TARGET}")
-    execute_process(COMMAND ${SLICE_COMPILER_${lang}} ${slice_compiler_arguments}
-		    --depend ${slice_files} OUTPUT_VARIABLE raw_dependencies
-		    ERROR_VARIABLE slice_errors)
-    if(slice_errors)
-      message(FATAL_ERROR "Slice compiler produced errors:\n ${slice_errors}")
-    endif()
-
-    if(raw_dependencies)
-      # The next block of stuff sanitizes the output we got from the slice compiler into a non-Makefile specific foo
-      # Get rid of all the \ characters
-      string(REPLACE "\\" "" raw_dependencies "${raw_dependencies}")
-      # Turn the newlines into CMake list item separators, since the compiler spits out one dependency per line
-      string(REPLACE "\n" ";" raw_dependencies "${raw_dependencies}")
-      string(REPLACE " ;" ";" raw_dependencies "${raw_dependencies}")
-      string(REPLACE "; " ";" raw_dependencies "${raw_dependencies}")
-      # Remove the first item, since it is a Makefile target name, not a dependency
-      list(REMOVE_AT raw_dependencies 0)
-
-      foreach(dep ${raw_dependencies})
-	# Convert the path into a cmake one so we can absolutely get the filename
-	file(TO_CMAKE_PATH ${dep} dep)
-	file(RELATIVE_PATH relpath "${CMAKE_SOURCE_DIR}" "${dep}")
-	string(REPLACE "/" "_" file_variable "${relpath}")
-	set(dep_target ${TARGET_${file_variable}})
-	if(dep_target)
-	  # If this is not already us add it as a dependency
-	  if(NOT dep_target STREQUAL ${TARGET})
-	    message(STATUS "Auto-adding dependency on Slice target ${dep_target} to ${TARGET} for ${lang} language")
-	    list(APPEND source_dependencies ${dep})
-	    list(APPEND target_dependencies ${dep_target}_${lang})
-	    list(APPEND target_CXX_includes ${ASTERISK_SCF_SLICE_${dep_target}_CXX_INCLUDE_DIRS})
-	  endif()
-	else()
-	  # Remember sources that are not associated with targets too
-	  message(STATUS "Auto-adding dependency on Slice source ${dep} to ${TARGET} for ${lang} language")
-	  list(APPEND source_dependencies ${dep})
-	endif()
-      endforeach()
+        set(slice_files "${CMAKE_CURRENT_SOURCE_DIR}/${TARGET_IN}")
+        get_filename_component(file "${TARGET_IN}" NAME_WE)
+        set(TARGET "${file}")
     endif()
 
-    foreach(file ${slice_files})
-      foreach(suffix ${suffixes})
-	get_filename_component(source "${file}" NAME_WE)
-	list(APPEND generated_files "${CMAKE_CURRENT_BINARY_DIR}/${source}.${suffix}")
-      endforeach()
-    endforeach()
+    # Now that we have the list of inputs, convert any of them
+    # that are glob-patterns into the list of files that match
+    if(source_mode)
+        foreach(input ${inputs})
+            if(IS_ABSOLUTE "${input}")
+	        file(GLOB globbed "${input}")
+            else()
+	        file(GLOB globbed "${CMAKE_CURRENT_SOURCE_DIR}/${input}")
+            endif()
+            if(globbed)
+	        foreach (glob ${globbed})
+	            file(TO_CMAKE_PATH "${glob}" cmake_path)
+	            if(glob MATCHES "\\.ice$")
+	                list(APPEND slice_files "${cmake_path}")
+	            endif()
+	        endforeach()
+            else()
+	        if(input MATCHES "\\.ice$")
+	            list(APPEND slice_files "${input}")
+	        endif()
+            endif()
+        endforeach()
+    endif()
 
-    set_source_files_properties(${generated_files} PROPERTIES GENERATED 1)
+    # This makes the Slice definitions display in their own folder in the IDE,
+    # specifically Visual Studio
+    source_group("Slice Definitions" REGULAR_EXPRESSION "\\.ice$")
 
-    # create a preprocessor definition in the generated CXX files that enables
-    # the generated classes to be exported from the library (only necessary on Windows)
-    # the definition for a target named 'FOO' will be 'FOO_CXX_EXPORTS', and if this
-    # preprocessor macro is defined, then the Slice-generated classes will be marked
-    # with 'dllexport'. add_library() (used below) automatically generates a definition
-    # for the appropriately-named macro when the library is built in SHARED mode.
-    if(WIN32 AND lang STREQUAL "CXX")
-      list(APPEND slice_export_arguments "--dll-export" "${TARGET}_${lang}")
+    # Append the needed include directories for Slice definitions
+    # (global and the ones stored for this target)
+    if(ICE_SLICE_DIR)
+        list(APPEND slice_compiler_arguments "-I${ICE_SLICE_DIR}")
     endif()
+    foreach(include ${SLICE_INCLUDE_DIRECTORIES})
+        # Each directory in this list will be in the source tree,
+        # which is what the Slice compiler will need
+        list(APPEND slice_compiler_arguments "-I${include}")
+        # If there are any CXX targets that depend on this target,
+        # they'll need a path the *parallel* directory in the build
+        # tree where the Slice compiler will have generated the
+        # header file(s) for the Slice definitions in the source tree
+        # but only if the Slice include path is actually part of the
+        # source tree... if it's not, it is assumed that the relevant
+        # header files live in the same directory as the Slice files
+        file(RELATIVE_PATH relpath "${CMAKE_SOURCE_DIR}" "${include}")
+        if(relpath MATCHES "^../")
+            # The directory is not located in the source tree, so use the
+            # original path
+            list(APPEND target_CXX_includes "${include}")
+        else()
+            # The directory is located in the source tree, so use the
+            # parallel path in the build tree
+            list(APPEND target_CXX_includes "${CMAKE_BINARY_DIR}/${relpath}")
+        endif()
+    endforeach()
 
-    add_custom_command(
-      OUTPUT ${generated_files}
-      COMMAND ${SLICE_COMPILER_${lang}} ${slice_compiler_arguments} ${slice_export_arguments} ${slice_files}
-      COMMENT "Building ${TARGET} from ${slice_files} using ${compiler}"
-      DEPENDS ${slice_files} ${source_dependencies}
-      )
+    # Append any definitions stored for this target
+    foreach(SLICEDEF ${SLICE_COMPILE_DEFINITIONS_${TARGET}})
+        list(APPEND slice_compiler_arguments "-D${SLICEDEF}")
+    endforeach()
+    list(REMOVE_DUPLICATES slice_compiler_arguments)
 
-    if(target_CXX_includes)
-      list(REMOVE_DUPLICATES target_CXX_includes)
-    endif()
+    foreach(file ${slice_files})
+        file(RELATIVE_PATH relpath "${CMAKE_SOURCE_DIR}" "${file}")
+        string(REPLACE "/" "_" file_variable ${relpath})
+        set_cache_var(TARGET_${file_variable} ${TARGET})
+    endforeach()
 
-    if(lang STREQUAL "Java")
-    elseif(lang STREQUAL "CSharp")
-      # Note that slice_files are included as sources here even though they won't be compiled
-      # by the actual compiler; this is to get them to show up as sources in the project
-      # created for this target
-      foreach(lib ${${TARGET}_ICE_LIBRARIES} ${ASTERISK_SCF_ICE_LIBRARIES_${lang}})
-	if(UNIX)
-	  list(APPEND target_libs "${lib}")
-	else()
-	  list(APPEND target_libs "${ICE_${lang}_LIB_${lib}}")
-	endif()
-      endforeach()
-      csharp_add_library(${TARGET}_${lang} ${generated_files} ${slice_files}
-			 REFERENCES "${ICE_CSharp_LIB_Ice}" ${target_libs} ${target_dependencies})
-    elseif(lang STREQUAL "CXX")
-      # Note that slice_files are included as sources here even though they won't be compiled
-      # by the actual compiler; this is to get them to show up as sources in the project
-      # created for this target
-      include_directories(${target_CXX_includes})
-      add_library(${TARGET}_${lang} ${generated_files} ${slice_files})
-      install(TARGETS ${TARGET}_${lang} DESTINATION ${DIR_IN} COMPONENT ${TARGET}_${lang})
-      if(ASTERISKSCF_CPACK)
-	 # Adds a component to the packager. The first arg must have been previously defined
-	 # as a COMPONENT arg to install.
-	 cpack_add_component(${TARGET}_${lang} DESCRIPTION ${DESC_IN} GROUP ${GROUP_IN})
-      endif()
-      foreach(lib ${${TARGET}_ICE_LIBRARIES} ${ASTERISK_SCF_ICE_LIBRARIES_${lang}})
-	if(UNIX)
-	  list(APPEND target_libs "${lib}")
-	else()
-	  list(APPEND target_libs "${ICE_${lang}_LIB_${lib}}")
-	endif()
-      endforeach()
-      if(target_libs)
-	target_link_libraries(${TARGET}_${lang} ${target_libs})
-      endif()
-      if(APPLE)
-	target_link_libraries(${TARGET}_${lang} ${ICE_CXX_LIB_IceUtil})
-	target_link_libraries(${TARGET}_${lang} ${ICE_CXX_LIB_ZeroCIce})
-      endif()
-      if(target_dependencies)
-	message(STATUS "Linking ${TARGET}_${lang} to ${target_dependencies}")
-	target_link_libraries(${TARGET}_${lang} ${target_dependencies})
-	add_dependencies(${TARGET}_${lang} ${target_dependencies})
-      endif()
-      if(UNIX)
-	set_target_properties(${TARGET}_${lang} PROPERTIES COMPILE_FLAGS "-fPIC")
-      endif()
-      set_cache_var(ASTERISK_SCF_SLICE_${TARGET}_CXX_INCLUDE_DIRS ${CMAKE_CURRENT_BINARY_DIR} ${target_CXX_includes})
-    endif()
-    set_cache_var(ASTERISK_SCF_SLICE_${TARGET}_${lang} Bob)
-  endforeach()
+    foreach(lang ${ASTERISK_SCF_PROJECT_LANGUAGES})
+        unset(generated_files)
+        unset(target_dependencies)
+        unset(source_dependencies)
+        unset(raw_dependencies)
+        unset(target_libs)
+        unset(slice_export_arguments)
+        if(lang STREQUAL "Java")
+            message(STATUS "Building Slice target ${TARGET} as Java classes")
+        elseif(lang STREQUAL "CSharp")
+            message(STATUS "Building Slice target ${TARGET} as a CSharp assembly")
+            set(compiler slice2cs)
+            set(suffixes cs)
+        elseif(lang STREQUAL "CXX")
+            message(STATUS "Building Slice target ${TARGET} as a CXX library")
+            set(compiler slice2cpp)
+            set(suffixes cpp h)
+            include_directories("${CMAKE_CURRENT_BINARY_DIR}")
+        else()
+            message(FATAL_ERROR "Unsupported Slice compiled language ${lang}")
+        endif()
+
+        if(NOT SLICE_COMPILER_${lang})
+            # Find the actual Slice compiler
+            find_program(SLICE_COMPILER_${lang} ${compiler} PATHS "${ICE_DIR}/bin" NO_DEFAULT_PATH)
+
+            # If we fail to find it we have to abort here, we can go no further
+            if(SLICE_COMPILER_${lang})
+	        message(STATUS "Found Slice compiler for ${lang} at ${SLICE_COMPILER_${lang}}")
+            else()
+	        message(FATAL_ERROR "Failed to find Slice compiler ${compiler}")
+            endif()
+        endif()
+
+        # Look for the dependencies for this slice definition, we have to do it now since the target was just added
+        message(STATUS "Determining dependencies for Slice target ${TARGET}")
+        execute_process(COMMAND ${SLICE_COMPILER_${lang}} ${slice_compiler_arguments}
+	    --depend ${slice_files} OUTPUT_VARIABLE raw_dependencies
+	    ERROR_VARIABLE slice_errors)
+        if(slice_errors)
+            message(FATAL_ERROR "Slice compiler produced errors:\n ${slice_errors}")
+        endif()
+
+        if(raw_dependencies)
+            # The next block of stuff sanitizes the output we got from the slice compiler into a non-Makefile specific foo
+            # Get rid of all the \ characters
+            string(REPLACE "\\" "" raw_dependencies "${raw_dependencies}")
+            # Turn the newlines into CMake list item separators, since the compiler spits out one dependency per line
+            string(REPLACE "\n" ";" raw_dependencies "${raw_dependencies}")
+            string(REPLACE " ;" ";" raw_dependencies "${raw_dependencies}")
+            string(REPLACE "; " ";" raw_dependencies "${raw_dependencies}")
+            # Remove the first item, since it is a Makefile target name, not a dependency
+            list(REMOVE_AT raw_dependencies 0)
+
+            foreach(dep ${raw_dependencies})
+	        # Convert the path into a cmake one so we can absolutely get the filename
+	        file(TO_CMAKE_PATH ${dep} dep)
+	        file(RELATIVE_PATH relpath "${CMAKE_SOURCE_DIR}" "${dep}")
+	        string(REPLACE "/" "_" file_variable "${relpath}")
+	        set(dep_target ${TARGET_${file_variable}})
+	        if(dep_target)
+	            # If this is not already us add it as a dependency
+	            if(NOT dep_target STREQUAL ${TARGET})
+	                message(STATUS "Auto-adding dependency on Slice target ${dep_target} to ${TARGET} for ${lang} language")
+	                list(APPEND source_dependencies ${dep})
+	                list(APPEND target_dependencies ${dep_target}_${lang})
+	                list(APPEND target_CXX_includes ${ASTERISK_SCF_SLICE_${dep_target}_CXX_INCLUDE_DIRS})
+	            endif()
+	        else()
+	            # Remember sources that are not associated with targets too
+	            message(STATUS "Auto-adding dependency on Slice source ${dep} to ${TARGET} for ${lang} language")
+	            list(APPEND source_dependencies ${dep})
+	        endif()
+            endforeach()
+        endif()
+
+        foreach(file ${slice_files})
+            foreach(suffix ${suffixes})
+	        get_filename_component(source "${file}" NAME_WE)
+	        list(APPEND generated_files "${CMAKE_CURRENT_BINARY_DIR}/${source}.${suffix}")
+            endforeach()
+        endforeach()
+
+        set_source_files_properties(${generated_files} PROPERTIES GENERATED 1)
+
+        # create a preprocessor definition in the generated CXX files that enables
+        # the generated classes to be exported from the library (only necessary on Windows)
+        # the definition for a target named 'FOO' will be 'FOO_CXX_EXPORTS', and if this
+        # preprocessor macro is defined, then the Slice-generated classes will be marked
+        # with 'dllexport'. add_library() (used below) automatically generates a definition
+        # for the appropriately-named macro when the library is built in SHARED mode.
+        if(WIN32 AND lang STREQUAL "CXX")
+            list(APPEND slice_export_arguments "--dll-export" "${TARGET}_${lang}")
+        endif()
+
+        add_custom_command(
+            OUTPUT ${generated_files}
+            COMMAND ${SLICE_COMPILER_${lang}} ${slice_compiler_arguments} ${slice_export_arguments} ${slice_files}
+            COMMENT "Building ${TARGET} from ${slice_files} using ${compiler}"
+            DEPENDS ${slice_files} ${source_dependencies}
+            )
+
+        if(target_CXX_includes)
+            list(REMOVE_DUPLICATES target_CXX_includes)
+        endif()
+
+        if(lang STREQUAL "Java")
+        elseif(lang STREQUAL "CSharp")
+            # Note that slice_files are included as sources here even though they won't be compiled
+            # by the actual compiler; this is to get them to show up as sources in the project
+            # created for this target
+            foreach(lib ${${TARGET}_ICE_LIBRARIES} ${ASTERISK_SCF_ICE_LIBRARIES_${lang}})
+	        if(UNIX)
+	            list(APPEND target_libs "${lib}")
+	        else()
+	            list(APPEND target_libs "${ICE_${lang}_LIB_${lib}}")
+	        endif()
+            endforeach()
+            csharp_add_library(${TARGET}_${lang} ${generated_files} ${slice_files}
+		REFERENCES "${ICE_CSharp_LIB_Ice}" ${target_libs} ${target_dependencies})
+        elseif(lang STREQUAL "CXX")
+            # Note that slice_files are included as sources here even though they won't be compiled
+            # by the actual compiler; this is to get them to show up as sources in the project
+            # created for this target
+            include_directories(${target_CXX_includes})
+            add_library(${TARGET}_${lang} ${generated_files} ${slice_files})
+            install(TARGETS ${TARGET}_${lang} DESTINATION ${DIR_IN} COMPONENT ${TARGET}_${lang})
+            if(ASTERISKSCF_CPACK)
+	        # Adds a component to the packager. The first arg must have been previously defined
+	        # as a COMPONENT arg to install.
+	        cpack_add_component(${TARGET}_${lang} DESCRIPTION ${DESC_IN} GROUP ${GROUP_IN})
+            endif()
+            foreach(lib ${${TARGET}_ICE_LIBRARIES} ${ASTERISK_SCF_ICE_LIBRARIES_${lang}})
+	        if(UNIX)
+	            list(APPEND target_libs "${lib}")
+	        else()
+	            list(APPEND target_libs "${ICE_${lang}_LIB_${lib}}")
+	        endif()
+            endforeach()
+            if(target_libs)
+	        target_link_libraries(${TARGET}_${lang} ${target_libs})
+            endif()
+            if(APPLE)
+	        target_link_libraries(${TARGET}_${lang} ${ICE_CXX_LIB_IceUtil})
+	        target_link_libraries(${TARGET}_${lang} ${ICE_CXX_LIB_ZeroCIce})
+            endif()
+            if(target_dependencies)
+	        message(STATUS "Linking ${TARGET}_${lang} to ${target_dependencies}")
+	        target_link_libraries(${TARGET}_${lang} ${target_dependencies})
+	        add_dependencies(${TARGET}_${lang} ${target_dependencies})
+            endif()
+            if(UNIX)
+	        set_target_properties(${TARGET}_${lang} PROPERTIES COMPILE_FLAGS "-fPIC")
+            endif()
+            set_cache_var(ASTERISK_SCF_SLICE_${TARGET}_CXX_INCLUDE_DIRS ${CMAKE_CURRENT_BINARY_DIR} ${target_CXX_includes})
+        endif()
+        set_cache_var(ASTERISK_SCF_SLICE_${TARGET}_${lang} Bob)
+    endforeach()
 endfunction()
 
 # Function which initializes a component for building
 function(asterisk_scf_component_init COMPONENT LANG)
-  message(STATUS "Setting up to build component ${COMPONENT}")
-  set(ASTERISK_SCF_${COMPONENT}_LANG ${LANG} PARENT_SCOPE)
+    message(STATUS "Setting up to build component ${COMPONENT}")
+    set(ASTERISK_SCF_${COMPONENT}_LANG ${LANG} PARENT_SCOPE)
 endfunction()
 
 # Function which adds the compiled Slice targets to a component to be built
 function(asterisk_scf_component_add_slice COMPONENT)
-  if(NOT ARGN)
-    message(FATAL_ERROR "You must pass at least one Slice target to this function")
-  endif()
-  if(NOT ASTERISK_SCF_${COMPONENT}_LANG)
-    message(FATAL_ERROR "Must call asterisk_scf_component_init for component ${COMPONENT} before asterisk_scf_component_add_slice")
-  endif()
-  set(slice_list ${${COMPONENT}_SLICES})
-  foreach(slice ${ARGN})
-    get_filename_component(f ${slice} NAME_WE)
-    if(NOT ASTERISK_SCF_SLICE_${f}_${ASTERISK_SCF_${COMPONENT}_LANG})
-      message(FATAL_ERROR "Must call asterisk_scf_compile_slice for ${f} before asterisk_scf_component_add_slice")
-    endif()
-    message(STATUS "Adding Slice ${f} to component ${COMPONENT}")
-    list(APPEND slice_list ${f}_${ASTERISK_SCF_${COMPONENT}_LANG})
-    if(ASTERISK_SCF_${COMPONENT}_LANG STREQUAL "CXX")
-      list(APPEND include_dirs ${ASTERISK_SCF_SLICE_${slice}_CXX_INCLUDE_DIRS})
-    endif()
-  endforeach()
-  list(REMOVE_DUPLICATES slice_list)
-  set(${COMPONENT}_SLICES ${slice_list} PARENT_SCOPE)
-  if(include_dirs)
-    list(REMOVE_DUPLICATES include_dirs)
-    include_directories(${include_dirs})
-  endif()
+    if(NOT ARGN)
+        message(FATAL_ERROR "You must pass at least one Slice target to this function")
+    endif()
+    if(NOT ASTERISK_SCF_${COMPONENT}_LANG)
+        message(FATAL_ERROR "Must call asterisk_scf_component_init for component ${COMPONENT} before asterisk_scf_component_add_slice")
+    endif()
+    set(slice_list ${${COMPONENT}_SLICES})
+    foreach(slice ${ARGN})
+        get_filename_component(f ${slice} NAME_WE)
+        if(NOT ASTERISK_SCF_SLICE_${f}_${ASTERISK_SCF_${COMPONENT}_LANG})
+            message(FATAL_ERROR "Must call asterisk_scf_compile_slice for ${f} before asterisk_scf_component_add_slice")
+        endif()
+        message(STATUS "Adding Slice ${f} to component ${COMPONENT}")
+        list(APPEND slice_list ${f}_${ASTERISK_SCF_${COMPONENT}_LANG})
+        if(ASTERISK_SCF_${COMPONENT}_LANG STREQUAL "CXX")
+            list(APPEND include_dirs ${ASTERISK_SCF_SLICE_${slice}_CXX_INCLUDE_DIRS})
+        endif()
+    endforeach()
+    list(REMOVE_DUPLICATES slice_list)
+    set(${COMPONENT}_SLICES ${slice_list} PARENT_SCOPE)
+    if(include_dirs)
+        list(REMOVE_DUPLICATES include_dirs)
+        include_directories(${include_dirs})
+    endif()
 endfunction()
 
 # Function which adds source or header files to a component to be built
 function(asterisk_scf_component_add_file COMPONENT)
-  if(NOT ARGN)
-    message(FATAL_ERROR "You must pass at least one source file to this function")
-  endif()
-  message(STATUS "Adding ${ARGN} to component ${COMPONENT}")
-  set(file_list ${${COMPONENT}_SOURCES})
-  foreach(file ${ARGN})
-    list(APPEND file_list ${CMAKE_CURRENT_SOURCE_DIR}/${file})
-    if(ASTERISK_SCF_${COMPONENT}_LANG STREQUAL "CXX" AND CMAKE_COMPILER_IS_GNUCXX AND CMAKE_BUILD_TYPE STREQUAL Debug)
-      set_source_files_properties(${file} COMPILE_FLAGS "-Wall -Werror")
-    endif()
-  endforeach()
-  list(REMOVE_DUPLICATES file_list)
-  set(${COMPONENT}_SOURCES ${file_list} PARENT_SCOPE)
+    if(NOT ARGN)
+        message(FATAL_ERROR "You must pass at least one source file to this function")
+    endif()
+    message(STATUS "Adding ${ARGN} to component ${COMPONENT}")
+    set(file_list ${${COMPONENT}_SOURCES})
+    foreach(file ${ARGN})
+        list(APPEND file_list ${CMAKE_CURRENT_SOURCE_DIR}/${file})
+        if(ASTERISK_SCF_${COMPONENT}_LANG STREQUAL "CXX" AND CMAKE_COMPILER_IS_GNUCXX AND CMAKE_BUILD_TYPE STREQUAL Debug)
+            set_source_files_properties(${file} COMPILE_FLAGS "-Wall -Werror")
+        endif()
+    endforeach()
+    list(REMOVE_DUPLICATES file_list)
+    set(${COMPONENT}_SOURCES ${file_list} PARENT_SCOPE)
 endfunction()
 
 # Function which adds Ice libraries needed by a component
 function(asterisk_scf_component_add_ice_libraries COMPONENT)
-  if(NOT ARGN)
-    message(FATAL_ERROR "You must pass at least one library to this function")
-  endif()
-  set(libs ${${COMPONENT}_ICE_LIBRARIES})
-  foreach(lib ${ARGN})
-    set(lang ${ASTERISK_SCF_${COMPONENT}_LANG})
-    if(lang STREQUAL "Java")
-      find_ICE_Java_library(${lib})
-    elseif(lang STREQUAL "CSharp")
-      find_ICE_CSharp_library(${lib})
-    elseif(lang STREQUAL "CXX")
-      find_ICE_CXX_library(${lib})
-    endif()
-    list(APPEND libs ${lib})
-  endforeach()
-  list(REMOVE_DUPLICATES libs)
-  set(${COMPONENT}_ICE_LIBRARIES ${libs} PARENT_SCOPE)
+    if(NOT ARGN)
+        message(FATAL_ERROR "You must pass at least one library to this function")
+    endif()
+    set(libs ${${COMPONENT}_ICE_LIBRARIES})
+    foreach(lib ${ARGN})
+        set(lang ${ASTERISK_SCF_${COMPONENT}_LANG})
+        if(lang STREQUAL "Java")
+            find_ICE_Java_library(${lib})
+        elseif(lang STREQUAL "CSharp")
+            find_ICE_CSharp_library(${lib})
+        elseif(lang STREQUAL "CXX")
+            find_ICE_CXX_library(${lib})
+        endif()
+        list(APPEND libs ${lib})
+    endforeach()
+    list(REMOVE_DUPLICATES libs)
+    set(${COMPONENT}_ICE_LIBRARIES ${libs} PARENT_SCOPE)
 endfunction()
 
 # 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})
-  foreach(lib ${ARGN})
-    set(lang ${ASTERISK_SCF_${COMPONENT}_LANG})
-    if(lang STREQUAL "CXX")
-    else()
-      message(FATAL_ERROR "Boost libraries cannot be used with components in the ${lang} language")
-    endif()
-    find_Boost_library(${lib})
-    list(APPEND libs ${lib})
-  endforeach()
-  list(REMOVE_DUPLICATES libs)
-  set(${COMPONENT}_BOOST_LIBRARIES ${libs} PARENT_SCOPE)
-  include_directories(${Boost_INCLUDE_DIR})
-  link_directories(${Boost_LIBRARY_DIRS})
+    if(NOT ARGN)
+        message(FATAL_ERROR "You must pass at least one library to this function")
+    endif()
+    set(libs ${${COMPONENT}_BOOST_LIBRARIES})
+    foreach(lib ${ARGN})
+        set(lang ${ASTERISK_SCF_${COMPONENT}_LANG})
+        if(lang STREQUAL "CXX")
+        else()
+            message(FATAL_ERROR "Boost libraries cannot be used with components in the ${lang} language")
+        endif()
+        find_Boost_library(${lib})
+        list(APPEND libs ${lib})
+    endforeach()
+    list(REMOVE_DUPLICATES libs)
+    set(${COMPONENT}_BOOST_LIBRARIES ${libs} PARENT_SCOPE)
+    include_directories(${Boost_INCLUDE_DIR})
+    link_directories(${Boost_LIBRARY_DIRS})
 endfunction()
 
 # Function which builds a component as an IceBox service
 function(asterisk_scf_component_build_icebox COMPONENT)
-  set(lang ${ASTERISK_SCF_${COMPONENT}_LANG})
-  message(STATUS "Building component ${COMPONENT} (${lang}) as IceBox service")
-  if(lang STREQUAL "CXX")
-    find_ICE_CXX_library(IceBox)
-  elseif(lang STREQUAL "CSharp")
-    find_ICE_CSharp_library(IceBox)
-  elseif(lang STREQUAL "Java")
-    find_ICE_Java_library(IceBox)
-  else()
-    message(FATAL_ERROR "IceBox services are not supported in the ${lang} language")
-  endif()
-  list(APPEND icelibs IceBox ${ASTERISK_SCF_ICE_LIBRARIES_${lang}} ${${COMPONENT}_ICE_LIBRARIES})
-  list(REMOVE_DUPLICATES icelibs)
-  foreach(lib ${icelibs})
-    if(UNIX)
-      list(APPEND target_libs "${lib}")
+    set(lang ${ASTERISK_SCF_${COMPONENT}_LANG})
+    message(STATUS "Building component ${COMPONENT} (${lang}) as IceBox service")
+    if(lang STREQUAL "CXX")
+        find_ICE_CXX_library(IceBox)
+    elseif(lang STREQUAL "CSharp")
+        find_ICE_CSharp_library(IceBox)
+    elseif(lang STREQUAL "Java")
+        find_ICE_Java_library(IceBox)
     else()
-      list(APPEND target_libs "${ICE_${lang}_LIB_${lib}}")
-    endif()
-  endforeach()
-
-  if(lang STREQUAL "CXX")
-    # Now we actually create the library
-    # while one would think that MODULE would be the right setting, it
-    # has to be shared due to how icebox finds these libraries on a Mac
-    # (it loads .dylib instead of loading .so)
-    add_library(${COMPONENT} SHARED ${${COMPONENT}_SOURCES})
-    # Link required libraries and Slice libraries
-    list(APPEND boostlibs ${ASTERISK_SCF_BOOST_LIBRARIES} ${${COMPONENT}_BOOST_LIBRARIES})
-    if(boostlibs)
-      list(REMOVE_DUPLICATES boostlibs)
-      foreach(lib ${boostlibs})
-	if(UNIX)
-	  if(NOT "core" STREQUAL "${lib}")
-	    list(APPEND target_libs "boost_${lib}")
-	  endif()
-	  link_directories(${Boost_LIBRARY_DIRS})
-	else()
-	  string(TOUPPER ${lib} libtag)
-	  list(APPEND target_libs "${Boost_${libtag}_LIBRARY}")
-	endif()
-      endforeach()
-    endif()
-    if(UNIX)
-      list(FIND target_libs Ice _Ice_FOUND)
-      if(_Ice_FOUND GREATER -1)
-        list(APPEND target_libs "IceUtil")
-	list(APPEND target_libs "pthread")
-      endif()
-    endif()
-    target_link_libraries(${COMPONENT} ${${COMPONENT}_SLICES} ${target_libs})
-  elseif(lang STREQUAL "CSharp")
-    csharp_add_library(${COMPONENT} ${${COMPONENT}_SOURCES} REFERENCES ${${COMPONENT}_SLICES} ${target_libs})
-  endif()
+        message(FATAL_ERROR "IceBox services are not supported in the ${lang} language")
+    endif()
+    list(APPEND icelibs IceBox ${ASTERISK_SCF_ICE_LIBRARIES_${lang}} ${${COMPONENT}_ICE_LIBRARIES})
+    list(REMOVE_DUPLICATES icelibs)
+    foreach(lib ${icelibs})
+        if(UNIX)
+            list(APPEND target_libs "${lib}")
+        else()
+            list(APPEND target_libs "${ICE_${lang}_LIB_${lib}}")
+        endif()
+    endforeach()
+
+    if(lang STREQUAL "CXX")
+        # Now we actually create the library
+        # while one would think that MODULE would be the right setting, it
+        # has to be shared due to how icebox finds these libraries on a Mac
+        # (it loads .dylib instead of loading .so)
+        add_library(${COMPONENT} SHARED ${${COMPONENT}_SOURCES})
+        # Link required libraries and Slice libraries
+        list(APPEND boostlibs ${ASTERISK_SCF_BOOST_LIBRARIES} ${${COMPONENT}_BOOST_LIBRARIES})
+        if(boostlibs)
+            list(REMOVE_DUPLICATES boostlibs)
+            foreach(lib ${boostlibs})
+	        if(UNIX)
+	            if(NOT "core" STREQUAL "${lib}")
+	                list(APPEND target_libs "boost_${lib}")
+	            endif()
+	            link_directories(${Boost_LIBRARY_DIRS})
+	        else()
+	            string(TOUPPER ${lib} libtag)
+	            list(APPEND target_libs "${Boost_${libtag}_LIBRARY}")
+	        endif()
+            endforeach()
+        endif()
+        if(UNIX)
+            list(FIND target_libs Ice _Ice_FOUND)
+            if(_Ice_FOUND GREATER -1)
+                list(APPEND target_libs "IceUtil")
+	        list(APPEND target_libs "pthread")
+            endif()
+        endif()
+        target_link_libraries(${COMPONENT} ${${COMPONENT}_SLICES} ${target_libs})
+    elseif(lang STREQUAL "CSharp")
+        csharp_add_library(${COMPONENT} ${${COMPONENT}_SOURCES} REFERENCES ${${COMPONENT}_SLICES} ${target_libs})
+    endif()
 endfunction()
 
 # Function which builds a component standalone
 function(asterisk_scf_component_build_standalone COMPONENT)
-  set(lang ${ASTERISK_SCF_${COMPONENT}_LANG})
-  message(STATUS "Building component ${COMPONENT} (${lang}) as standalone executable")
-  list(APPEND icelibs ${ASTERISK_SCF_ICE_LIBRARIES_${lang}} ${${COMPONENT}_ICE_LIBRARIES})
-  list(REMOVE_DUPLICATES icelibs)
-  foreach(lib ${icelibs})
-    if(UNIX)
-      list(APPEND target_libs "${lib}")
-    else()
-      list(APPEND target_libs "${ICE_${lang}_LIB_${lib}}")
-    endif()
-  endforeach()
-
-  if(lang STREQUAL "CXX")
-    # Now we actually create the component
-    add_executable(${COMPONENT} ${${COMPONENT}_SOURCES})
-    # Link required libraries and Slice libraries
-    list(APPEND boostlibs ${ASTERISK_SCF_BOOST_LIBRARIES} ${${COMPONENT}_BOOST_LIBRARIES})
-    if(boostlibs)
-      list(REMOVE_DUPLICATES boostlibs)
-      foreach(lib ${boostlibs})
-	if(UNIX)
-	  if(NOT "core" STREQUAL "${lib}")
-	    list(APPEND target_libs "boost_${lib}")
-	  endif()
-	  link_directories(${Boost_LIBRARY_DIRS})
-	else()
-	  string(TOUPPER ${lib} libtag)
-	  list(APPEND target_libs "${Boost_${libtag}_LIBRARY}")
-	endif()
-      endforeach()
-    endif()
-    if(UNIX)
-      list(FIND target_libs Ice _Ice_FOUND)
-      if(_Ice_FOUND GREATER -1)
-        list(APPEND target_libs "IceUtil")
-        list(APPEND target_libs "pthread")
-      endif()
-    endif()
-    target_link_libraries(${COMPONENT} ${${COMPONENT}_SLICES} ${target_libs})
-  elseif(lang STREQUAL "CSharp")
-    csharp_add_executable(${COMPONENT} ${${COMPONENT}_SOURCES} REFERENCES ${${COMPONENT}_SLICES} ${target_libs})
-  endif()
+    set(lang ${ASTERISK_SCF_${COMPONENT}_LANG})
+    message(STATUS "Building component ${COMPONENT} (${lang}) as standalone executable")
+    list(APPEND icelibs ${ASTERISK_SCF_ICE_LIBRARIES_${lang}} ${${COMPONENT}_ICE_LIBRARIES})
+    list(REMOVE_DUPLICATES icelibs)
+    foreach(lib ${icelibs})
+        if(UNIX)
+            list(APPEND target_libs "${lib}")
+        else()
+            list(APPEND target_libs "${ICE_${lang}_LIB_${lib}}")
+        endif()
+    endforeach()
+
+    if(lang STREQUAL "CXX")
+        # Now we actually create the component
+        add_executable(${COMPONENT} ${${COMPONENT}_SOURCES})
+        # Link required libraries and Slice libraries
+        list(APPEND boostlibs ${ASTERISK_SCF_BOOST_LIBRARIES} ${${COMPONENT}_BOOST_LIBRARIES})
+        if(boostlibs)
+            list(REMOVE_DUPLICATES boostlibs)
+            foreach(lib ${boostlibs})
+	        if(UNIX)
+	            if(NOT "core" STREQUAL "${lib}")
+	                list(APPEND target_libs "boost_${lib}")
+	            endif()
+	            link_directories(${Boost_LIBRARY_DIRS})
+	        else()
+	            string(TOUPPER ${lib} libtag)
+	            list(APPEND target_libs "${Boost_${libtag}_LIBRARY}")
+	        endif()
+            endforeach()
+        endif()
+        if(UNIX)
+            list(FIND target_libs Ice _Ice_FOUND)
+            if(_Ice_FOUND GREATER -1)
+                list(APPEND target_libs "IceUtil")
+                list(APPEND target_libs "pthread")
+            endif()
+        endif()
+        target_link_libraries(${COMPONENT} ${${COMPONENT}_SLICES} ${target_libs})
+    elseif(lang STREQUAL "CSharp")
+        csharp_add_executable(${COMPONENT} ${${COMPONENT}_SOURCES} REFERENCES ${${COMPONENT}_SLICES} ${target_libs})
+    endif()
 endfunction()
 
 function(asterisk_scf_component_build_library COMPONENT)
-  set(lang ${ASTERISK_SCF_${COMPONENT}_LANG})
-  message(STATUS "Building component ${COMPONENT} (${lang}) as standalone executable")
-  list(APPEND icelibs ${ASTERISK_SCF_ICE_LIBRARIES_${lang}} ${${COMPONENT}_ICE_LIBRARIES})
-
-  list(LENGTH icelibs numicelibs)
-  if(numicelibs GREATER 0)
-     list(REMOVE_DUPLICATES icelibs)
-  endif()
-
-  foreach(lib ${icelibs})
-    if(UNIX)
-      list(APPEND target_libs "${lib}")
-    else()
-      list(APPEND target_libs "${ICE_${lang}_LIB_${lib}}")
-    endif()
-  endforeach()
-
-  if(lang STREQUAL "CXX")
-    # Now we actually create the component
-    add_library(${COMPONENT} ${${COMPONENT}_SOURCES})
-    # Link required libraries and Slice libraries
-    list(APPEND boostlibs ${ASTERISK_SCF_BOOST_LIBRARIES} ${${COMPONENT}_BOOST_LIBRARIES})
-    if(boostlibs)
-      list(REMOVE_DUPLICATES boostlibs)
-      foreach(lib ${boostlibs})
-	if(UNIX)
-	  if(NOT "core" STREQUAL "${lib}")
-	    list(APPEND target_libs "boost_${lib}")
-	  endif()
-	  link_directories(${Boost_LIBRARY_DIRS})
-	else()
-	  string(TOUPPER ${lib} libtag)
-	  list(APPEND target_libs "${Boost_${libtag}_LIBRARY}")
-	endif()
-      endforeach()
-    endif()
-    target_link_libraries(${COMPONENT} ${${COMPONENT}_SLICES} ${target_libs})
-  elseif(lang STREQUAL "CSharp")
-    csharp_add_library(${COMPONENT} ${${COMPONENT}_SOURCES} REFERENCES ${${COMPONENT}_SLICES} ${target_libs})
-  endif()
+    set(lang ${ASTERISK_SCF_${COMPONENT}_LANG})
+    message(STATUS "Building component ${COMPONENT} (${lang}) as standalone executable")
+    list(APPEND icelibs ${ASTERISK_SCF_ICE_LIBRARIES_${lang}} ${${COMPONENT}_ICE_LIBRARIES})
+
+    list(LENGTH icelibs numicelibs)
+    if(numicelibs GREATER 0)
+        list(REMOVE_DUPLICATES icelibs)
+    endif()
+
+    foreach(lib ${icelibs})
+        if(UNIX)
+            list(APPEND target_libs "${lib}")
+        else()
+            list(APPEND target_libs "${ICE_${lang}_LIB_${lib}}")
+        endif()
+    endforeach()
+
+    if(lang STREQUAL "CXX")
+        # Now we actually create the component
+        add_library(${COMPONENT} ${${COMPONENT}_SOURCES})
+        # Link required libraries and Slice libraries
+        list(APPEND boostlibs ${ASTERISK_SCF_BOOST_LIBRARIES} ${${COMPONENT}_BOOST_LIBRARIES})
+        if(boostlibs)
+            list(REMOVE_DUPLICATES boostlibs)
+            foreach(lib ${boostlibs})
+	        if(UNIX)
+	            if(NOT "core" STREQUAL "${lib}")
+	                list(APPEND target_libs "boost_${lib}")
+	            endif()
+	            link_directories(${Boost_LIBRARY_DIRS})
+	        else()
+	            string(TOUPPER ${lib} libtag)
+	            list(APPEND target_libs "${Boost_${libtag}_LIBRARY}")
+	        endif()
+            endforeach()
+        endif()
+        target_link_libraries(${COMPONENT} ${${COMPONENT}_SLICES} ${target_libs})
+    elseif(lang STREQUAL "CSharp")
+        csharp_add_library(${COMPONENT} ${${COMPONENT}_SOURCES} REFERENCES ${${COMPONENT}_SLICES} ${target_libs})
+    endif()
 endfunction()
 
 # Function which adds information for installing a component
 function(asterisk_scf_component_install COMPONENTNAME TYPE DIR DESC GROUP)
-  install(TARGETS ${COMPONENTNAME} ${TYPE} DESTINATION ${DIR} COMPONENT ${COMPONENTNAME} ${ARGN})
+    install(TARGETS ${COMPONENTNAME} ${TYPE} DESTINATION ${DIR} COMPONENT ${COMPONENTNAME} ${ARGN})
 
-   if(ASTERISKSCF_CPACK)
-      asterisk_scf_component_package(${COMPONENTNAME} ${DESC} ${GROUP})
-   endif()
+    if(ASTERISKSCF_CPACK)
+        asterisk_scf_component_package(${COMPONENTNAME} ${DESC} ${GROUP})
+    endif()
 endfunction()
 
 # Adds a component to the packager. COMPONENTNAME must have been previously defined
 # via the install command.
 function(asterisk_scf_component_package COMPONENTNAME DESC GROUPNAME)
-      cpack_add_component(${COMPONENTNAME} DESCRIPTION ${DESC} GROUP ${GROUP})
+    cpack_add_component(${COMPONENTNAME} DESCRIPTION ${DESC} GROUP ${GROUP})
 endfunction()
 
 # Adds a boost test executable to CTest.  These executable will be run
 # with 'make test' @param EXE - boost test executable.  Probably built
 # using asterisk_scf_component_build_standalone.
 function(boost_add_test EXE)
-   add_test(NAME ${EXE} COMMAND ${EXE}
-      --report_sink=${CMAKE_BINARY_DIR}/${EXE}-result.xml
-      --report_format=XML --report_level=detailed)
+    add_test(NAME ${EXE} COMMAND ${EXE}
+        --report_sink=${CMAKE_BINARY_DIR}/${EXE}-result.xml
+        --report_format=XML --report_level=detailed)
 endfunction()
 
 function(icebox_add_test NAME CONFIG)
-   add_test(NAME ${NAME} COMMAND ${ICEBOX} --Ice.Config=${CONFIG})
+    add_test(NAME ${NAME} COMMAND ${ICEBOX} --Ice.Config=${CONFIG})
 endfunction()

commit 5d28e94e0f3e7f7b1a73b8c4922083d4ece5d46d
Author: David M. Lee <dlee at digium.com>
Date:   Wed Nov 3 14:09:00 2010 -0500

    Fixed solaris build: specify boost libs using -l

diff --git a/AsteriskSCF.cmake b/AsteriskSCF.cmake
index dd0017a..b9df95a 100644
--- a/AsteriskSCF.cmake
+++ b/AsteriskSCF.cmake
@@ -794,8 +794,15 @@ function(asterisk_scf_component_build_icebox COMPONENT)
     if(boostlibs)
       list(REMOVE_DUPLICATES boostlibs)
       foreach(lib ${boostlibs})
-	string(TOUPPER ${lib} libtag)
-	list(APPEND target_libs "${Boost_${libtag}_LIBRARY}")
+	if(UNIX)
+	  if(NOT "core" STREQUAL "${lib}")
+	    list(APPEND target_libs "boost_${lib}")
+	  endif()
+	  link_directories(${Boost_LIBRARY_DIRS})
+	else()
+	  string(TOUPPER ${lib} libtag)
+	  list(APPEND target_libs "${Boost_${libtag}_LIBRARY}")
+	endif()
       endforeach()
     endif()
     if(UNIX)
@@ -833,8 +840,15 @@ function(asterisk_scf_component_build_standalone COMPONENT)
     if(boostlibs)
       list(REMOVE_DUPLICATES boostlibs)
       foreach(lib ${boostlibs})
-	string(TOUPPER ${lib} libtag)
-	list(APPEND target_libs "${Boost_${libtag}_LIBRARY}")
+	if(UNIX)
+	  if(NOT "core" STREQUAL "${lib}")
+	    list(APPEND target_libs "boost_${lib}")
+	  endif()
+	  link_directories(${Boost_LIBRARY_DIRS})
+	else()
+	  string(TOUPPER ${lib} libtag)
+	  list(APPEND target_libs "${Boost_${libtag}_LIBRARY}")
+	endif()
       endforeach()
     endif()
     if(UNIX)
@@ -876,8 +890,15 @@ function(asterisk_scf_component_build_library COMPONENT)
     if(boostlibs)
       list(REMOVE_DUPLICATES boostlibs)
       foreach(lib ${boostlibs})
-	string(TOUPPER ${lib} libtag)
-	list(APPEND target_libs "${Boost_${libtag}_LIBRARY}")
+	if(UNIX)
+	  if(NOT "core" STREQUAL "${lib}")
+	    list(APPEND target_libs "boost_${lib}")
+	  endif()
+	  link_directories(${Boost_LIBRARY_DIRS})
+	else()
+	  string(TOUPPER ${lib} libtag)
+	  list(APPEND target_libs "${Boost_${libtag}_LIBRARY}")
+	endif()
       endforeach()
     endif()
     target_link_libraries(${COMPONENT} ${${COMPONENT}_SLICES} ${target_libs})

commit 2fa7b754cc1b888a78b6c7dee8c1a94b485cd88b
Author: David M. Lee <dlee at digium.com>
Date:   Wed Nov 3 13:52:08 2010 -0500

    Giving up on macports.

diff --git a/AsteriskSCF.cmake b/AsteriskSCF.cmake
index b56e21c..dd0017a 100644
--- a/AsteriskSCF.cmake
+++ b/AsteriskSCF.cmake
@@ -277,14 +277,7 @@ function(asterisk_scf_project NAME ICE_VERSION)
 	set(CMAKE_CXX_FLAGS_DEBUG "-g3 -Wall")
       endif()
       find_ICE_CXX()
-      # On MacPorts, libIce is libZeroCIce.  Everywhere else, it's libIce.
-      string(REGEX MATCH "^/opt/local" matches_macports "${ICE_DIR}")
-      if(APPLE AND matches_macports)
-        find_ICE_CXX_library(ZeroCIce)
-        set(ICE_CXX_LIB_Ice ${ICE_CXX_LIB_ZeroCIce})
-      else()
-	find_ICE_CXX_library(Ice)
-      endif()
+      find_ICE_CXX_library(Ice)
       find_ICE_CXX_library(IceUtil)
       if(WIN32)
 	# On Windows, the IceUtil library must be explicitly linked

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


-- 
asterisk-scf/release/cmake.git



More information about the asterisk-scf-commits mailing list