[asterisk-scf-commits] asterisk-scf/integration/cmake.git branch "icebox-package" created.
Commits to the Asterisk SCF project code repositories
asterisk-scf-commits at lists.digium.com
Tue Mar 22 14:01:39 CDT 2011
branch "icebox-package" has been created
at 63294faf382dbb3be3cdd68e6debfedeacf9b760 (commit)
- Log -----------------------------------------------------------------
commit 63294faf382dbb3be3cdd68e6debfedeacf9b760
Author: Kevin P. Fleming <kpfleming at digium.com>
Date: Tue Mar 22 14:01:07 2011 -0500
Add a package for locating IceBox, and ensure it gets found when needed
by tests for components.
diff --git a/AsteriskSCF.cmake b/AsteriskSCF.cmake
index 576b6bd..34be413 100644
--- a/AsteriskSCF.cmake
+++ b/AsteriskSCF.cmake
@@ -186,6 +186,7 @@ function(asterisk_scf_project NAME ICE_VERSION)
endif()
message(STATUS "Performing requirement checks for components")
+ # set(Ice_DEBUG on)
find_package(Ice 3.4 REQUIRED Ice IceUtil)
# All components need the Ice library, and it needs the
@@ -694,11 +695,13 @@ endfunction()
# with 'make test' @param EXE - boost test executable. Probably built
# using asterisk_scf_component_build_standalone.
function(boost_add_test EXE)
- add_test(NAME ${EXE} COMMAND ${EXE}
- --report_sink=${CMAKE_BINARY_DIR}/${EXE}-result.xml
- --report_format=XML --report_level=detailed)
+ add_test(NAME "${EXE}" COMMAND "${EXE}"
+ "--report_sink=${CMAKE_BINARY_DIR}/${EXE}-result.xml"
+ "--report_format=XML"
+ "--report_level=detailed")
endfunction()
function(icebox_add_test NAME CONFIG)
- add_test(NAME ${NAME} COMMAND ${ICEBOX} --Ice.Config=${CONFIG})
+ find_package(IceBox REQUIRED)
+ add_test(NAME "${NAME}" COMMAND "${ICEBOX_EXECUTABLE}" "--Ice.Config=${CONFIG}")
endfunction()
diff --git a/modules/FindIceBox.cmake b/modules/FindIceBox.cmake
new file mode 100644
index 0000000..c014258
--- /dev/null
+++ b/modules/FindIceBox.cmake
@@ -0,0 +1,96 @@
+#
+# FindIceBox.cmake - a CMake module for using ZeroC IceBox
+#
+# Copyright (C) 2010-2011, Digium, Inc.
+#
+# This program is free software, distributed under the terms of
+# the GNU General Public License Version 2.
+#
+# Usage:
+#
+# This module supports the standard find_package() syntax, including
+# REQUIRED and QUIET. It requires that Ice has been previously found
+# and will fail otherwise. It uses the ICE_DIR set by FindIce.cmake
+# to locate IceBox.
+#
+# Syntax:
+#
+# find_package(IceBox [...])
+#
+# Variables used by this module:
+#
+# Ice_DEBUG If this is set to any value, the module will emit
+# debugging messages as each step of its operations
+# are performed.
+#
+# CMAKE_DEBUG_POSTFIX If this is set to any value, it will be used as a
+# a suffix when searching for a 'debug' version
+# of IceBox.
+#
+# Variables set by this module:
+#
+# ICEBOX_FOUND Will be set if a compatible version of Ice was found
+#
+# ICEBOX_EXECUTABLE The path to the located IceBox program
+
+find_package(PackageHandleStandardArgs)
+find_package(Ice REQUIRED)
+
+function(_ice_set_cache_path var value reason)
+ set("${var}" "${value}" CACHE PATH "${reason}" FORCE)
+ mark_as_advanced(FORCE "${var}")
+endfunction()
+
+function(_ice_set_cache_filepath var value reason)
+ set("${var}" "${value}" CACHE FILEPATH "${reason}" FORCE)
+ mark_as_advanced(FORCE "${var}")
+endfunction()
+
+function(_ice_set_cache_string var value reason)
+ set("${var}" "${value}" CACHE STRING "${reason}" FORCE)
+ mark_as_advanced(FORCE "${var}")
+endfunction()
+
+function(_ice_find_program program)
+ string(TOUPPER "${program}" upper)
+
+ set(_ice_debug_suffix "${CMAKE_DEBUG_POSTFIX}")
+
+ if(WIN32)
+ set(_ice_progdir "bin")
+ if(CMAKE_CL_64)
+ set(_ice_progdir "${_ice_progdir}/x64")
+ endif()
+ # first search the more specified progdir, as used by the .msi installer
+ # if it's not there, try just lib. that's where make install puts it
+ list(APPEND _ice_progdirs "${_ice_progdir}" "bin")
+ elseif(UNIX)
+ list(APPEND _ice_progdirs "bin")
+ endif()
+
+ find_program(ICE_${upper}_PROGRAM_RELEASE NAMES "${program}" NO_DEFAULT_PATH HINTS "${ICE_DIR}" PATH_SUFFIXES ${_ice_progdirs})
+ find_program(ICE_${upper}_PROGRAM_DEBUG NAMES "${program}${_ice_debug_suffix}" NO_DEFAULT_PATH HINTS "${ICE_DIR}" PATH_SUFFIXES ${_ice_progdirs})
+
+ mark_as_advanced(ICE_${upper}_PROGRAM_RELEASE ICE_${upper}_PROGRAM_DEBUG)
+
+ if(ICE_${upper}_PROGRAM_DEBUG OR ICE_${upper}_PROGRAM_RELEASE)
+ _ice_set_cache_string(ICE_${upper}_FOUND ON "The Ice ${program} program was found")
+ endif()
+
+ if(Ice_DEBUG)
+ message(STATUS
+ "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
+ "${program} program (release) found at ${ICE_${upper}_PROGRAM_RELEASE} "
+ "${program} program (debug) found at ${ICE_${upper}_PROGRAM_DEBUG} ")
+ endif()
+endfunction()
+
+_ice_find_program(icebox)
+
+if(CMAKE_BUILD_TYPE STREQUAL debug)
+ _ice_set_cache_filepath(ICEBOX_EXECUTABLE "${ICE_ICEBOX_PROGRAM_DEBUG}" "Path to a program.")
+else()
+ _ice_set_cache_filepath(ICEBOX_EXECUTABLE "${ICE_ICEBOX_PROGRAM_RELEASE}" "Path to a program.")
+endif()
+
+find_package_handle_standard_args(IceBox DEFAULT_MSG ICEBOX_EXECUTABLE)
commit a220f984fea748c185c00c4a13abe5043651f83c
Author: Ken Hunt <ken.hunt at digium.com>
Date: Wed Mar 9 13:38:29 2011 -0600
Added back a dependency on slice2cpp for slice generated code. This was inadvertantly removed.
diff --git a/AsteriskSCF.cmake b/AsteriskSCF.cmake
index 0b4e3b9..576b6bd 100644
--- a/AsteriskSCF.cmake
+++ b/AsteriskSCF.cmake
@@ -585,7 +585,7 @@ function(asterisk_scf_component_add_one_slice COMPONENT SLICE)
COMMAND ${SLICE_COMPILER} ${slice_compiler_arguments} ${SLICE}
--output-dir ${slice_out_dir}
COMMENT "slice2cpp translating ${SLICE}"
- DEPENDS ${sources})
+ DEPENDS ${sources} ${SLICE_COMPILER})
# the Slice and generated_files are sources for the component
list(APPEND ${COMPONENT}_SOURCES ${SLICE} ${generated_files})
commit 08021a0ed0d4eeb3a2daed9e243f70721424dbe8
Author: Ken Hunt <ken.hunt at digium.com>
Date: Wed Mar 9 12:40:06 2011 -0600
Made VS10 the default build target for Windows.
diff --git a/init-cmake.sh b/init-cmake.sh
index 5ccc698..bf71a55 100755
--- a/init-cmake.sh
+++ b/init-cmake.sh
@@ -58,8 +58,8 @@ case $(uname -s)-$(uname -m) in
esac
case $platform in
- win*) # for windows, default to VS9
- cmake_output="Visual Studio 9 2008"
+ win*) # for windows, default to VS10
+ cmake_output="Visual Studio 10"
;;
esac
commit d4d49f5c2496c13ea85561bc6ec4254554c338aa
Author: Ken Hunt <ken.hunt at digium.com>
Date: Wed Mar 9 12:38:28 2011 -0600
Changed slice dependency creation to support spaces and paths, and Drive Letter: paths for Windows.
diff --git a/AsteriskSCF.cmake b/AsteriskSCF.cmake
index 40a0d3b..0b4e3b9 100644
--- a/AsteriskSCF.cmake
+++ b/AsteriskSCF.cmake
@@ -546,12 +546,21 @@ function(asterisk_scf_component_add_one_slice COMPONENT SLICE)
list(APPEND targets ${dep_targets})
# parse sources
- string(REGEX MATCHALL "[^:]+$" dep_sources "${dep}")
+ string(REGEX MATCHALL "^[^:]+" targstart "${dep}")
+ string(REGEX REPLACE "^${targstart}:" "" dep_sources "${dep}")
+ # replace the escaped spaces, leave the space separater.
+ string(REPLACE "\\ " "%20%" dep_sources "${dep_sources}")
string(REGEX MATCHALL "[^ ]+" dep_sources "${dep_sources}")
- list(APPEND sources ${dep_sources})
+ 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_dir}/${target}")
@@ -576,7 +585,7 @@ function(asterisk_scf_component_add_one_slice COMPONENT SLICE)
COMMAND ${SLICE_COMPILER} ${slice_compiler_arguments} ${SLICE}
--output-dir ${slice_out_dir}
COMMENT "slice2cpp translating ${SLICE}"
- DEPENDS ${sources} ${SLICE_COMPILER})
+ DEPENDS ${sources})
# the Slice and generated_files are sources for the component
list(APPEND ${COMPONENT}_SOURCES ${SLICE} ${generated_files})
commit 2e337eb160277d12ca39fb90b7964d6c1f88d2b7
Merge: 3481fad 639375c
Author: Kevin P. Fleming <kpfleming at digium.com>
Date: Tue Feb 8 01:42:35 2011 +0100
Merge branch 'master' of git.asterisk.org:asterisk-scf/release/cmake
commit 3481fad304fb7b1beaeb2bc641e822018c7b8332
Author: Kevin P. Fleming <kpfleming at digium.com>
Date: Mon Feb 7 19:35:42 2011 +0100
Ensure that all Slice translations include
support for streaming, checksums and underscores
in identifiers.
diff --git a/AsteriskSCF.cmake b/AsteriskSCF.cmake
index 08a29a6..9223bea 100644
--- a/AsteriskSCF.cmake
+++ b/AsteriskSCF.cmake
@@ -480,6 +480,12 @@ function(asterisk_scf_component_add_one_slice COMPONENT SLICE)
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)
commit 639375c8195ee691db95dfa038de828b0a8bc08d
Author: David M. Lee <dlee at digium.com>
Date: Mon Feb 7 11:43:16 2011 -0600
Partial fix for Solaris build.
Solaris requires the -pthreads option for compilation. This doesn't fix
all of the problems, but at least it's better.
diff --git a/AsteriskSCF.cmake b/AsteriskSCF.cmake
index 08a29a6..d6f0e55 100644
--- a/AsteriskSCF.cmake
+++ b/AsteriskSCF.cmake
@@ -243,6 +243,10 @@ function(asterisk_scf_project NAME ICE_VERSION)
list(APPEND cxx_flags_profile "-ftest-coverage" "-fprofile-arcs")
endif()
+ if(CMAKE_SYSTEM MATCHES "SunOS.*")
+ list(APPEND cxx_flags "-pthreads")
+ 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})
commit 594a2ff1a1acac8329b3f4c528ea6a2595db4696
Author: David M. Lee <dlee at digium.com>
Date: Tue Jan 25 23:15:26 2011 -0600
Install .lib files on Windows.
diff --git a/AsteriskSCF.cmake b/AsteriskSCF.cmake
index 0f12400..08a29a6 100644
--- a/AsteriskSCF.cmake
+++ b/AsteriskSCF.cmake
@@ -635,10 +635,12 @@ endfunction()
function(asterisk_scf_component_install COMPONENT)
if(${COMPONENT}_TYPE STREQUAL "icebox")
install(TARGETS ${COMPONENT}
+ ARCHIVE DESTINATION ${ASTERISK_SCF_INSTALL_LIB_DIR}
LIBRARY DESTINATION ${ASTERISK_SCF_INSTALL_ICEBOX_DIR}
RUNTIME DESTINATION ${ASTERISK_SCF_INSTALL_ICEBOX_DIR})
else()
install(TARGETS ${COMPONENT}
+ ARCHIVE DESTINATION ${ASTERISK_SCF_INSTALL_LIB_DIR}
LIBRARY DESTINATION ${ASTERISK_SCF_INSTALL_LIB_DIR}
RUNTIME DESTINATION ${ASTERISK_SCF_INSTALL_BIN_DIR})
endif()
commit 08e1c49e418082e11de9f47d1f13dc6161ce4b5f
Author: Kevin P. Fleming <kpfleming at digium.com>
Date: Thu Jan 20 15:35:08 2011 -0600
Ensure that Slice files will be re-translated if the Slice compiler
changes.
diff --git a/AsteriskSCF.cmake b/AsteriskSCF.cmake
index 02ec5ac..0f12400 100644
--- a/AsteriskSCF.cmake
+++ b/AsteriskSCF.cmake
@@ -566,7 +566,7 @@ function(asterisk_scf_component_add_one_slice COMPONENT SLICE)
COMMAND ${SLICE_COMPILER} ${slice_compiler_arguments} ${SLICE}
--output-dir ${slice_out_dir}
COMMENT "slice2cpp translating ${SLICE}"
- DEPENDS ${sources})
+ DEPENDS ${sources} ${SLICE_COMPILER})
# the Slice and generated_files are sources for the component
list(APPEND ${COMPONENT}_SOURCES ${SLICE} ${generated_files})
commit 528c1225b6cf70d78a53d1e0080ee57d8d0d23a4
Author: David M. Lee <dlee at digium.com>
Date: Thu Jan 20 12:33:26 2011 -0600
Refactored out several install functions for installation.
* asterisk_scf_component_install - Install a component
* asterisk_scf_headers_install - Install .h files
* asterisk_scf_slice_headers_install - Install generated .h files
* asterisk_scf_slice_install - Install .ice files
diff --git a/AsteriskSCF.cmake b/AsteriskSCF.cmake
index 8bb0792..02ec5ac 100644
--- a/AsteriskSCF.cmake
+++ b/AsteriskSCF.cmake
@@ -593,6 +593,7 @@ endfunction()
# Function which builds a component as an IceBox service
function(asterisk_scf_component_build_icebox COMPONENT)
message(STATUS "Building component ${COMPONENT} as an IceBox service")
+ set(${COMPONENT}_TYPE icebox PARENT_SCOPE)
find_package(Ice REQUIRED IceBox)
list(APPEND icelibs ${${COMPONENT}_ICE_LIBRARIES} ICEBOX)
asterisk_scf_component_libraries(${COMPONENT})
@@ -606,6 +607,7 @@ endfunction()
# Function which builds a component standalone
function(asterisk_scf_component_build_standalone COMPONENT)
message(STATUS "Building component ${COMPONENT} as a standalone executable")
+ set(${COMPONENT}_TYPE standalone PARENT_SCOPE)
asterisk_scf_component_libraries(${COMPONENT})
# Now we actually create the component
@@ -620,6 +622,7 @@ endfunction()
function(asterisk_scf_component_build_library COMPONENT)
message(STATUS "Building component ${COMPONENT} as a ${${COMPONENT}_LIBTYPE} library")
+ set(${COMPONENT}_TYPE library PARENT_SCOPE)
asterisk_scf_component_libraries(${COMPONENT})
# Now we actually create the component
@@ -628,15 +631,38 @@ function(asterisk_scf_component_build_library COMPONENT)
target_link_libraries(${COMPONENT} ${component_libs})
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})
-
- if(ASTERISKSCF_CPACK)
- asterisk_scf_component_package(${COMPONENTNAME} ${DESC} ${GROUP})
+# Install the given component to their proper location
+function(asterisk_scf_component_install COMPONENT)
+ if(${COMPONENT}_TYPE STREQUAL "icebox")
+ install(TARGETS ${COMPONENT}
+ LIBRARY DESTINATION ${ASTERISK_SCF_INSTALL_ICEBOX_DIR}
+ RUNTIME DESTINATION ${ASTERISK_SCF_INSTALL_ICEBOX_DIR})
+ else()
+ install(TARGETS ${COMPONENT}
+ LIBRARY DESTINATION ${ASTERISK_SCF_INSTALL_LIB_DIR}
+ RUNTIME DESTINATION ${ASTERISK_SCF_INSTALL_BIN_DIR})
endif()
endfunction()
+# Install generated Slice header files to their proper location
+function(asterisk_scf_slice_headers_install)
+ install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/generated/
+ DESTINATION ${ASTERISK_SCF_INSTALL_INCLUDE_DIR}
+ FILES_MATCHING PATTERN "*.h")
+endfunction()
+
+# Install Slice files to their proper location
+function(asterisk_scf_slice_install DIR)
+ install(DIRECTORY ${DIR}
+ DESTINATION ${ASTERISK_SCF_INSTALL_SLICE_DIR}
+ FILES_MATCHING PATTERN "*.ice")
+endfunction()
+
+# Install header files to their proper location
+function(asterisk_scf_headers_install DIR)
+ install(DIRECTORY ${DIR} DESTINATION ${ASTERISK_SCF_INSTALL_INCLUDE_DIR})
+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)
commit 39a22b6e9aa90751277527ef5ca684671d1e764c
Author: David M. Lee <dlee at digium.com>
Date: Thu Jan 20 09:38:00 2011 -0600
Properly specify the CMake project.
diff --git a/AsteriskSCF.cmake b/AsteriskSCF.cmake
index acf6ad3..8bb0792 100644
--- a/AsteriskSCF.cmake
+++ b/AsteriskSCF.cmake
@@ -169,7 +169,6 @@ endmacro()
# Function which initializes project specific things
function(asterisk_scf_project NAME ICE_VERSION)
message(STATUS "Setting up project ${NAME} for Ice version ${ICE_VERSION}")
- project("${NAME}" CXX)
# 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
commit ef6b7876cdaba286e76adc99a1088375b58f7686
Author: David M. Lee <dlee at digium.com>
Date: Thu Jan 20 08:47:02 2011 -0600
Ensure that system and generated includes are marked SYSTEM
diff --git a/AsteriskSCF.cmake b/AsteriskSCF.cmake
index 48bf5e9..acf6ad3 100644
--- a/AsteriskSCF.cmake
+++ b/AsteriskSCF.cmake
@@ -298,7 +298,7 @@ function(asterisk_scf_add_boost_libraries)
endforeach()
list(REMOVE_DUPLICATES libs)
set(ASTERISK_SCF_BOOST_LIBRARIES ${libs} PARENT_SCOPE)
- include_directories(${Boost_INCLUDE_DIR})
+ include_directories(SYSTEM ${Boost_INCLUDE_DIR})
link_directories(${Boost_LIBRARY_DIRS})
endfunction()
@@ -317,7 +317,7 @@ function(asterisk_scf_component_add_boost_libraries COMPONENT)
endforeach()
list(REMOVE_DUPLICATES libs)
set(${COMPONENT}_BOOST_LIBRARIES ${libs} PARENT_SCOPE)
- include_directories(${Boost_INCLUDE_DIR})
+ include_directories(SYSTEM ${Boost_INCLUDE_DIR})
link_directories(${Boost_LIBRARY_DIRS})
endfunction()
@@ -501,10 +501,11 @@ function(asterisk_scf_component_add_one_slice COMPONENT SLICE)
endif()
get_filename_component(slice_basename "${SLICE}" NAME_WE)
# headers are generated, so add them to the include path
- include_directories("${CMAKE_CURRENT_BINARY_DIR}/generated")
+ # since we can't control them, treat them as system includes
+ include_directories(SYSTEM "${CMAKE_CURRENT_BINARY_DIR}/generated")
# generated .cpp files #include <.h> directly, which requires the out_dir
# itself to be in the include path
- include_directories("${slice_out_dir}")
+ include_directories(SYSTEM "${slice_out_dir}")
# fully specify SLICE's path
set(SLICE "${CMAKE_CURRENT_SOURCE_DIR}/${SLICE}")
commit 84fdbeadea2fa938a77241c65ab4b3b799136b1e
Author: David M. Lee <dlee at digium.com>
Date: Mon Jan 17 14:11:26 2011 -0600
INSTALL variables are PATH, not FILEPATH.
diff --git a/AsteriskSCF.cmake b/AsteriskSCF.cmake
index c3e16e8..48bf5e9 100644
--- a/AsteriskSCF.cmake
+++ b/AsteriskSCF.cmake
@@ -60,45 +60,45 @@ endif()
message(STATUS "Installation prefix set to ${CMAKE_INSTALL_PREFIX}")
# installation directories (these are all relative to ${CMAKE_INSTALL_PREFIX})
-set(INSTALL_SYS_CONF_DIR etc CACHE FILEPATH
+set(INSTALL_SYS_CONF_DIR etc CACHE PATH
"read-only data files that pertain to a single machine")
-set(INSTALL_BIN_DIR bin CACHE FILEPATH
+set(INSTALL_BIN_DIR bin CACHE PATH
"executable programs that users can run")
-set(INSTALL_LIB_DIR lib CACHE FILEPATH
+set(INSTALL_LIB_DIR lib CACHE PATH
"object files and libraries of object code")
-set(INSTALL_DATA_ROOT_DIR share CACHE FILEPATH
+set(INSTALL_DATA_ROOT_DIR share CACHE PATH
"read-only architecture-independent data files")
-set(INSTALL_DATA_DIR ${INSTALL_DATA_ROOT_DIR} CACHE FILEPATH
+set(INSTALL_DATA_DIR ${INSTALL_DATA_ROOT_DIR} CACHE PATH
"idiosyncratic read-only architecture-independent data files for this program")
-set(INSTALL_INCLUDE_DIR include CACHE FILEPATH
+set(INSTALL_INCLUDE_DIR include CACHE PATH
"directory for installing header files")
-set(INSTALL_LOCAL_STATE_DIR var CACHE FILEPATH
+set(INSTALL_LOCAL_STATE_DIR var CACHE PATH
"data files which the programs modify while they run, and that pertain to one specific machine")
set(ASTERISK_SCF_INSTALL_CONF_DIR
- ${INSTALL_SYS_CONF_DIR}/asterisk-scf CACHE FILEPATH
+ ${INSTALL_SYS_CONF_DIR}/asterisk-scf CACHE PATH
"Asterisk SCF files")
set(ASTERISK_SCF_INSTALL_BIN_DIR
- ${INSTALL_BIN_DIR} CACHE FILEPATH
+ ${INSTALL_BIN_DIR} CACHE PATH
"Asterisk SCF executable programs")
set(ASTERISK_SCF_INSTALL_LIB_DIR
- ${INSTALL_LIB_DIR} CACHE FILEPATH
+ ${INSTALL_LIB_DIR} CACHE PATH
"Asterisk SCF libraries")
set(ASTERISK_SCF_INSTALL_ICEBOX_DIR
${INSTALL_LIB_DIR}/asterisk-scf/icebox
- CACHE FILEPATH
+ CACHE PATH
"Asterisk SCF IceBox modules")
set(ASTERISK_SCF_INSTALL_LOCAL_STATE_DIR
- ${INSTALL_LOCAL_STATE_DIR}/lib/asterisk-scf CACHE FILEPATH
+ ${INSTALL_LOCAL_STATE_DIR}/lib/asterisk-scf CACHE PATH
"Asterisk SCF local state files")
set(ASTERISK_SCF_INSTALL_LOG_FILE
- ${INSTALL_LOCAL_STATE_DIR}/log/asterisk-scf.log CACHE FILEPATH
+ ${INSTALL_LOCAL_STATE_DIR}/log/asterisk-scf.log CACHE PATH
"Asterisk SCF logfile")
set(ASTERISK_SCF_INSTALL_INCLUDE_DIR
- ${INSTALL_INCLUDE_DIR} CACHE FILEPATH
+ ${INSTALL_INCLUDE_DIR} CACHE PATH
"Directory for installed Asterisk SCF API C++ header files")
set(ASTERISK_SCF_INSTALL_SLICE_DIR
- ${INSTALL_DATA_DIR}/asterisk-scf/slice CACHE FILEPATH
+ ${INSTALL_DATA_DIR}/asterisk-scf/slice CACHE PATH
"Directory for installed Asterisk SCF API Slice files")
mark_as_advanced(
commit b13c01c4f586c2b82c368c9d085adcb44715bc51
Author: David M. Lee <dlee at digium.com>
Date: Fri Jan 14 13:01:54 2011 -0600
Fixed some library linkage nitpicks.
* Build icebox modules as modules instead of shared libraries. Ice has
been patched to address the original issue that caused us to switch to
shared libs in the first place.
* Add capability to specify the library type (SHARED or STATIC) for an
individual library.
diff --git a/AsteriskSCF.cmake b/AsteriskSCF.cmake
index f980a89..c3e16e8 100644
--- a/AsteriskSCF.cmake
+++ b/AsteriskSCF.cmake
@@ -597,11 +597,8 @@ function(asterisk_scf_component_build_icebox COMPONENT)
list(APPEND icelibs ${${COMPONENT}_ICE_LIBRARIES} ICEBOX)
asterisk_scf_component_libraries(${COMPONENT})
- # 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})
+ # Now we actually create the shared module
+ add_library(${COMPONENT} MODULE ${${COMPONENT}_SOURCES})
# Link required libraries
target_link_libraries(${COMPONENT} ${component_libs})
endfunction()
@@ -617,12 +614,16 @@ function(asterisk_scf_component_build_standalone COMPONENT)
target_link_libraries(${COMPONENT} ${component_libs})
endfunction()
+function(asterisk_scf_set_libtype COMPONENT TYPE)
+ set("${COMPONENT}_LIBTYPE" ${TYPE} PARENT_SCOPE)
+endfunction()
+
function(asterisk_scf_component_build_library COMPONENT)
- message(STATUS "Building component ${COMPONENT} as a library")
+ message(STATUS "Building component ${COMPONENT} as a ${${COMPONENT}_LIBTYPE} library")
asterisk_scf_component_libraries(${COMPONENT})
# Now we actually create the component
- add_library(${COMPONENT} ${${COMPONENT}_SOURCES})
+ add_library(${COMPONENT} ${${COMPONENT}_LIBTYPE} ${${COMPONENT}_SOURCES})
# Link required libraries
target_link_libraries(${COMPONENT} ${component_libs})
endfunction()
commit a7e7b7d2e766af7d7a437441cfabfa9fe8b394d1
Author: Kevin P. Fleming <kpfleming at digium.com>
Date: Thu Jan 20 07:21:00 2011 -0600
Don't set compiler/linker flags variables in the cache; they should be
set in the current directory scope to preserve any values that the platform
code (included with CMake) stored in them.
diff --git a/AsteriskSCF.cmake b/AsteriskSCF.cmake
index e85b9a5..f980a89 100644
--- a/AsteriskSCF.cmake
+++ b/AsteriskSCF.cmake
@@ -150,6 +150,14 @@ macro(set_cache_var)
set(${ARGV} CACHE INTERNAL Bob FORCE)
endmacro()
+macro(append_to_var VAR)
+ unset(_altv)
+ foreach(item ${ARGN})
+ set(_altv "${_altv} ${item}")
+ endforeach()
+ set(${VAR} "${${VAR}} ${_altv}" PARENT_SCOPE)
+endmacro()
+
macro(set_cache_var_list VAR LIST TYPE DESCRIPTION)
unset(_scvl)
foreach(item IN LISTS ${LIST})
@@ -236,31 +244,17 @@ function(asterisk_scf_project NAME ICE_VERSION)
list(APPEND cxx_flags_profile "-ftest-coverage" "-fprofile-arcs")
endif()
- list(APPEND c_flags_profile ${c_flags_debug})
- set_cache_var_list(CMAKE_C_FLAGS c_flags STRING
- "Flags used by the compiler during all builds.")
- set_cache_var_list(CMAKE_C_FLAGS_DEBUG c_flags_debug STRING
- "Flags used by the compiler during debug builds.")
- set_cache_var_list(CMAKE_C_FLAGS_PROFILE c_flags_profile STRING
- "Flags used by the compiler during profile builds.")
- mark_as_advanced(CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_PROFILE)
-
- list(APPEND cxx_flags_profile ${cxx_flags_debug})
- set_cache_var_list(CMAKE_CXX_FLAGS cxx_flags STRING
- "Flags used by the compiler during all builds.")
- set_cache_var_list(CMAKE_CXX_FLAGS_DEBUG cxx_flags_debug STRING
- "Flags used by the compiler during debug builds.")
- set_cache_var_list(CMAKE_CXX_FLAGS_PROFILE cxx_flags_profile STRING
- "Flags used by the compiler during profile builds.")
- mark_as_advanced(CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_PROFILE)
-
- set_cache_var_list(CMAKE_EXE_LINKER_FLAGS linker_flags STRING
- "Flags used by the linker for standalone components during all builds.")
- set_cache_var_list(CMAKE_MODULE_LINKER_FLAGS linker_flags STRING
- "Flags used by the linker for modules during all builds.")
- set_cache_var_list(CMAKE_SHARED_LINKER_FLAGS linker_flags STRING
- "Flags used by the linker for shared libraries during all builds.")
- mark_as_advanced(CMAKE_EXE_LINKER_FLAGS CMAKE_MODULE_LINKER_FLAGS CMAKE_SHARED_LINKER_FLAGS)
+ 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})
+
+ 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})
+
+ 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})
message(STATUS "Passed requirement checks for CXX components")
endfunction()
commit 66640ddef1ebc5209a2f4cf4660b30ec9c21b77a
Merge: 604a139 02faccc
Author: Kevin P. Fleming <kpfleming at digium.com>
Date: Wed Jan 19 16:59:26 2011 -0600
Merge branch 'master' into slice-plugins
Conflicts:
AsteriskSCF.cmake
diff --cc AsteriskSCF.cmake
index 3abbeb5,1fd2add..e85b9a5
--- a/AsteriskSCF.cmake
+++ b/AsteriskSCF.cmake
@@@ -436,12 -349,6 +349,20 @@@ function(asterisk_scf_slice_include_dir
set(SLICE_INCLUDE_DIRECTORIES ${paths} PARENT_SCOPE)
endfunction()
- # Function which remembers definitions needed by a 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)
++# Function which remembers Slice plugins to be used for all targets in the
++# current directory and below
++function(asterisk_scf_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 remembers Ice libraries needed by a Slice target
function(asterisk_scf_slice_add_ice_libraries TARGET)
if(NOT ARGN)
@@@ -856,135 -406,209 +420,217 @@@ function(asterisk_scf_component_add_ice
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})
+ set(${COMPONENT}_ICE_LIBRARIES ${libs} PARENT_SCOPE)
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}")
+ # Adds Slice files to a target. This handles all the magic of creating the
+ # rules to run slice2cpp, adding the generated headers to the include path,
+ # adding the generated .cpp file to the component, etc. The generated files
+ # are placed in ${CMAKE_CURRENT_BINARY_DIR}/generated.
+ #
+ # The Slice files are passed in as a list of globs, relative to
+ # the current source directory. The globs default to regular non-recursive
+ # globs. If you want to include subdirectories in you glob search, also
+ # pass in GLOB_RECURSE.
+ #
+ # For example:
+ # asterisk_scf_component_add_slice(comp-name GLOB_RECURSE "*.ice")
+ #
+ # See http://www.cmake.org/cmake/help/cmake-2-8-docs.html#command:file for more
+ # details on the globbing syntax.
+ function(asterisk_scf_component_add_slice COMPONENT)
+ # default to glob syntax by default. not as useful as GLOB_RECURSE, but
+ # follows the principle of least surprise
+ set(glob_style GLOB)
+ foreach(slice_glob ${ARGN})
+ if(${slice_glob} STREQUAL GLOB OR ${slice_glob} STREQUAL GLOB_RECURSE)
+ # change our globbing style
+ set(glob_style ${slice_glob})
else()
- list(APPEND target_libs "${ICE_${lang}_LIB_${lib}}")
- endif()
- endforeach()
+ # expand the glob into a list of files
+ file(${glob_style} slices RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
+ ${slice_glob})
- 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})
- string(TOUPPER ${lib} libtag)
- list(APPEND target_libs "${Boost_${libtag}_LIBRARY}")
+ foreach(slice ${slices})
+ asterisk_scf_component_add_one_slice(${COMPONENT} ${slice})
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()
+ endforeach()
+ set(${COMPONENT}_SOURCES ${${COMPONENT}_SOURCES} PARENT_SCOPE)
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}")
+ function(asterisk_scf_component_add_one_slice COMPONENT SLICE)
+ if(NOT SLICE_COMPILER)
+ # Find the actual Slice compiler
+ find_program(SLICE_COMPILER slice2cpp 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)
+ message(STATUS "Found Slice compiler at ${SLICE_COMPILER}")
+ mark_as_advanced(SLICE_COMPILER)
else()
- list(APPEND target_libs "${ICE_${lang}_LIB_${lib}}")
+ message(FATAL_ERROR "Failed to find Slice compiler")
endif()
+ endif()
+
+ if(MSVC_IDE)
+ # This makes the Slice definitions display in their own folder in the
+ # Visual Studio IDE
+ source_group("Slice Definitions" REGULAR_EXPRESSION "\\.ice$")
+ endif()
+
+ # Append the needed include directories for Slice definitions
+ foreach(include ${SLICE_INCLUDE_DIRECTORIES})
+ # Each directory in this list will be in the source tree,
+ # which is what the Slice compiler will need
+ list(APPEND slice_compiler_arguments "-I${include}")
endforeach()
- 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})
- string(TOUPPER ${lib} libtag)
- list(APPEND target_libs "${Boost_${libtag}_LIBRARY}")
- 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})
++ # 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()
- 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})
+ message(STATUS "Adding ${SLICE} to ${COMPONENT}")
+ # get subdirectory slice is in
+ get_filename_component(slice_subdir "${SLICE}" PATH)
+
+ # get the directory in which to put the generated code
+ set(slice_out_dir "${CMAKE_CURRENT_BINARY_DIR}/generated")
+ # if the slice file is in a subdirectory, maintain that structure
+ if(slice_subdir AND NOT ${slice_subdir} MATCHES "\\.\\.")
+ set(slice_out_dir "${slice_out_dir}/${slice_subdir}")
+ endif()
+ get_filename_component(slice_basename "${SLICE}" NAME_WE)
+ # headers are generated, so add them to the include path
+ include_directories("${CMAKE_CURRENT_BINARY_DIR}/generated")
+ # generated .cpp files #include <.h> directly, which requires the out_dir
+ # itself to be in the include path
+ include_directories("${slice_out_dir}")
+
+ # fully specify SLICE's path
+ set(SLICE "${CMAKE_CURRENT_SOURCE_DIR}/${SLICE}")
+
+ # Look for the dependencies for this Slice definition, we have to do it now
+ # since the target was just added
+ message(STATUS "Determining dependencies for ${slice_basename}")
+ execute_process(
+ COMMAND ${SLICE_COMPILER} ${slice_compiler_arguments} --depend ${SLICE}
+ 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)
+ # get rid of folded newlines
+ string(REPLACE "\\\n" "" raw_dependencies "${raw_dependencies}")
+ # turn newlines into item separators
+ string(REPLACE "\n" ";" raw_dependencies "${raw_dependencies}")
+
+ foreach(dep ${raw_dependencies})
+ # each dep is of the form:
+ #target1 target2 [...] target_n: source1 source2 [...] source_n
+
+ # parse targets
+ string(REGEX MATCHALL "^[^:]+" dep_targets "${dep}")
+ string(REGEX MATCHALL "[^ ]+" dep_targets "${dep_targets}")
+ list(APPEND targets ${dep_targets})
+
+ # parse sources
+ string(REGEX MATCHALL "[^:]+$" dep_sources "${dep}")
+ string(REGEX MATCHALL "[^ ]+" dep_sources "${dep_sources}")
+ list(APPEND sources ${dep_sources})
+ endforeach()
+ endif()
- list(LENGTH icelibs numicelibs)
- if(numicelibs GREATER 0)
- list(REMOVE_DUPLICATES icelibs)
+ # prepend the slice_out_dir to the targets
+ foreach(target ${targets})
+ list(APPEND generated_files "${slice_out_dir}/${target}")
+ endforeach()
+ # you would think that would be enough, but slice2cpp doesn't generate a
+ # dep for the .h file
+ list(APPEND generated_files "${slice_out_dir}/${slice_basename}.h")
+ # 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)
+
+ # create a preprocessor definition in the generated CXX files that enables
+ # the generated classes to be exported from the library (only necessary on
+ # Windows)
+ if(WIN32)
+ list(APPEND slice_compiler_arguments "--dll-export" "ASTERISK_SCF_ICEBOX_EXPORT")
endif()
+ file(MAKE_DIRECTORY ${slice_out_dir})
+ add_custom_command(
+ OUTPUT ${generated_files}
+ COMMAND ${SLICE_COMPILER} ${slice_compiler_arguments} ${SLICE}
+ --output-dir ${slice_out_dir}
+ COMMENT "slice2cpp translating ${SLICE}"
+ DEPENDS ${sources})
+
+ # the Slice and generated_files are sources for the component
+ list(APPEND ${COMPONENT}_SOURCES ${SLICE} ${generated_files})
+ set(${COMPONENT}_SOURCES ${${COMPONENT}_SOURCES} PARENT_SCOPE)
+ endfunction()
+
+ # Function which collects libraries needed by a component
+ function(asterisk_scf_component_libraries COMPONENT)
+ list(APPEND icelibs ${ASTERISK_SCF_ICE_LIBRARIES} ${${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()
+ list(APPEND target_libs "${ICE_${lib}_LIBRARY}")
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})
- string(TOUPPER ${lib} libtag)
- list(APPEND target_libs "${Boost_${libtag}_LIBRARY}")
- 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})
+ list(APPEND boostlibs ${ASTERISK_SCF_BOOST_LIBRARIES} ${${COMPONENT}_BOOST_LIBRARIES})
+ if(boostlibs)
+ list(REMOVE_DUPLICATES boostlibs)
+ foreach(lib ${boostlibs})
+ list(APPEND target_libs "${Boost_${lib}_LIBRARY}")
+ endforeach()
endif()
+ set(component_libs ${target_libs} PARENT_SCOPE)
+ endfunction()
+
+ # Function which builds a component as an IceBox service
+ function(asterisk_scf_component_build_icebox COMPONENT)
+ message(STATUS "Building component ${COMPONENT} as an IceBox service")
+ find_package(Ice REQUIRED IceBox)
+ list(APPEND icelibs ${${COMPONENT}_ICE_LIBRARIES} ICEBOX)
+ asterisk_scf_component_libraries(${COMPONENT})
+
+ # 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
+ target_link_libraries(${COMPONENT} ${component_libs})
+ endfunction()
+
+ # Function which builds a component standalone
+ function(asterisk_scf_component_build_standalone COMPONENT)
+ message(STATUS "Building component ${COMPONENT} as a standalone executable")
+ asterisk_scf_component_libraries(${COMPONENT})
+
+ # Now we actually create the component
+ add_executable(${COMPONENT} ${${COMPONENT}_SOURCES})
+ # Link required libraries
+ target_link_libraries(${COMPONENT} ${component_libs})
+ endfunction()
+
+ function(asterisk_scf_component_build_library COMPONENT)
+ message(STATUS "Building component ${COMPONENT} as a library")
+ asterisk_scf_component_libraries(${COMPONENT})
+
+ # Now we actually create the component
+ add_library(${COMPONENT} ${${COMPONENT}_SOURCES})
+ # Link required libraries
+ target_link_libraries(${COMPONENT} ${component_libs})
endfunction()
# Function which adds information for installing a component
commit 02faccc91efe3c5337e4264552575f20692192f8
Author: David M. Lee <dlee at digium.com>
Date: Wed Jan 19 14:24:57 2011 -0600
Fixed Windows build for self-installed VC10 or x64.
Ice is inconsistent where libraries go. When installed using their .msi,
it's in lib[\vc10][\x64]. When installed using make install, it's just
in lib.
diff --git a/modules/FindIce.cmake b/modules/FindIce.cmake
index cc9bac3..1892135 100644
--- a/modules/FindIce.cmake
+++ b/modules/FindIce.cmake
@@ -135,7 +135,9 @@ function(_ice_find_library library)
if(CMAKE_CL_64)
set(_ice_libdir "${_ice_libdir}/x64")
endif()
- list(APPEND _ice_libdirs "${_ice_libdir}")
+ # first search the more specified libdir, as used by the .msi installer
+ # if it's not there, try just lib. that's where make install puts it
+ list(APPEND _ice_libdirs "${_ice_libdir}" "lib")
elseif(UNIX)
list(APPEND _ice_libdirs "lib" "lib32" "lib64")
endif()
commit ca3edc48e010bc44f2a9964a72db9ad5f5b4a2cd
Author: David M. Lee <dlee at digium.com>
Date: Wed Jan 19 12:58:16 2011 -0600
Add Slice files to sources, for Visual Studio.
diff --git a/AsteriskSCF.cmake b/AsteriskSCF.cmake
index ed3bc5a..1fd2add 100644
--- a/AsteriskSCF.cmake
+++ b/AsteriskSCF.cmake
@@ -552,8 +552,8 @@ function(asterisk_scf_component_add_one_slice COMPONENT SLICE)
COMMENT "slice2cpp translating ${SLICE}"
DEPENDS ${sources})
- # now the generated_files are sources for the component
- list(APPEND ${COMPONENT}_SOURCES ${generated_files})
+ # the Slice and generated_files are sources for the component
+ list(APPEND ${COMPONENT}_SOURCES ${SLICE} ${generated_files})
set(${COMPONENT}_SOURCES ${${COMPONENT}_SOURCES} PARENT_SCOPE)
endfunction()
commit df826410d0af5601c3bd344db5cfa22b66d72ef1
Author: David M. Lee <dlee at digium.com>
Date: Wed Jan 19 12:18:10 2011 -0600
We require cmake 2.8 or better.
Now make it a specific "You're cmake is old" failure, as opposed to some
random failure later on.
diff --git a/example/CMakeLists.txt b/example/CMakeLists.txt
index 5e09015..3deef15 100644
--- a/example/CMakeLists.txt
+++ b/example/CMakeLists.txt
@@ -1,8 +1,8 @@
# This is an example CMakeLists.txt file for use with the Asterisk SCF component common build system
# You should specify the minimum version of cmake that is allowed. Unless you are using things that
-# require a higher version OR the Asterisk SCF.cmake file requires a higher version this can be left at 2.6
-cmake_minimum_required(VERSION 2.6)
+# require a higher version OR the Asterisk SCF.cmake file requires a higher version this can be left at 2.8
+cmake_minimum_required(VERSION 2.8)
# This allows you to use the CPack package builder. You must install some package building generator,
# such as NullSoft Installer (NSI) on Windows.
commit 6acd2b964fc48a19a4c1a5817bf1af10c617696c
Author: David M. Lee <dlee at digium.com>
Date: Wed Jan 19 12:14:45 2011 -0600
We require boost 1.40 or better.
Now make it a configure time failure, instead of some random compile failure
later in the build.
diff --git a/AsteriskSCF.cmake b/AsteriskSCF.cmake
index d930bd6..ed3bc5a 100644
--- a/AsteriskSCF.cmake
+++ b/AsteriskSCF.cmake
@@ -46,6 +46,8 @@
# * Use the list() function for manipulating lists.
#
+set(MIN_BOOST_VERSION 1.40)
+
if(CMAKE_BINARY_DIR STREQUAL CMAKE_SOURCE_DIR)
message(FATAL_ERROR "This project must not be built in the source directory")
endif()
@@ -273,9 +275,9 @@ endfunction()
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)
+ find_package(Boost ${MIN_BOOST_VERSION})
if(NOT Boost_FOUND)
- message(FATAL_ERROR "Boost libraries not found")
+ message(FATAL_ERROR "Boost libraries v${MIN_BOOST_VERSION} or better not found")
endif()
set(Boost_CORE_FOUND "bazinga" PARENT_SCOPE)
set(Boost_CORE_FOUND "bazinga")
commit 9686f69b915134654f2c0d2c9dc4168dc8ef3fe1
Author: Kevin P. Fleming <kpfleming at digium.com>
Date: Tue Jan 18 15:08:44 2011 -0600
Document usage of CMAKE_DEBUG_POSTFIX.
diff --git a/modules/FindIce.cmake b/modules/FindIce.cmake
index 749f6fb..cc9bac3 100644
--- a/modules/FindIce.cmake
+++ b/modules/FindIce.cmake
@@ -64,6 +64,9 @@
# debugging messages as each step of its operations
# are performed.
#
+# CMAKE_DEBUG_POSTFIX If this is set to any value, it will be used as a
+# a suffix when searching for 'debug' libraries.
+#
# Variables set by this module:
#
# ICE_FOUND Will be set if a compatible version of Ice was found
commit 0c6bf4dd51c1735dd006c652bed58ac4ef65aa5e
Author: Kevin P. Fleming <kpfleming at digium.com>
Date: Tue Jan 18 14:27:49 2011 -0600
Use DEFINED in expressions to check for whether environment variables
have values, because it appears to be more reliable. Disable checking
for ENV{ProgramFiles(x86)} because CMake does not accept this syntax.
diff --git a/modules/FindIce.cmake b/modules/FindIce.cmake
index abb3555..749f6fb 100644
--- a/modules/FindIce.cmake
+++ b/modules/FindIce.cmake
@@ -191,7 +191,7 @@ if(NOT ICE_DIR)
find_package_handle_standard_args(Ice "Major and minor version numbers (at least) must be supplied to find Ice." ICE_DIR)
endif()
- if($ENV{ICE_HOME})
+ if(DEFINED ENV{ICE_HOME})
# if ICE_HOME is set, we will only look there; if the version present there
# does not satisfy the requested version, then the search will fail
list(APPEND _ice_candidate_dirs "$ENV{ICE_HOME}")
@@ -222,12 +222,12 @@ if(NOT ICE_DIR)
foreach(version IN LISTS _ice_candidate_versions)
if(WIN32)
list(APPEND _ice_candidate_dirs "C:/Ice-${version}")
- if(ENV{ProgramFiles})
+ if(DEFINED ENV{ProgramFiles})
list(APPEND _ice_candidate_dirs "$ENV{ProgramFiles}/ZeroC/Ice-${version}")
endif()
- if(ENV{ProgramFiles(x86)})
- list(APPEND _ice_candidate_dirs "$ENV{ProgramFiles(x86)}/ZeroC/Ice-${version}")
- endif()
+# if(ENV{ProgramFiles(x86)})
+# list(APPEND _ice_candidate_dirs "$ENV{ProgramFiles(x86)}/ZeroC/Ice-${version}")
+# endif()
elseif(UNIX)
list(APPEND _ice_candidate_dirs "/opt/Ice-${version}")
endif()
commit e22c91701e8d09c15abbe415de98bf0534f4364f
Author: Kevin P. Fleming <kpfleming at digium.com>
Date: Tue Jan 18 14:11:16 2011 -0600
First attempt at finding Ice in 'standard' locations chosen by ZeroC's
Ice installer on Windows. Now on to testing...
diff --git a/modules/FindIce.cmake b/modules/FindIce.cmake
index 19b6d81..abb3555 100644
--- a/modules/FindIce.cmake
+++ b/modules/FindIce.cmake
@@ -13,12 +13,26 @@
# PATH or any other CMake-provided default paths; instead, it will only
# search in predefined locations, which are:
#
-# ENV{ICE_HOME} if the ICE_HOME environment variable is set,
-# only that location is checked
-# /opt/Ice-<version> on UNIX-type platforms, subdirectories
-# of /opt are checked
-# C:/Ice-<version> on Windows platforms, subdirectories of C: are
-# checked
+# ENV{ICE_HOME}
+# if the ICE_HOME environment variable is set,
+# only that location is checked
+#
+# /opt/Ice-<version>
+# on UNIX-type platforms, subdirectories
+# of /opt are checked
+#
+# C:/Ice-<version>
+# on Windows platforms, subdirectories of C: are
+# checked since this is the default location for
+# Ice installations made from the Ice source code
+#
+# ENV{ProgramFiles}/ZeroC/Ice-<version>
+# on 32-bit Windows platforms, the ZeroC Ice installer
+# places Ice here
+#
+# ENV{ProgramFiles(x86)}/ZeroC/Ice-<version>
+# on 64-bit Windows platforms, the ZeroC Ice installer
+# places Ice here
#
# These are the standard locations for Ice installations performed by the
# ZeroC Ice packages; if Ice is installed in a non-standard location, then
@@ -110,8 +124,21 @@ function(_ice_find_library library)
set(_ice_debug_suffix "${CMAKE_DEBUG_POSTFIX}")
- find_library(ICE_${upper}_LIBRARY_RELEASE NAMES "${library}" NO_DEFAULT_PATH HINTS "${ICE_DIR}" PATH_SUFFIXES "lib" "lib32" "lib64")
- find_library(ICE_${upper}_LIBRARY_DEBUG NAMES "${library}${_ice_debug_suffix}" NO_DEFAULT_PATH HINTS "${ICE_DIR}" PATH_SUFFIXES "lib" "lib32" "lib64")
+ if(WIN32)
+ set(_ice_libdir "lib")
+ if(MSVC10)
+ set(_ice_libdir "${_ice_libdir}/vc100")
+ endif()
+ if(CMAKE_CL_64)
+ set(_ice_libdir "${_ice_libdir}/x64")
+ endif()
+ list(APPEND _ice_libdirs "${_ice_libdir}")
+ elseif(UNIX)
+ list(APPEND _ice_libdirs "lib" "lib32" "lib64")
+ endif()
+
+ find_library(ICE_${upper}_LIBRARY_RELEASE NAMES "${library}" NO_DEFAULT_PATH HINTS "${ICE_DIR}" PATH_SUFFIXES ${_ice_libdirs})
+ find_library(ICE_${upper}_LIBRARY_DEBUG NAMES "${library}${_ice_debug_suffix}" NO_DEFAULT_PATH HINTS "${ICE_DIR}" PATH_SUFFIXES ${_ice_libdirs})
mark_as_advanced(ICE_${upper}_LIBRARY_RELEASE ICE_${upper}_LIBRARY_DEBUG)
@@ -195,11 +222,19 @@ if(NOT ICE_DIR)
foreach(version IN LISTS _ice_candidate_versions)
if(WIN32)
list(APPEND _ice_candidate_dirs "C:/Ice-${version}")
+ if(ENV{ProgramFiles})
+ list(APPEND _ice_candidate_dirs "$ENV{ProgramFiles}/ZeroC/Ice-${version}")
+ endif()
+ if(ENV{ProgramFiles(x86)})
+ list(APPEND _ice_candidate_dirs "$ENV{ProgramFiles(x86)}/ZeroC/Ice-${version}")
+ endif()
elseif(UNIX)
list(APPEND _ice_candidate_dirs "/opt/Ice-${version}")
endif()
endforeach()
+ list(REMOVE_DUPLICATES _ice_candidate_dirs)
+
endif()
if(Ice_DEBUG)
commit 2be5e7695ba548148bda85b6d5e3c7f8e8f93fad
Author: Kevin P. Fleming <kpfleming at digium.com>
Date: Tue Jan 18 14:02:41 2011 -0600
Don't set a 'source group' unless CMake is generating files for
the Visual Studio IDE.
diff --git a/AsteriskSCF.cmake b/AsteriskSCF.cmake
index 8382f59..d930bd6 100644
--- a/AsteriskSCF.cmake
+++ b/AsteriskSCF.cmake
@@ -458,9 +458,11 @@ function(asterisk_scf_component_add_one_slice COMPONENT SLICE)
endif()
endif()
- # This makes the Slice definitions display in their own folder in the IDE,
- # specifically Visual Studio
- source_group("Slice Definitions" REGULAR_EXPRESSION "\\.ice$")
+ if(MSVC_IDE)
+ # This makes the Slice definitions display in their own folder in the
+ # Visual Studio IDE
+ source_group("Slice Definitions" REGULAR_EXPRESSION "\\.ice$")
+ endif()
# Append the needed include directories for Slice definitions
foreach(include ${SLICE_INCLUDE_DIRECTORIES})
commit 24bd86dd2d62ac137d9d94db09dfa753f1928d30
Author: Kevin P. Fleming <kpfleming at digium.com>
Date: Tue Jan 18 13:30:31 2011 -0600
Follow CMake guidelines and use 'HINTS' instead of 'PATHS' for searching
directories that were determined to be candidates from previous results.
diff --git a/modules/FindIce.cmake b/modules/FindIce.cmake
index 4a4a500..19b6d81 100644
--- a/modules/FindIce.cmake
+++ b/modules/FindIce.cmake
@@ -110,8 +110,8 @@ function(_ice_find_library library)
set(_ice_debug_suffix "${CMAKE_DEBUG_POSTFIX}")
- find_library(ICE_${upper}_LIBRARY_RELEASE NAMES "${library}" NO_DEFAULT_PATH PATHS "${ICE_DIR}" PATH_SUFFIXES "lib" "lib32" "lib64")
- find_library(ICE_${upper}_LIBRARY_DEBUG NAMES "${library}${_ice_debug_suffix}" NO_DEFAULT_PATH PATHS "${ICE_DIR}" PATH_SUFFIXES "lib" "lib32" "lib64")
+ find_library(ICE_${upper}_LIBRARY_RELEASE NAMES "${library}" NO_DEFAULT_PATH HINTS "${ICE_DIR}" PATH_SUFFIXES "lib" "lib32" "lib64")
+ find_library(ICE_${upper}_LIBRARY_DEBUG NAMES "${library}${_ice_debug_suffix}" NO_DEFAULT_PATH HINTS "${ICE_DIR}" PATH_SUFFIXES "lib" "lib32" "lib64")
mark_as_advanced(ICE_${upper}_LIBRARY_RELEASE ICE_${upper}_LIBRARY_DEBUG)
@@ -266,7 +266,7 @@ if(NOT ICE_DIR)
if(ICE_DIR)
mark_as_advanced(FORCE ICE_INCLUDE_DIR)
- find_path(ICE_SLICE_DIR "Ice/Current.ice" PATHS "${ICE_DIR}" PATH_SUFFIXES "slice" NO_DEFAULT_PATH)
+ find_path(ICE_SLICE_DIR "Ice/Current.ice" HINTS "${ICE_DIR}" PATH_SUFFIXES "slice" NO_DEFAULT_PATH)
if(NOT ICE_SLICE_DIR)
message(WARNING "Ice installation located at ${ICE_DIR} is incomplete or broken (missing 'slice' directory)")
else()
commit 930f32143424f1acca2fbaaa7bdde03019e4a364
Author: Kevin P. Fleming <kpfleming at digium.com>
Date: Tue Jan 18 13:22:12 2011 -0600
Address review feedback from CR-ASTSCF-46:
Use the existing CMake mechanism for defining a 'system' include directory
instead of doing it manually.
diff --git a/AsteriskSCF.cmake b/AsteriskSCF.cmake
index 769efcf..8382f59 100644
--- a/AsteriskSCF.cmake
+++ b/AsteriskSCF.cmake
@@ -178,14 +178,20 @@ function(asterisk_scf_project NAME ICE_VERSION)
message(STATUS "Performing requirement checks for components")
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}")
- include_directories("${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
+ # 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)
diff --git a/modules/FindIce.cmake b/modules/FindIce.cmake
index 1b93fba..4a4a500 100644
--- a/modules/FindIce.cmake
+++ b/modules/FindIce.cmake
@@ -273,13 +273,6 @@ if(NOT ICE_DIR)
mark_as_advanced(FORCE ICE_SLICE_DIR)
endif()
- # This block essentially tricks the GNU compiler into treating the Ice header files as system headers. This has
- # the benefit of having warnings emitted by the headers NOT treated as errors, even if the compiler has been told
- # to do so. This is being utilized so that Ice itself does not have to be updated to be C++0x safe.
- if(CMAKE_COMPILER_IS_GNUCXX)
- _ice_set_cache_string(ICE_CXX_FLAGS "-isystem ${ICE_INCLUDE_DIR}" "Ice-specific compiler flags")
- endif()
-
endif()
find_package_handle_standard_args(Ice DEFAULT_MSG ICE_DIR ICE_SLICE_DIR ICE_INCLUDE_DIR)
commit b57eaa40ab92627dc19911f2221b283be97e89ec
Author: Kevin P. Fleming <kpfleming at digium.com>
Date: Tue Jan 18 13:15:46 2011 -0600
Add FindThreads-generated flags for C compilation as well.
diff --git a/AsteriskSCF.cmake b/AsteriskSCF.cmake
index 19989de..769efcf 100644
--- a/AsteriskSCF.cmake
+++ b/AsteriskSCF.cmake
@@ -193,6 +193,7 @@ function(asterisk_scf_project NAME ICE_VERSION)
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}")
commit 37932db35fa674b1124250d03ee268d1e88ee348
Author: Kevin P. Fleming <kpfleming at digium.com>
Date: Tue Jan 18 13:13:28 2011 -0600
Address comments from CR-ASTSCF-46:
* Automatically set ICE_SLICE_DIR as a common Slice include directory, rather than
adding it in each build.
* Always include the compiler flags that FindThreads generates, not just for GCC.
* Correct handling of lists of compiler flags being set into single variables.
diff --git a/AsteriskSCF.cmake b/AsteriskSCF.cmake
index 0cbc3eb..19989de 100644
--- a/AsteriskSCF.cmake
+++ b/AsteriskSCF.cmake
@@ -148,6 +148,14 @@ macro(set_cache_var)
set(${ARGV} CACHE INTERNAL Bob FORCE)
endmacro()
+macro(set_cache_var_list VAR LIST TYPE DESCRIPTION)
+ unset(_scvl)
+ foreach(item IN LISTS ${LIST})
+ set(_scvl "${_scvl} ${item}")
+ endforeach()
+ set(${VAR} "${_scvl}" CACHE ${TYPE} ${DESCRIPTION} FORCE)
+endmacro()
+
# Function which initializes project specific things
function(asterisk_scf_project NAME ICE_VERSION)
message(STATUS "Setting up project ${NAME} for Ice version ${ICE_VERSION}")
@@ -176,6 +184,10 @@ function(asterisk_scf_project NAME ICE_VERSION)
set(ASTERISK_SCF_ICE_LIBRARIES ICE ICEUTIL PARENT_SCOPE)
message(STATUS "Using Ice C++ headers from: ${ICE_INCLUDE_DIR}")
include_directories("${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)
@@ -205,31 +217,41 @@ function(asterisk_scf_project NAME ICE_VERSION)
endif()
if(CMAKE_COMPILER_IS_GNUC)
- set(CMAKE_C_FLAGS_DEBUG "-Werror -Wall -g3"
- CACHE STRING "Flags used by the compiler during debug builds." FORCE)
- set(CMAKE_C_FLAGS_PROFILE
- "${CMAKE_C_FLAGS_DEBUG} -ftest-coverage -fprofile-arcs"
- CACHE STRING "Flags used by the compiler during profile builds." FORCE)
- mark_as_advanced(CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_PROFILE)
+ list(APPEND c_flags_debug "-Werror" "-Wall" "-g3")
+ list(APPEND c_flags_profile "-ftest-coverage" "-fprofile-arcs")
endif()
if(CMAKE_COMPILER_IS_GNUCXX)
- set(CMAKE_CXX_FLAGS "${ICE_CXX_FLAGS} ${cxx_flags}"
- CACHE STRING "Flags used by the compiler during all builds." FORCE)
- set(CMAKE_CXX_FLAGS_DEBUG "-Werror -Wall -g3"
- CACHE STRING "Flags used by the compiler during debug 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)
- mark_as_advanced(CMAKE_C_FLAGS_PROFILE CMAKE_CXX_FLAGS_PROFILE CMAKE_EXE_LINKER_FLAGS_PROFILE)
+ list(APPEND cxx_flags ${ICE_CXX_FLAGS})
+ list(APPEND cxx_flags_debug "-Werror" "-Wall" "-g3")
+ list(APPEND cxx_flags_profile "-ftest-coverage" "-fprofile-arcs")
endif()
- set(CMAKE_EXE_LINKER_FLAGS "${linker_flags}"
- CACHE STRING "Flags used by the linker for standalone components during all builds." FORCE)
- set(CMAKE_MODULE_LINKER_FLAGS "${linker_flags}"
- CACHE STRING "Flags used by the linker for modules during all builds." FORCE)
- set(CMAKE_SHARED_LINKER_FLAGS "${linker_flags}"
- CACHE STRING "Flags used by the linker for shared libraries during all builds." FORCE)
+ list(APPEND c_flags_profile ${c_flags_debug})
+ set_cache_var_list(CMAKE_C_FLAGS c_flags STRING
+ "Flags used by the compiler during all builds.")
+ set_cache_var_list(CMAKE_C_FLAGS_DEBUG c_flags_debug STRING
+ "Flags used by the compiler during debug builds.")
+ set_cache_var_list(CMAKE_C_FLAGS_PROFILE c_flags_profile STRING
+ "Flags used by the compiler during profile builds.")
+ mark_as_advanced(CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_PROFILE)
+
+ list(APPEND cxx_flags_profile ${cxx_flags_debug})
+ set_cache_var_list(CMAKE_CXX_FLAGS cxx_flags STRING
+ "Flags used by the compiler during all builds.")
+ set_cache_var_list(CMAKE_CXX_FLAGS_DEBUG cxx_flags_debug STRING
+ "Flags used by the compiler during debug builds.")
+ set_cache_var_list(CMAKE_CXX_FLAGS_PROFILE cxx_flags_profile STRING
+ "Flags used by the compiler during profile builds.")
+ mark_as_advanced(CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_PROFILE)
+
+ set_cache_var_list(CMAKE_EXE_LINKER_FLAGS linker_flags STRING
+ "Flags used by the linker for standalone components during all builds.")
+ set_cache_var_list(CMAKE_MODULE_LINKER_FLAGS linker_flags STRING
+ "Flags used by the linker for modules during all builds.")
+ set_cache_var_list(CMAKE_SHARED_LINKER_FLAGS linker_flags STRING
+ "Flags used by the linker for shared libraries during all builds.")
+ mark_as_advanced(CMAKE_EXE_LINKER_FLAGS CMAKE_MODULE_LINKER_FLAGS CMAKE_SHARED_LINKER_FLAGS)
message(STATUS "Passed requirement checks for CXX components")
endfunction()
@@ -434,10 +456,6 @@ function(asterisk_scf_component_add_one_slice COMPONENT SLICE)
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
commit e9522c2a91dba539f31d867197e029a8ee3050d9
Merge: b7268f6 83a0c6d
Author: Kevin P. Fleming <kpfleming at digium.com>
Date: Tue Jan 18 06:40:17 2011 -0600
Merge branch 'master' into ice-package
commit b7268f654a356f02882b6a74da3af83f0ee965fe
Author: Kevin P. Fleming <kpfleming at digium.com>
Date: Tue Jan 18 06:39:55 2011 -0600
Add copyright and license header.
diff --git a/modules/FindPackageComponentHandleStandardArgs.cmake b/modules/FindPackageComponentHandleStandardArgs.cmake
index d864014..bd95606 100644
--- a/modules/FindPackageComponentHandleStandardArgs.cmake
+++ b/modules/FindPackageComponentHandleStandardArgs.cmake
@@ -1,3 +1,37 @@
+#=============================================================================
+# Copyright 2007-2009 Kitware, Inc.
+# Copyright 2011, Digium, Inc.
+#
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright notice,
+# this list of conditions and the following disclaimer.
+#
+# * Redistributions in binary form must reproduce the above copyright notice,
+# this list of conditions and the following disclaimer in the documentation
+# and/or other materials provided with the distribution.
+#
+# * The names of Kitware, Inc., the Insight Consortium, or the names of
+# any consortium members, or of any contributors, may not be used to
+# endorse or promote products derived from this software without
+# specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS ``AS IS''
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR
+# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#=============================================================================
+#
# FIND_PACKAGE_COMPONENT_HANDLE_STANDARD_ARGS(NAME COMPONENT (DEFAULT_MSG|"Custom failure message") VAR1 ... )
# This macro is intended to be used in FindXXX.cmake modules files.
# It handles the REQUIRED and QUIET argument to FIND_PACKAGE().
commit d492663107b37d98034b85b5937690c3e729e539
Author: Kevin P. Fleming <kpfleming at digium.com>
Date: Tue Jan 18 06:34:26 2011 -0600
Add a copyright, license and documentation header to FindIce.cmake
diff --git a/modules/FindIce.cmake b/modules/FindIce.cmake
index a28b7ff..1b93fba 100644
--- a/modules/FindIce.cmake
+++ b/modules/FindIce.cmake
@@ -1,19 +1,91 @@
#
-# sets:
-# ICE_FOUND
-# ICE_DIR
-# ICE_INCLUDE_DIR
-# ICE_SLICE_DIR
-# ICE_CXX_FLAGS
-# ICE_VERSION
-# ICE_VERSION_MAJOR
-# ICE_VERSION_MINOR
-# ICE_VERSION_PATCH
-# for each component requested, sets (with <component> uppercased):
-# ICE_<component>_FOUND
-# ICE_<component>_LIBRARY
-# ICE_<component>_LIBRARY_DEBUG
-# ICE_<component>_LIBRARY_RELEASE
+# FindIce.cmake - a CMake module for using ZeroC Ice
+#
+# Copyright (C) 2010-2011, Digium, Inc.
+#
+# This program is free software, distributed under the terms of
+# the GNU General Public License Version 2.
+#
+# Usage:
+#
+# This module supports the standard find_package() syntax, including
+# REQUIRED, QUIET and EXACT. It *never* searches for Ice along the system
+# PATH or any other CMake-provided default paths; instead, it will only
+# search in predefined locations, which are:
+#
+# ENV{ICE_HOME} if the ICE_HOME environment variable is set,
+# only that location is checked
+# /opt/Ice-<version> on UNIX-type platforms, subdirectories
+# of /opt are checked
+# C:/Ice-<version> on Windows platforms, subdirectories of C: are
+# checked
+#
+# These are the standard locations for Ice installations performed by the
+# ZeroC Ice packages; if Ice is installed in a non-standard location, then
+# ICE_HOME should be set to indicate where it is located.
+#
+# Syntax:
+#
+# find_package(Ice <major>.<minor>[.<patch>] [...])
+#
+# On the first call to this module, a major and minor version number
+# *MUST* be provided; if they are provided on subsequent calls, they
+# are ignored. During the first call, the locations listed above are
+# checked to find the highest-numbered version of Ice installed that
+# is compatible with the requested major and minor versions, unless
+# EXACT is specified, in which case only the single version specified
+# will be found (if it is available). Note that not specifying a patch
+# version number means it defaults to '0' (zero), so specifying
+# "Ice 3.4 EXACT" would in fact look for Ice 3.4.0 and no other version.
+#
+# For any call to this module, one or more COMPONENTS can be specified,
+# (and REQUIRED can be used to indicate they are not optional); each
+# name specified is expected to be a library provided with Ice, and
+# suitable tests are performed to ensure that library is part of the
+# Ice installation that was found.
+#
+# Variables used by this module:
+#
+# Ice_DEBUG If this is set to any value, the module will emit
+# debugging messages as each step of its operations
+# are performed.
+#
+# Variables set by this module:
+#
+# ICE_FOUND Will be set if a compatible version of Ice was found
+#
+# ICE_DIR The top-level directory of the Ice installation
+#
+# ICE_INCLUDE_DIR The directory containing C++ include files
+#
+# ICE_SLICE_DIR The directory containing Slice files for the
+# libraries provided with Ice
+#
+# ICE_CXX_FLAGS Any compiler flags that should be used when compiling
+# code that uses Ice
+#
+# ICE_VERSION The Ice version (complete)
+# ICE_VERSION_MAJOR The Ice major version
+# ICE_VERSION_MINOR The Ice minor version
+# ICE_VERSION_PATCH The Ice patch version
+#
+# For each component requested, sets (with <component> uppercased):
+#
+# ICE_<component>_FOUND Will be set if the component (library)
+# was found
+#
+# ICE_<component>_LIBRARY The path to the library, possibly
+# including both optimized and debug
+# if they are available
+#
+# ICE_<component>_LIBRARY_DEBUG The path to the library, as a debug
+# build if it is available, otherwise as
+# an optimized build
+#
+# ICE_<component>_LIBRARY_RELEASE The path to the library, as an optimized
+# build if it is available, otherwise as
+# a debug build
+#
find_package(PackageHandleStandardArgs)
find_package(PackageComponentHandleStandardArgs)
commit 83a0c6da2ccc323f467b1fc0d93b98d5e08288d8
Author: dsessions <dsessions at digium.com>
Date: Mon Jan 17 17:07:25 2011 -0600
Changed the build default back to vs2008.
diff --git a/init-cmake.sh b/init-cmake.sh
index 2b6743c..5ccc698 100755
--- a/init-cmake.sh
+++ b/init-cmake.sh
@@ -59,7 +59,7 @@ esac
case $platform in
win*) # for windows, default to VS9
- cmake_output="Visual Studio 10"
+ cmake_output="Visual Studio 9 2008"
;;
esac
commit 99a495424e841c8b69bd95c538b2780d99e65bb3
Author: dsessions <dsessions at digium.com>
Date: Mon Jan 17 16:33:41 2011 -0600
Added support for Cygwin and updated the default Windows platform to vs10 (after talking with Ken).
diff --git a/init-cmake.sh b/init-cmake.sh
index 9af97cf..2b6743c 100755
--- a/init-cmake.sh
+++ b/init-cmake.sh
@@ -49,16 +49,17 @@ function add_cmake_args()
}
case $(uname -s)-$(uname -m) in
- Darwin-*) platform=mac ;;
- Linux-x86_64) platform=lin64 ;;
- Linux-i[0-9]86) platform=lin32 ;;
- MINGW32*-i686) platform=win32 ;;
- *) platform=unknown ;;
+ Darwin-*) platform=mac ;;
+ Linux-x86_64) platform=lin64 ;;
+ Linux-i[0-9]86) platform=lin32 ;;
+ MINGW32*-i686) platform=win32 ;;
+ CYGWIN_NT*-i686) platform=win32 ;;
+ *) platform=unknown ;;
esac
case $platform in
win*) # for windows, default to VS9
- cmake_output="Visual Studio 9 2008"
+ cmake_output="Visual Studio 10"
;;
esac
commit 0d87aec41cd0184df2f383c0893a24e11691646d
Author: Kevin P. Fleming <kpfleming at digium.com>
Date: Mon Jan 17 15:47:31 2011 -0600
Set CMAKE_DEBUG_POSTFIX in the cache.
diff --git a/AsteriskSCF.cmake b/AsteriskSCF.cmake
index 0ebb3d6..0cbc3eb 100644
--- a/AsteriskSCF.cmake
+++ b/AsteriskSCF.cmake
@@ -151,7 +151,8 @@ endmacro()
# Function which initializes project specific things
function(asterisk_scf_project NAME ICE_VERSION)
message(STATUS "Setting up project ${NAME} for Ice version ${ICE_VERSION}")
- project(${NAME} CXX)
+ project("${NAME}" CXX)
+
# 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)
@@ -160,11 +161,13 @@ function(asterisk_scf_project NAME ICE_VERSION)
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)
+ set_cache_var(CMAKE_DEBUG_POSTFIX "d")
endif()
+
message(STATUS "Performing requirement checks for components")
find_package(Ice 3.4 REQUIRED Ice IceUtil)
# All components need the Ice library, and it needs the
commit 88834d12a56b452088360af292c10a2c939d96b3
Author: Kevin P. Fleming <kpfleming at digium.com>
Date: Mon Jan 17 15:33:27 2011 -0600
Super-import case fixes for 'Slice' name.
diff --git a/AsteriskSCF.cmake b/AsteriskSCF.cmake
index a138da9..0ebb3d6 100644
--- a/AsteriskSCF.cmake
+++ b/AsteriskSCF.cmake
@@ -375,12 +375,12 @@ function(asterisk_scf_component_add_ice_libraries COMPONENT)
set(${COMPONENT}_ICE_LIBRARIES ${libs} PARENT_SCOPE)
endfunction()
-# Adds slice files to a target. This handles all the magic of creating the
+# Adds Slice files to a target. This handles all the magic of creating the
# rules to run slice2cpp, adding the generated headers to the include path,
# adding the generated .cpp file to the component, etc. The generated files
# are placed in ${CMAKE_CURRENT_BINARY_DIR}/generated.
#
-# The slice files are passed in as a list of globs, relative to
+# The Slice files are passed in as a list of globs, relative to
# the current source directory. The globs default to regular non-recursive
# globs. If you want to include subdirectories in you glob search, also
# pass in GLOB_RECURSE.
@@ -461,7 +461,7 @@ function(asterisk_scf_component_add_one_slice COMPONENT SLICE)
# fully specify SLICE's path
set(SLICE "${CMAKE_CURRENT_SOURCE_DIR}/${SLICE}")
- # Look for the dependencies for this slice definition, we have to do it now
+ # 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_basename}")
execute_process(
commit 4834ef8baf8ea64850b9761a4d36c86029eacab9
Merge: 577cfc3 705c1a0
Author: Kevin P. Fleming <kpfleming at digium.com>
Date: Mon Jan 17 15:30:34 2011 -0600
Merge branch 'master' into ice-package
diff --cc AsteriskSCF.cmake
index 55f5ef8,5f94b18..a138da9
--- a/AsteriskSCF.cmake
+++ b/AsteriskSCF.cmake
@@@ -372,10 -498,12 +372,10 @@@ function(asterisk_scf_component_add_ice
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})
+ set(${COMPONENT}_ICE_LIBRARIES ${libs} PARENT_SCOPE)
endfunction()
- # Adds a slice file to a target. This handles all the magic of creating the
+ # Adds slice files to a target. This handles all the magic of creating the
# rules to run slice2cpp, adding the generated headers to the include path,
# adding the generated .cpp file to the component, etc. The generated files
# are placed in ${CMAKE_CURRENT_BINARY_DIR}/generated.
commit 577cfc3d97ca02e8c46c91a144b0c1bb14ddb786
Merge: 36f69e1 0e015db
Author: Kevin P. Fleming <kpfleming at digium.com>
Date: Mon Jan 17 15:29:42 2011 -0600
Merge branch 'master' into ice-package, and make AsteriskSCF.cmake
actually work using FindIce.cmake
diff --cc AsteriskSCF.cmake
index 25772d7,06d201b..55f5ef8
--- a/AsteriskSCF.cmake
+++ b/AsteriskSCF.cmake
@@@ -52,82 -52,142 +52,86 @@@ endif(
# Only permit integrated builds to be done at this time
if(NOT integrated_build)
- message(FATAL_ERROR "This project can not be built in a non-integrated fashion. Please use the gitall script present in the gitall repository.")
+ message(FATAL_ERROR "This project can not be built in a non-integrated fashion. Please use the gitall script present in the gitall repository.")
endif()
- # Use a compile test to see if shared_ptr is supported. If present then C++0x support exists.
- if(CMAKE_COMPILER_IS_GNUCXX)
- try_compile(SHARED_PTR_PRESENT
- ${CMAKE_BINARY_DIR}
- ${CMAKE_SOURCE_DIR}/cmake/tests/SharedPtr.cpp
- COMPILE_DEFINITIONS "-std=c++0x"
- OUTPUT_VARIABLE OUTPUT
- )
- if(SHARED_PTR_PRESENT)
- message(STATUS "Support for C++0x Enabled")
- add_definitions("-DCPP_ZEROX_SUPPORT")
- set(CPP_ZEROX_STD "-std=c++0x")
- else()
- message(STATUS "Support for C++0x Disabled")
- endif()
- endif()
+ message(STATUS "Installation prefix set to ${CMAKE_INSTALL_PREFIX}")
+
+ # installation directories (these are all relative to ${CMAKE_INSTALL_PREFIX})
+ set(INSTALL_SYS_CONF_DIR etc CACHE FILEPATH
+ "read-only data files that pertain to a single machine")
+ set(INSTALL_BIN_DIR bin CACHE FILEPATH
+ "executable programs that users can run")
+ set(INSTALL_LIB_DIR lib CACHE FILEPATH
+ "object files and libraries of object code")
+ set(INSTALL_DATA_ROOT_DIR share CACHE FILEPATH
+ "read-only architecture-independent data files")
+ set(INSTALL_DATA_DIR ${INSTALL_DATA_ROOT_DIR} CACHE FILEPATH
+ "idiosyncratic read-only architecture-independent data files for this program")
+ set(INSTALL_INCLUDE_DIR include CACHE FILEPATH
+ "directory for installing header files")
+ set(INSTALL_LOCAL_STATE_DIR var CACHE FILEPATH
+ "data files which the programs modify while they run, and that pertain to one specific machine")
+
-set(ASTERISK_SCF_INSTALL_CONF_DIR ${INSTALL_SYS_CONF_DIR}/asterisk-scf
- CACHE FILEPATH "AsteriskSCF files")
-set(ASTERISK_SCF_INSTALL_BIN_DIR ${INSTALL_BIN_DIR} CACHE FILEPATH
- "AsteriskSCF executable programs")
-set(ASTERISK_SCF_INSTALL_LIB_DIR ${INSTALL_LIB_DIR} CACHE FILEPATH
- "AsteriskSCF libraries")
-set(ASTERISK_SCF_INSTALL_ICEBOX_DIR ${INSTALL_LIB_DIR}/asterisk-scf/icebox
- CACHE FILEPATH "AsteriskSCF Icebox modules")
++set(ASTERISK_SCF_INSTALL_CONF_DIR
++ ${INSTALL_SYS_CONF_DIR}/asterisk-scf CACHE FILEPATH
++ "Asterisk SCF files")
++set(ASTERISK_SCF_INSTALL_BIN_DIR
++ ${INSTALL_BIN_DIR} CACHE FILEPATH
++ "Asterisk SCF executable programs")
++set(ASTERISK_SCF_INSTALL_LIB_DIR
++ ${INSTALL_LIB_DIR} CACHE FILEPATH
++ "Asterisk SCF libraries")
++set(ASTERISK_SCF_INSTALL_ICEBOX_DIR
++ ${INSTALL_LIB_DIR}/asterisk-scf/icebox
++ CACHE FILEPATH
++ "Asterisk SCF IceBox modules")
+ set(ASTERISK_SCF_INSTALL_LOCAL_STATE_DIR
+ ${INSTALL_LOCAL_STATE_DIR}/lib/asterisk-scf CACHE FILEPATH
- "AsteriskSCF local state files")
-set(ASTERISK_SCF_INSTALL_LOG_FILE ${INSTALL_LOCAL_STATE_DIR}/log/asterisk-scf.log
- CACHE FILEPATH "AsteriskSCF logfile")
-set(ASTERISK_SCF_INSTALL_INCLUDE_DIR ${INSTALL_INCLUDE_DIR} CACHE FILEPATH
- "AsteriskSCF directory for installing include files")
-set(ASTERISK_SCF_INSTALL_SLICE_DIR ${INSTALL_DATA_DIR}/asterisk-scf/slice
- CACHE FILEPATH "AsteriskSCF directory for installing slice files")
++ "Asterisk SCF local state files")
++set(ASTERISK_SCF_INSTALL_LOG_FILE
++ ${INSTALL_LOCAL_STATE_DIR}/log/asterisk-scf.log CACHE FILEPATH
++ "Asterisk SCF logfile")
++set(ASTERISK_SCF_INSTALL_INCLUDE_DIR
++ ${INSTALL_INCLUDE_DIR} CACHE FILEPATH
++ "Directory for installed Asterisk SCF API C++ header files")
++set(ASTERISK_SCF_INSTALL_SLICE_DIR
++ ${INSTALL_DATA_DIR}/asterisk-scf/slice CACHE FILEPATH
++ "Directory for installed Asterisk SCF API Slice files")
+
+ mark_as_advanced(
- INSTALL_SYS_CONF_DIR
- INSTALL_BIN_DIR
- INSTALL_LIB_DIR
- INSTALL_DATA_ROOT_DIR
- INSTALL_DATA_DIR
- INSTALL_INCLUDE_DIR
- INSTALL_LOCAL_STATE_DIR
+ ASTERISK_SCF_INSTALL_CONF_DIR
+ ASTERISK_SCF_INSTALL_BIN_DIR
+ ASTERISK_SCF_INSTALL_LIB_DIR
+ ASTERISK_SCF_INSTALL_ICEBOX_DIR
+ ASTERISK_SCF_INSTALL_LOCAL_STATE_DIR
+ ASTERISK_SCF_INSTALL_LOG_FILE
+ ASTERISK_SCF_INSTALL_INCLUDE_DIR
+ ASTERISK_SCF_INSTALL_SLICE_DIR)
-# Use a compile test to see if shared_ptr is supported. If present then C++0x support exists.
-if(CMAKE_COMPILER_IS_GNUCXX)
- try_compile(SHARED_PTR_PRESENT
- ${CMAKE_BINARY_DIR}
- ${CMAKE_SOURCE_DIR}/cmake/tests/SharedPtr.cpp
- COMPILE_DEFINITIONS "-std=c++0x"
- OUTPUT_VARIABLE OUTPUT
- )
- if(SHARED_PTR_PRESENT)
- message(STATUS "Support for C++0x Enabled")
- add_definitions("-DCPP_ZEROX_SUPPORT")
- set(CPP_ZEROX_STD "-std=c++0x")
- else()
... 25035 lines suppressed ...
--
asterisk-scf/integration/cmake.git
More information about the asterisk-scf-commits
mailing list