[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 Sep 29 15:38:53 CDT 2010


branch "master" has been updated
       via  3aeb15916a3e5026d9b5b3dc75f3693ee243901a (commit)
       via  c1aa848532aff5f16f1d4d9b2b57461f763ac177 (commit)
       via  d3b843cabe05fa2413cc30aad070c37d46b5e1cc (commit)
      from  2bc8a018ed175d2f4155a3be171d23967052d627 (commit)

Summary of changes:
 modules/pjproject.cmake |   68 ++++++++++++++++++++++++++--------------------
 1 files changed, 38 insertions(+), 30 deletions(-)


- Log -----------------------------------------------------------------
commit 3aeb15916a3e5026d9b5b3dc75f3693ee243901a
Author: Kevin P. Fleming <kpfleming at digium.com>
Date:   Wed Sep 29 15:26:12 2010 -0500

    actually test whether libuuid is usable, since that is what pjproject will do as well

diff --git a/modules/pjproject.cmake b/modules/pjproject.cmake
index bdbe42d..92e97b3 100644
--- a/modules/pjproject.cmake
+++ b/modules/pjproject.cmake
@@ -6,11 +6,17 @@ find_package(Threads)
 # with that library as well (since the pjproject libraries can't indicate to the linker that libuuid is needed).
 if(UNIX)
   include(FindPkgConfig)
+  include(CheckIncludeFiles)
+  include(CheckLibraryExists)
   pkg_check_modules(LIBUUID uuid)
   if(LIBUUID_LIBRARIES)
-    set(PJMEDIA_LIBRARIES ${LIBUUID_LIBRARIES} CACHE INTERNAL Bob FORCE)
-    if(LIBUUID_LIBRARY_DIRS)
-      link_directories(${LIBUUID_LIBRARY_DIRS})
+    check_include_files(uuid/uuid.h HAVE_UUID_H)
+    check_library_exists(uuid uuid_generate "${LIBUUID_LIBRARY_DIRS}" HAVE_LIBUUID)
+    if(HAVE_UUID_H AND HAVE_LIBUUID)
+      set(PJMEDIA_LIBRARIES ${LIBUUID_LIBRARIES} CACHE INTERNAL Bob FORCE)
+      if(LIBUUID_LIBRARY_DIRS)
+	link_directories(${LIBUUID_LIBRARY_DIRS})
+      endif()
     endif()
   endif()
 endif()

commit c1aa848532aff5f16f1d4d9b2b57461f763ac177
Author: Kevin P. Fleming <kpfleming at digium.com>
Date:   Wed Sep 29 15:14:40 2010 -0500

    Formatting consistency.

diff --git a/modules/pjproject.cmake b/modules/pjproject.cmake
index d38ba13..bdbe42d 100644
--- a/modules/pjproject.cmake
+++ b/modules/pjproject.cmake
@@ -23,42 +23,42 @@ add_custom_target(pjproject-distclean COMMAND "make" "distclean" "TARGET_NAME=as
 
 # Function which adds build targets for the following supported pjproject components: pjlib, pjlib-util, pjnath, pjmedia, pjsip.
 function(pjproject_build PJPROJECT_COMPONENT)
-  if (UNIX)
-    if (${PJPROJECT_COMPONENT} STREQUAL "third_party")
+  if(UNIX)
+    if(${PJPROJECT_COMPONENT} STREQUAL "third_party")
       add_custom_target("pjproject-third_party" COMMAND "make" "TARGET_NAME=asteriskscf" WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/pjproject/third_party/build" COMMENT "Building pjproject third party components")
     else()
       add_custom_target("pjproject-${PJPROJECT_COMPONENT}" COMMAND "make" "TARGET_NAME=asteriskscf" "DIRS=${PJPROJECT_COMPONENT}" WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/pjproject" COMMENT "Building pjproject-${PJPROJECT_COMPONENT}" DEPENDS "${CMAKE_SOURCE_DIR}/pjproject/pjlib/include/pj/config_site.h")
       add_dependencies("pjproject-${PJPROJECT_COMPONENT}" "pjproject-pjlib")
     endif()
-    if (${PJPROJECT_COMPONENT} STREQUAL "pjsip")
+    if(${PJPROJECT_COMPONENT} STREQUAL "pjsip")
       add_dependencies("pjproject-pjsip" "pjproject-pjmedia")
-    elseif (${PJPROJECT_COMPONENT} STREQUAL "pjmedia")
+    elseif(${PJPROJECT_COMPONENT} STREQUAL "pjmedia")
       add_dependencies("pjproject-pjmedia" "pjproject-third_party" "pjproject-pjnath")
-    elseif (${PJPROJECT_COMPONENT} STREQUAL "pjnath")
+    elseif(${PJPROJECT_COMPONENT} STREQUAL "pjnath")
       add_dependencies("pjproject-pjnath", "pjproject-pjlib-util")
     endif()
-  elseif (MSVC80 OR MSVC90)
-    if (${PJPROJECT_COMPONENT} STREQUAL "pjlib-util")
+  elseif(MSVC80 OR MSVC90)
+    if(${PJPROJECT_COMPONENT} STREQUAL "pjlib-util")
       include_external_msproject(pjlib_util "${CMAKE_SOURCE_DIR}/pjproject/pjlib-util/build/pjlib_util.vcproj")
-    elseif (${PJPROJECT_COMPONENT} STREQUAL "pjsip")
+    elseif(${PJPROJECT_COMPONENT} STREQUAL "pjsip")
       include_external_msproject(pjsip_core "${CMAKE_SOURCE_DIR}/pjproject/pjsip/build/pjsip_core.vcproj")
       include_external_msproject(pjsip_simple "${CMAKE_SOURCE_DIR}/pjproject/pjsip/build/pjsip_simple.vcproj")
       include_external_msproject(pjsip_ua "${CMAKE_SOURCE_DIR}/pjproject/pjsip/build/pjsip_ua.vcproj")
       include_external_msproject(pjsua_lib "${CMAKE_SOURCE_DIR}/pjproject/pjsip/build/pjsua_lib.vcproj")
       add_dependencies(pjsip_core pjsip_simple pjsip_ua pjsua_lib)
-    elseif (${PJPROJECT_COMPONENT} STREQUAL "pjmedia")
+    elseif(${PJPROJECT_COMPONENT} STREQUAL "pjmedia")
       include_external_msproject(pjmedia "${CMAKE_SOURCE_DIR}/pjproject/pjmedia/build/pjmedia.vcproj")
       include_external_msproject(pjmedia_audiodev "${CMAKE_SOURCE_DIR}/pjproject/pjmedia/build/pjmedia_audiodev.vcproj")
       include_external_msproject(srtp "${CMAKE_SOURCE_DIR}/pjproject/third_party/build/srtp/libsrtp.vcproj")
       add_dependencies(pjmedia pjmedia_audiodev srtp)
-    elseif (${PJPROJECT_COMPONENT} STREQUAL "third_party")
+    elseif(${PJPROJECT_COMPONENT} STREQUAL "third_party")
     else()
       include_external_msproject(${PJPROJECT_COMPONENT} "${CMAKE_SOURCE_DIR}/pjproject/${PJPROJECT_COMPONENT}/build/${PJPROJECT_COMPONENT}.vcproj")
     endif()
   else()
     message(STATUS "Unfortunately you are building on a platform which does not support automatic pjproject building. You will have to build pjproject manually.")
   endif()
-  if (${PJPROJECT_COMPONENT} STREQUAL "pjmedia")
+  if(${PJPROJECT_COMPONENT} STREQUAL "pjmedia")
     link_directories("${CMAKE_SOURCE_DIR}/pjproject/third_party/lib")
   endif()
   include_directories("${CMAKE_SOURCE_DIR}/pjproject/${PJPROJECT_COMPONENT}/include")
@@ -67,17 +67,17 @@ endfunction()
 
 # Function which links a component against a pjproject component
 function(pjproject_link COMPONENT PJPROJECT_COMPONENT)
-  if (UNIX)
+  if(UNIX)
     add_dependencies(${COMPONENT} "pjproject-${PJPROJECT_COMPONENT}")
     target_link_libraries(${COMPONENT} ${CMAKE_THREAD_LIBS_INIT})
-    if (${PJPROJECT_COMPONENT} STREQUAL "pjsip")
+    if(${PJPROJECT_COMPONENT} STREQUAL "pjsip")
       target_link_libraries(${COMPONENT} "pjsip-asteriskscf")
       target_link_libraries(${COMPONENT} "pjsip-simple-asteriskscf")
       target_link_libraries(${COMPONENT} "pjsip-ua-asteriskscf")
       target_link_libraries(${COMPONENT} "pjsua-asteriskscf")
-    elseif (${PJPROJECT_COMPONENT} STREQUAL "pjlib")
+    elseif(${PJPROJECT_COMPONENT} STREQUAL "pjlib")
       target_link_libraries(${COMPONENT} "pj-asteriskscf")
-    elseif (${PJPROJECT_COMPONENT} STREQUAL "pjmedia")
+    elseif(${PJPROJECT_COMPONENT} STREQUAL "pjmedia")
       target_link_libraries(${COMPONENT} "pjmedia-asteriskscf")
       target_link_libraries(${COMPONENT} "pjmedia-codec-asteriskscf")
       target_link_libraries(${COMPONENT} "pjsdp-asteriskscf")
@@ -89,9 +89,9 @@ function(pjproject_link COMPONENT PJPROJECT_COMPONENT)
     else()
       target_link_libraries(${COMPONENT} "${PJPROJECT_COMPONENT}-asteriskscf")
     endif()
-  elseif (MSVC80 OR MSVC90)
-    if (${PJPROJECT_COMPONENT} STREQUAL "pjsip")
-      if (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x86")
+  elseif(MSVC80 OR MSVC90)
+    if(${PJPROJECT_COMPONENT} STREQUAL "pjsip")
+      if(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x86")
 	target_link_libraries(${COMPONENT} debug "pjsip-core-i386-Win32-vc8-Debug")
 	target_link_libraries(${COMPONENT} optimized "pjsip-core-i386-Win32-vc8-Release")
 	target_link_libraries(${COMPONENT} debug "pjsip-simple-i386-Win32-vc8-Debug")
@@ -102,14 +102,14 @@ function(pjproject_link COMPONENT PJPROJECT_COMPONENT)
 	target_link_libraries(${COMPONENT} optimized "pjsua-lib-i386-Win32-vc8-Release")
       endif()
       add_dependencies(${COMPONENT} pjsip_core pjsip_simple pjsip_ua pjsua_lib)
-    elseif (${PJPROJECT_COMPONENT} STREQUAL "pjlib-util")
+    elseif(${PJPROJECT_COMPONENT} STREQUAL "pjlib-util")
       add_dependencies(${COMPONENT} pjlib_util)
-      if (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x86")
+      if(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x86")
 	target_link_libraries(${COMPONENT} debug "pjlib-util-i386-Win32-vc8-Debug") 
 	target_link_libraries(${COMPONENT} optimized "pjlib-util-i386-Win32-vc8-Release")
       endif()
-    elseif (${PJPROJECT_COMPONENT} STREQUAL "pjmedia")
-      if (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x86")
+    elseif(${PJPROJECT_COMPONENT} STREQUAL "pjmedia")
+      if(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x86")
 	target_link_libraries(${COMPONENT} debug "pjmedia-i386-Win32-vc8-Debug") 
 	target_link_libraries(${COMPONENT} optimized "pjmedia-i386-Win32-vc8-Release")
 	target_link_libraries(${COMPONENT} debug "pjmedia-audiodev-i386-Win32-vc8-Debug") 
@@ -119,8 +119,8 @@ function(pjproject_link COMPONENT PJPROJECT_COMPONENT)
       endif()
       add_dependencies(${COMPONENT} pjmedia)
     else()
-      if (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x86")
-	if (${PJPROJECT_COMPONENT} STREQUAL "pjlib")
+      if(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x86")
+	if(${PJPROJECT_COMPONENT} STREQUAL "pjlib")
 	  # pjlib has the additional requirement of winsock2
 	  target_link_libraries(${COMPONENT} "ws2_32")
 	endif()

commit d3b843cabe05fa2413cc30aad070c37d46b5e1cc
Author: Kevin P. Fleming <kpfleming at digium.com>
Date:   Wed Sep 29 15:14:04 2010 -0500

    Only perform the libuuid lookup stuff on Unix-type platforms; Windows does not have this.

diff --git a/modules/pjproject.cmake b/modules/pjproject.cmake
index 44315eb..d38ba13 100644
--- a/modules/pjproject.cmake
+++ b/modules/pjproject.cmake
@@ -4,12 +4,14 @@ find_package(Threads)
 
 # The pjproject code will use libuuid if it is installed; in this situation, we need to be aware of it so we can link our components
 # with that library as well (since the pjproject libraries can't indicate to the linker that libuuid is needed).
-include(FindPkgConfig)
-pkg_check_modules(LIBUUID uuid)
-if(LIBUUID_LIBRARIES)
-  set(PJMEDIA_LIBRARIES ${LIBUUID_LIBRARIES} CACHE INTERNAL Bob FORCE)
-  if(LIBUUID_LIBRARY_DIRS)
-    link_directories(${LIBUUID_LIBRARY_DIRS})
+if(UNIX)
+  include(FindPkgConfig)
+  pkg_check_modules(LIBUUID uuid)
+  if(LIBUUID_LIBRARIES)
+    set(PJMEDIA_LIBRARIES ${LIBUUID_LIBRARIES} CACHE INTERNAL Bob FORCE)
+    if(LIBUUID_LIBRARY_DIRS)
+      link_directories(${LIBUUID_LIBRARY_DIRS})
+    endif()
   endif()
 endif()
 

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


-- 
asterisk-scf/release/cmake.git



More information about the asterisk-scf-commits mailing list