[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
Tue Jul 19 13:40:50 CDT 2011


branch "master" has been updated
       via  ebde1b0550c4ce1ab1b61a3bc555278749e151ab (commit)
       via  cff344199fa958787c5a949ba1c294a459ecba85 (commit)
       via  fa9c9336f1c6065b512a1e5da3a39f332d0c699f (commit)
      from  cb52eb3c02ed74e61b05906858cdb5beb430565b (commit)

Summary of changes:
 AsteriskSCF.cmake                    |   19 +++++++++--------
 modules/pjproject-configure.cmake.in |    2 +
 modules/pjproject.cmake              |   37 +++++++++++++++++++++++++++------
 3 files changed, 42 insertions(+), 16 deletions(-)
 create mode 100644 modules/pjproject-configure.cmake.in


- Log -----------------------------------------------------------------
commit ebde1b0550c4ce1ab1b61a3bc555278749e151ab
Author: Kevin P. Fleming <kpfleming at digium.com>
Date:   Tue Jul 19 13:38:48 2011 -0500

    Ensure that the project's compiler flags are used when building pjproject.
    
    With these changes, any compiler flags set by the CMake project that brings
    in pjproject.cmake will be provided to the pjproject 'configure' script, and
    will be applied to the builds made by its build system. This will allow
    debuggers to see into the pjproject code, if the containing project is being
    built in 'debug' mode.

diff --git a/modules/pjproject-configure.cmake.in b/modules/pjproject-configure.cmake.in
new file mode 100644
index 0000000..f4f17de
--- /dev/null
+++ b/modules/pjproject-configure.cmake.in
@@ -0,0 +1,2 @@
+set(ENV{CFLAGS} "${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_${CMAKE_BUILD_TYPE}} ${ADDITIONAL_CFLAGS}")
+execute_process(COMMAND "./configure" "--disable-sound")
diff --git a/modules/pjproject.cmake b/modules/pjproject.cmake
index d632a5a..8dd11c4 100644
--- a/modules/pjproject.cmake
+++ b/modules/pjproject.cmake
@@ -25,21 +25,44 @@ endif()
 
 # This is a simple check to see if we are doing a 64-bit build, if so we need to get pjproject to use -fPIC so the icebox services can get built
 if (CMAKE_SIZEOF_VOID_P MATCHES 8)
-  set(ADDITIONAL_CONFIGURE_ARGUMENTS "CFLAGS=-fPIC")
+  set(ADDITIONAL_CFLAGS "-fPIC")
 endif()
 
-add_custom_command(OUTPUT "${CMAKE_SOURCE_DIR}/pjproject/build.mak" COMMAND "./configure" "--disable-sound" ${ADDITIONAL_CONFIGURE_ARGUMENTS} WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/pjproject" COMMENT "Configuring pjproject")
-add_custom_command(OUTPUT "${CMAKE_SOURCE_DIR}/pjproject/pjlib/build/.pjlib-asteriskscf.depend" COMMAND "make" "dep" "TARGET_NAME=asteriskscf" WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/pjproject" COMMENT "Dependency generating pjproject" DEPENDS "${CMAKE_SOURCE_DIR}/pjproject/build.mak")
-add_custom_target(pjproject-clean COMMAND "make" "clean" "TARGET_NAME=asteriskscf" WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/pjproject" COMMENT "Cleaning pjproject")
-add_custom_target(pjproject-distclean COMMAND "make" "distclean" "TARGET_NAME=asteriskscf" WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/pjproject" COMMENT "Deep cleaning pjproject")
+configure_file("${CMAKE_SOURCE_DIR}/cmake/modules/pjproject-configure.cmake.in" pjproject-configure.cmake)
+
+add_custom_command(OUTPUT "${CMAKE_SOURCE_DIR}/pjproject/build.mak"
+                   COMMAND ${CMAKE_COMMAND} -P ${CMAKE_BINARY_DIR}/pjproject-configure.cmake
+		   WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/pjproject"
+		   COMMENT "Configuring pjproject")
+add_custom_command(OUTPUT "${CMAKE_SOURCE_DIR}/pjproject/pjlib/build/.pjlib-asteriskscf.depend"
+                   COMMAND "make" "dep" "TARGET_NAME=asteriskscf"
+		   WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/pjproject"
+		   COMMENT "Dependency generating pjproject"
+		   DEPENDS "${CMAKE_SOURCE_DIR}/pjproject/build.mak")
+add_custom_target(pjproject-clean
+                  COMMAND "make" "clean" "TARGET_NAME=asteriskscf"
+		  WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/pjproject"
+		  COMMENT "Cleaning pjproject")
+add_custom_target(pjproject-distclean
+                  COMMAND "make" "distclean" "TARGET_NAME=asteriskscf"
+		  WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/pjproject"
+		  COMMENT "Deep cleaning pjproject")
 
 # 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")
-      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" DEPENDS "${CMAKE_SOURCE_DIR}/pjproject/pjlib/build/.pjlib-asteriskscf.depend")
+      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"
+			DEPENDS "${CMAKE_SOURCE_DIR}/pjproject/pjlib/build/.pjlib-asteriskscf.depend")
     else()
-      add_custom_target("pjproject-${PJPROJECT_COMPONENT}" COMMAND "make" "TARGET_NAME=asteriskscf" "DIRS=${PJPROJECT_COMPONENT}/build" WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/pjproject" COMMENT "Building pjproject-${PJPROJECT_COMPONENT}" DEPENDS "${CMAKE_SOURCE_DIR}/pjproject/pjlib/build/.pjlib-asteriskscf.depend")
+      add_custom_target("pjproject-${PJPROJECT_COMPONENT}"
+                        COMMAND "make" "TARGET_NAME=asteriskscf" "DIRS=${PJPROJECT_COMPONENT}/build"
+			WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/pjproject"
+			COMMENT "Building pjproject-${PJPROJECT_COMPONENT}"
+			DEPENDS "${CMAKE_SOURCE_DIR}/pjproject/pjlib/build/.pjlib-asteriskscf.depend")
       add_dependencies("pjproject-${PJPROJECT_COMPONENT}" "pjproject-pjlib")
     endif()
     if(${PJPROJECT_COMPONENT} STREQUAL "pjsip")

commit cff344199fa958787c5a949ba1c294a459ecba85
Author: Kevin P. Fleming <kpfleming at digium.com>
Date:   Tue Jul 19 13:37:39 2011 -0500

    Use proper variable for identifying GNU C compiler.
    
    The CMake variable that identifies the C compiler in use as 'GNU C' was not
    referenced properly; as a result, the script's attempts to set compiler flags
    for compiling C code did not take effect.

diff --git a/AsteriskSCF.cmake b/AsteriskSCF.cmake
index 51bc21c..799747e 100644
--- a/AsteriskSCF.cmake
+++ b/AsteriskSCF.cmake
@@ -359,7 +359,7 @@ function(astscf_project NAME ICE_VERSION)
     endif()
   endif()
 
-  if(CMAKE_COMPILER_IS_GNUC)
+  if(CMAKE_COMPILER_IS_GNUCC)
     list(APPEND c_flags_debug "-Wall" "-g3")
     list(APPEND c_flags_profile "-ftest-coverage" "-fprofile-arcs")
   endif()

commit fa9c9336f1c6065b512a1e5da3a39f332d0c699f
Author: Kevin P. Fleming <kpfleming at digium.com>
Date:   Tue Jul 19 13:36:24 2011 -0500

    Convert __astscf_append_to_var back to a macro.
    
    This really does need to be a macro, not a function, so that the variable it
    sets will be set in the *caller's* PARENT_SCOPE. In the current code, all of
    the logic to set compiler flags is effectively ignored, because those variables
    aren't set in the proper scope.

diff --git a/AsteriskSCF.cmake b/AsteriskSCF.cmake
index 0e13f2c..51bc21c 100644
--- a/AsteriskSCF.cmake
+++ b/AsteriskSCF.cmake
@@ -103,12 +103,13 @@ function(__astscf_set_cache_string var value reason)
   endforeach()
 endfunction()
 
-function(__astscf_append_to_var VAR)
+macro(__astscf_append_to_var VAR)
+  unset(_atv)
   foreach(item ${ARGN})
-    set(_altv "${_altv} ${item}")
+    set(_atv "${_atv} ${item}")
   endforeach()
-  set(${VAR} "${${VAR}} ${_altv}" PARENT_SCOPE)
-endfunction()
+  set(${VAR} "${${VAR}} ${_atv}" PARENT_SCOPE)
+endmacro()
 
 # installation directories (these are all relative to ${CMAKE_INSTALL_PREFIX})
 __astscf_set_cache_path(INSTALL_SYS_CONF_DIR etc "read-only data files that pertain to a single machine")
@@ -135,11 +136,11 @@ if(NOT CMAKE_BUILD_TYPE)
     FORCE)
 endif()
 
-# since Debug, debug and DeBuG all mean the same thing to cmake, tolower it
+# since Debug, debug and DeBuG all mean the same thing to cmake, toupper it
 # for consistency
-string(TOLOWER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE)
+string(TOUPPER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE)
 
-if(WIN32 AND ${CMAKE_BUILD_TYPE} STREQUAL profile)
+if(WIN32 AND ${CMAKE_BUILD_TYPE} STREQUAL PROFILE)
   message(FATAL_ERROR "Profile builds not supported")
 endif()
 
@@ -169,7 +170,7 @@ if(UNIX)
   set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS true)
 endif()
 
-if(${CMAKE_BUILD_TYPE} STREQUAL profile)
+if(${CMAKE_BUILD_TYPE} STREQUAL PROFILE)
   message(STATUS "Disabling shared libs.")
   set(BUILD_SHARED_LIBS false
     CACHE BOOL "Enables building shared libraries." FORCE)

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


-- 
asterisk-scf/release/cmake.git



More information about the asterisk-scf-commits mailing list