[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 Apr 8 12:57:02 CDT 2011


branch "master" has been updated
       via  7a90d1536f85845e1a0005b29b72a51e12def2f5 (commit)
      from  373e081ef8278f0489cd59014ffab0010a1bc5c9 (commit)

Summary of changes:
 AsteriskSCF.cmake       |   25 +++++++++++++++---
 modules/pjproject.cmake |   63 +++++++++++++++++++++++++++-------------------
 2 files changed, 58 insertions(+), 30 deletions(-)


- Log -----------------------------------------------------------------
commit 7a90d1536f85845e1a0005b29b72a51e12def2f5
Author: Brent Eagles <beagles at digium.com>
Date:   Fri Apr 8 15:10:20 2011 -0230

    - Add support for newer versions of Boost.
    - Add support for x64 builds that include pjproject on Windows.

diff --git a/AsteriskSCF.cmake b/AsteriskSCF.cmake
index 2eff59c..990b117 100644
--- a/AsteriskSCF.cmake
+++ b/AsteriskSCF.cmake
@@ -126,10 +126,23 @@ if(WIN32 AND ${CMAKE_BUILD_TYPE} STREQUAL profile)
     message(FATAL_ERROR "Profile builds not supported")
 endif()
 
-# The <config>.in files and any other script that reference binary 
-# directories need to account for the /Debug and /Release subdirectories for Windows.
 if(WIN32)
-	set(binsubdir "/${CMAKE_BUILD_TYPE}" CACHE INTERNAL "Subfolder for binary output. Only set on Windows.")
+    # The <config>.in files and any other script that reference binary 
+    # directories need to account for the /Debug and /Release subdirectories for Windows.
+    set(binsubdir "/${CMAKE_BUILD_TYPE}" CACHE INTERNAL "Subfolder for binary output. Only set on Windows.")
+
+    #
+    # On 64 bit builds on Windows (Windows x64), projects that include
+    # pjproject header files need to define the architecture to allow
+    # the appropriate definitions to be compiled in. Note that this may
+    # not be entirely accurate as its not clear whether CMake defines this
+    # as 1 when IA64 is the target. Seeing as IA64 is not common and our
+    # projects don't have support for it anyway, we'll go with the
+    # assumption that this is an x64 type platform.
+    #
+    if(${CMAKE_CL_64})
+        add_definitions(-D__amd64)	
+    endif()
 endif()
 
 if(${CMAKE_BUILD_TYPE} STREQUAL profile)
@@ -278,7 +291,11 @@ endfunction()
 # Find a Boost library.
 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")
+        #
+	# Only specify those versions that are not "known" by default for
+	# the oldest version of cmake supported.
+	# 
+        set(Boost_ADDITIONAL_VERSIONS "1.45" "1.45.0" "1.46" "1.46.0" "1.46.1")
         find_package(Boost ${MIN_BOOST_VERSION})
         if(NOT Boost_FOUND)
             message(FATAL_ERROR "Boost libraries v${MIN_BOOST_VERSION} or better not found")
diff --git a/modules/pjproject.cmake b/modules/pjproject.cmake
index d60c484..1ce4a82 100644
--- a/modules/pjproject.cmake
+++ b/modules/pjproject.cmake
@@ -108,46 +108,57 @@ function(pjproject_link COMPONENT PJPROJECT_COMPONENT)
     endif()
   elseif(MSVC80 OR MSVC90 OR MSVC10)
     if(MSVC10)
-        set(MSVC_VERSION "vc10")
+        set(MSVC_VERSION "v100")
     else()
         set(MSVC_VERSION "vc8")
     endif()
+    if(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x86")
+	if(${CMAKE_CL_64})
+	   set(X_CPU "amd64")
+	   set(X_TARG "x64")
+	else()
+  	   set(X_CPU "x86")
+	   set(X_TARG "Win32")
+        endif()
+    endif()
     if(${PJPROJECT_COMPONENT} STREQUAL "pjsip")
-      if(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x86")
-	target_link_libraries(${COMPONENT} debug "pjsip-core-i386-Win32-${MSVC_VERSION}-Debug")
-	target_link_libraries(${COMPONENT} optimized "pjsip-core-i386-Win32-${MSVC_VERSION}-Release")
-	target_link_libraries(${COMPONENT} debug "pjsip-simple-i386-Win32-${MSVC_VERSION}-Debug")
-	target_link_libraries(${COMPONENT} optimized "pjsip-simple-i386-Win32-${MSVC_VERSION}-Release")
-	target_link_libraries(${COMPONENT} debug "pjsip-ua-i386-Win32-${MSVC_VERSION}-Debug")
-	target_link_libraries(${COMPONENT} optimized "pjsip-ua-i386-Win32-${MSVC_VERSION}-Release")
-	target_link_libraries(${COMPONENT} debug "pjsua-lib-i386-Win32-${MSVC_VERSION}-Debug")
-	target_link_libraries(${COMPONENT} optimized "pjsua-lib-i386-Win32-${MSVC_VERSION}-Release")
-      endif()
+      target_link_libraries(${COMPONENT} debug "pjsip-core-${X_CPU}-${X_TARG}-${MSVC_VERSION}-Debug")
+      target_link_libraries(${COMPONENT} optimized "pjsip-core-${X_CPU}-${X_TARG}-${MSVC_VERSION}-Release")
+      target_link_libraries(${COMPONENT} debug "pjsip-simple-${X_CPU}-${X_TARG}-${MSVC_VERSION}-Debug")
+      target_link_libraries(${COMPONENT} optimized "pjsip-simple-${X_CPU}-${X_TARG}-${MSVC_VERSION}-Release")
+      target_link_libraries(${COMPONENT} debug "pjsip-ua-${X_CPU}-${X_TARG}-${MSVC_VERSION}-Debug")
+      target_link_libraries(${COMPONENT} optimized "pjsip-ua-${X_CPU}-${X_TARG}-${MSVC_VERSION}-Release")
+      target_link_libraries(${COMPONENT} debug "pjsua-lib-${X_CPU}-${X_TARG}-${MSVC_VERSION}-Debug")
+      target_link_libraries(${COMPONENT} optimized "pjsua-lib-${X_CPU}-${X_TARG}-${MSVC_VERSION}-Release")
       add_dependencies(${COMPONENT} pjsip_core pjsip_simple pjsip_ua pjsua_lib)
     elseif(${PJPROJECT_COMPONENT} STREQUAL "pjlib-util")
       add_dependencies(${COMPONENT} pjlib_util)
-      if(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x86")
-	target_link_libraries(${COMPONENT} debug "pjlib-util-i386-Win32-${MSVC_VERSION}-Debug") 
-	target_link_libraries(${COMPONENT} optimized "pjlib-util-i386-Win32-${MSVC_VERSION}-Release")
-      endif()
+      target_link_libraries(${COMPONENT} debug "pjlib-util-${X_CPU}-${X_TARG}-${MSVC_VERSION}-Debug") 
+      target_link_libraries(${COMPONENT} optimized "pjlib-util-${X_CPU}-${X_TARG}-${MSVC_VERSION}-Release")
     elseif(${PJPROJECT_COMPONENT} STREQUAL "pjmedia")
-      if(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x86")
-	target_link_libraries(${COMPONENT} debug "pjmedia-i386-Win32-${MSVC_VERSION}-Debug") 
-	target_link_libraries(${COMPONENT} optimized "pjmedia-i386-Win32-${MSVC_VERSION}-Release")
-	target_link_libraries(${COMPONENT} debug "pjmedia-audiodev-i386-Win32-${MSVC_VERSION}-Debug") 
-	target_link_libraries(${COMPONENT} optimized "pjmedia-audiodev-i386-Win32-${MSVC_VERSION}-Release")
-	target_link_libraries(${COMPONENT} debug "libsrtp-i386-Win32-${MSVC_VERSION}-Debug") 
-	target_link_libraries(${COMPONENT} optimized "libsrtp-i386-Win32-${MSVC_VERSION}-Release")
-      endif()
+      target_link_libraries(${COMPONENT} debug "pjmedia-${X_CPU}-${X_TARG}-${MSVC_VERSION}-Debug") 
+      target_link_libraries(${COMPONENT} optimized "pjmedia-${X_CPU}-${X_TARG}-${MSVC_VERSION}-Release")
+      target_link_libraries(${COMPONENT} debug "pjmedia-audiodev-${X_CPU}-${X_TARG}-${MSVC_VERSION}-Debug") 
+      target_link_libraries(${COMPONENT} optimized "pjmedia-audiodev-${X_CPU}-${X_TARG}-${MSVC_VERSION}-Release")
+      target_link_libraries(${COMPONENT} debug "libsrtp-${X_CPU}-${X_TARG}-${MSVC_VERSION}-Debug") 
+      target_link_libraries(${COMPONENT} optimized "libsrtp-${X_CPU}-${X_TARG}-${MSVC_VERSION}-Release")
       add_dependencies(${COMPONENT} pjmedia)
     else()
-      if(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x86")
+      if(${CMAKE_CL_64})
+	if(${PJPROJECT_COMPONENT} STREQUAL "pjlib")
+	  # pjlib has the additional requirement of winsock2
+	  target_link_libraries(${COMPONENT} "ws2_32")
+	endif()
+	target_link_libraries(${COMPONENT} debug "${PJPROJECT_COMPONENT}-${X_CPU}-${X_TARG}-${MSVC_VERSION}-Debug") 
+	target_link_libraries(${COMPONENT} optimized "${PJPROJECT_COMPONENT}-${X_CPU}-${X_TARG}-${MSVC_VERSION}-Release")
+	add_dependencies(${COMPONENT} ${PJPROJECT_COMPONENT})
+      elseif(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x86")
 	if(${PJPROJECT_COMPONENT} STREQUAL "pjlib")
 	  # pjlib has the additional requirement of winsock2
 	  target_link_libraries(${COMPONENT} "ws2_32")
 	endif()
-	target_link_libraries(${COMPONENT} debug "${PJPROJECT_COMPONENT}-i386-Win32-${MSVC_VERSION}-Debug") 
-	target_link_libraries(${COMPONENT} optimized "${PJPROJECT_COMPONENT}-i386-Win32-${MSVC_VERSION}-Release")
+	target_link_libraries(${COMPONENT} debug "${PJPROJECT_COMPONENT}-${X_CPU}-${X_TARG}-${MSVC_VERSION}-Debug") 
+	target_link_libraries(${COMPONENT} optimized "${PJPROJECT_COMPONENT}-${X_CPU}-${X_TARG}-${MSVC_VERSION}-Release")
 	add_dependencies(${COMPONENT} ${PJPROJECT_COMPONENT})
       endif()
     endif()

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


-- 
asterisk-scf/release/cmake.git



More information about the asterisk-scf-commits mailing list