[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
Fri Oct 29 13:44:30 CDT 2010


branch "master" has been updated
       via  d8108e7dbd5e37e9023e62db8e51848dfff489cd (commit)
      from  42917e1074f7bf2d3a0e1bd2f3383b57ec1349cf (commit)

Summary of changes:
 AsteriskSCF.cmake |   62 +++++++++++++++++++++++++++++++++++-----------------
 1 files changed, 42 insertions(+), 20 deletions(-)


- Log -----------------------------------------------------------------
commit d8108e7dbd5e37e9023e62db8e51848dfff489cd
Author: Joshua Colp <jcolp at digium.com>
Date:   Fri Oct 29 15:45:58 2010 -0300

    Properly link against Ice libraries under Linux.

diff --git a/AsteriskSCF.cmake b/AsteriskSCF.cmake
index 41548e8..7415c34 100644
--- a/AsteriskSCF.cmake
+++ b/AsteriskSCF.cmake
@@ -8,11 +8,11 @@
 # any of the maintainers of this project for assistance;
 # the project provides a web site, mailing lists and IRC
 # channels for your use.
-# 
+#
 # This program is free software, distributed under the terms of
 # the GNU General Public License Version 2. See the LICENSE.txt file
 # at the top of the source tree.
-# 
+#
 
 # Asterisk SCF component build infrastructure
 
@@ -120,9 +120,9 @@ function(find_ICE version)
   set(ice "$ENV{ICE_HOME}")
   if(NOT ice)
       if(WIN32)
-        find_best_version(ice "C:/Ice-${version}")
+	find_best_version(ice "C:/Ice-${version}")
       elseif(UNIX)
-        find_best_version(ice "/opt/Ice-${version}")
+	find_best_version(ice "/opt/Ice-${version}")
       endif()
   endif()
 
@@ -182,6 +182,8 @@ function(find_ICE_CXX_library LIBRARY)
     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")
@@ -281,7 +283,7 @@ function(asterisk_scf_project NAME ICE_VERSION)
         find_ICE_CXX_library(ZeroCIce)
         set(ICE_CXX_LIB_Ice ${ICE_CXX_LIB_ZeroCIce})
       else()
-        find_ICE_CXX_library(Ice)
+	find_ICE_CXX_library(Ice)
       endif()
       find_ICE_CXX_library(IceUtil)
       if(WIN32)
@@ -337,7 +339,7 @@ function(asterisk_scf_add_boost_libraries)
   link_directories(${Boost_LIBRARY_DIRS})
 endfunction()
 
-# Ensures that a list of paths are all absolute paths. 
+# Ensures that a list of paths are all absolute paths.
 macro(ensure_abs_paths pathlist)
   unset(eap_temp)
   foreach(p ${${pathlist}})
@@ -549,7 +551,7 @@ function(asterisk_scf_compile_slice TARGET_IN DIR_IN DESC_IN GROUP_IN)
     # 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
+		    --depend ${slice_files} OUTPUT_VARIABLE raw_dependencies
 		    ERROR_VARIABLE slice_errors)
     if(slice_errors)
       message(FATAL_ERROR "Slice compiler produced errors:\n ${slice_errors}")
@@ -624,10 +626,14 @@ function(asterisk_scf_compile_slice TARGET_IN DIR_IN DESC_IN GROUP_IN)
       # 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}})
-	list(APPEND target_libs "${ICE_${lang}_LIB_${lib}}")
+	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})
+			 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
@@ -636,19 +642,23 @@ function(asterisk_scf_compile_slice TARGET_IN DIR_IN DESC_IN GROUP_IN)
       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})
+	 # 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}})
-	list(APPEND target_libs "${ICE_${lang}_LIB_${lib}}")
+	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})
+	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}")
@@ -773,9 +783,13 @@ function(asterisk_scf_component_build_icebox COMPONENT)
   list(APPEND icelibs IceBox ${ASTERISK_SCF_ICE_LIBRARIES_${lang}} ${${COMPONENT}_ICE_LIBRARIES})
   list(REMOVE_DUPLICATES icelibs)
   foreach(lib ${icelibs})
-    list(APPEND target_libs "${ICE_${lang}_LIB_${lib}}")
+    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
@@ -804,7 +818,11 @@ function(asterisk_scf_component_build_standalone COMPONENT)
   list(APPEND icelibs ${ASTERISK_SCF_ICE_LIBRARIES_${lang}} ${${COMPONENT}_ICE_LIBRARIES})
   list(REMOVE_DUPLICATES icelibs)
   foreach(lib ${icelibs})
-    list(APPEND target_libs "${ICE_${lang}_LIB_${lib}}")
+    if(UNIX)
+      list(APPEND target_libs "${lib}")
+    else()
+      list(APPEND target_libs "${ICE_${lang}_LIB_${lib}}")
+    endif()
   endforeach()
 
   if(lang STREQUAL "CXX")
@@ -836,7 +854,11 @@ function(asterisk_scf_component_build_library COMPONENT)
   endif()
 
   foreach(lib ${icelibs})
-    list(APPEND target_libs "${ICE_${lang}_LIB_${lib}}")
+    if(UNIX)
+      list(APPEND target_libs "${lib}")
+    else()
+      list(APPEND target_libs "${ICE_${lang}_LIB_${lib}}")
+    endif()
   endforeach()
 
   if(lang STREQUAL "CXX")
@@ -867,7 +889,7 @@ function(asterisk_scf_component_install COMPONENTNAME TYPE DIR DESC GROUP)
 endfunction()
 
 # Adds a component to the packager. COMPONENTNAME must have been previously defined
-# via the install command. 
+# via the install command.
 function(asterisk_scf_component_package COMPONENTNAME DESC GROUPNAME)
       cpack_add_component(${COMPONENTNAME} DESCRIPTION ${DESC} GROUP ${GROUP})
 endfunction()

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


-- 
asterisk-scf/release/cmake.git



More information about the asterisk-scf-commits mailing list