[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 15 21:50:11 CDT 2010


branch "master" has been updated
       via  3f25bd27601d0d4befc9a82cc9b1a5e71d58625b (commit)
       via  5faf3d862740a87535b42266539842a110827aad (commit)
       via  9a37e8e578a44a664cc1c8978f36d19d4725b218 (commit)
      from  4bf0cf87c656657eb4ad1667b17936b240733d4e (commit)

Summary of changes:
 AsteriskSCF.cmake |   31 +++++++++++++++++++++++++++++--
 init-cmake.sh     |   31 ++++++++++++++++++++++++++++---
 2 files changed, 57 insertions(+), 5 deletions(-)


- Log -----------------------------------------------------------------
commit 3f25bd27601d0d4befc9a82cc9b1a5e71d58625b
Author: David M. Lee <dlee at digium.com>
Date:   Wed Sep 15 17:08:22 2010 -0500

    Build static libs for profile config.

diff --git a/AsteriskSCF.cmake b/AsteriskSCF.cmake
index 512c17f..4babd66 100644
--- a/AsteriskSCF.cmake
+++ b/AsteriskSCF.cmake
@@ -35,13 +35,25 @@ else()
   message(STATUS "Adding profile flags")
   set(CMAKE_C_FLAGS_PROFILE
     "${CMAKE_C_FLAGS_DEBUG} -ftest-coverage -fprofile-arcs"
-    CACHE STRING "Flags used by the compiler during profile builds.")
+    CACHE STRING "Flags used by the compiler during profile 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.")
+    CACHE STRING "Flags used by the compiler during profile builds." FORCE)
   set(CMAKE_EXE_LINKER_FLAGS_PROFILE
-    "${CMAKE_EXE_LINKER_FLAGS_DEBUG} -ftest-coverage -fprofile-arcs"
-    CACHE STRING "Flags used by the linker during profile builds.")
+    "${CMAKE_EXE_LINKER_FLAGS_DEBUG}"
+    CACHE STRING "Flags used by the linker during profile builds." FORCE)
+endif()
+
+if(${CMAKE_BUILD_TYPE} STREQUAL profile)
+  message(STATUS "Disabling shared libs.")
+  set(BUILD_SHARED_LIBS false
+    CACHE BOOL "Enables building shared libraries." FORCE)
+endif()
+
+if(NOT DEFINED BUILD_SHARED_LIBS)
+  message(STATUS "Disabling shared libs.")
+  set(BUILD_SHARED_LIBS true
+    CACHE BOOL "Enables building shared libraries." FORCE)
 endif()
 
 # Enable the use of CTest for running unit tests
@@ -588,7 +600,7 @@ function(hydra_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
       include_directories(${target_CXX_includes})
-      add_library(${TARGET}_${lang} SHARED ${generated_files} ${slice_files})
+      add_library(${TARGET}_${lang} ${generated_files} ${slice_files})
       install(TARGETS ${TARGET}_${lang} DESTINATION ${DIR_IN} COMPONENT ${TARGET}_${lang})
       if (HYDRA_CPACK)
          # Adds a component to the packager. The first arg must have been previously defined
@@ -784,7 +796,7 @@ function(hydra_component_build_library COMPONENT)
 
   if(lang STREQUAL "CXX")
     # Now we actually create the component
-    add_library(${COMPONENT} SHARED ${${COMPONENT}_SOURCES})
+    add_library(${COMPONENT} ${${COMPONENT}_SOURCES})
     # Link required libraries and Slice libraries
     list(APPEND boostlibs ${HYDRA_BOOST_LIBRARIES} ${${COMPONENT}_BOOST_LIBRARIES})
     if(boostlibs)

commit 5faf3d862740a87535b42266539842a110827aad
Author: David M. Lee <dlee at digium.com>
Date:   Wed Sep 15 16:37:03 2010 -0500

    Added support for a 'profile' configuration for code coverage.

diff --git a/AsteriskSCF.cmake b/AsteriskSCF.cmake
index ef17cf8..512c17f 100644
--- a/AsteriskSCF.cmake
+++ b/AsteriskSCF.cmake
@@ -29,6 +29,21 @@ if(NOT CMAKE_BUILD_TYPE)
     FORCE)
 endif()
 
+if(WIN32)
+  message(WARNING "Profile builds not supported")
+else()
+  message(STATUS "Adding profile flags")
+  set(CMAKE_C_FLAGS_PROFILE
+    "${CMAKE_C_FLAGS_DEBUG} -ftest-coverage -fprofile-arcs"
+    CACHE STRING "Flags used by the compiler during profile builds.")
+  set(CMAKE_CXX_FLAGS_PROFILE
+    "${CMAKE_CXX_FLAGS_DEBUG} -ftest-coverage -fprofile-arcs"
+    CACHE STRING "Flags used by the compiler during profile builds.")
+  set(CMAKE_EXE_LINKER_FLAGS_PROFILE
+    "${CMAKE_EXE_LINKER_FLAGS_DEBUG} -ftest-coverage -fprofile-arcs"
+    CACHE STRING "Flags used by the linker during profile builds.")
+endif()
+
 # Enable the use of CTest for running unit tests
 enable_testing()
 

commit 9a37e8e578a44a664cc1c8978f36d19d4725b218
Author: David M. Lee <dlee at digium.com>
Date:   Wed Sep 15 14:57:33 2010 -0500

    Added --type and --subdir to init-cmake.sh

diff --git a/init-cmake.sh b/init-cmake.sh
index 9b64072..16787ba 100755
--- a/init-cmake.sh
+++ b/init-cmake.sh
@@ -18,6 +18,8 @@ Script Options
   --vs10-64   = Shorthand for -G "Visual Studio 10 win64"
   --make      = Shorthand for -G "Unix Makefiles"
   --nmake     = Shorthand for -G "NMake Makefiles"
+  --subdir    = Build in ./build/${platform}/\${type} instead of ./build
+  --type      = Specify build type.  Valid options are debug, release, profile.
   --help      = Show this help text and exit
 
 Cmake Options
@@ -25,7 +27,17 @@ Cmake Options
 EOF
 }
 
+# directory in which to build
+builddir=./build
+# build type.  valid options are debug, release, profile
+build_type=debug
+# if true, build in ./build/${platform}/${build_type}
+subdir=false
+# extra arguments for cmake
 cmake_args=()
+# source directory
+srcdir=$(pwd)
+
 function add_cmake_args()
 {
    cmake_args+=("$@")
@@ -72,6 +84,14 @@ while test $# -gt 0; do
          add_cmake_args -G "Visual Studio 9 2008"
          shift
          ;;
+      --subdir)
+         subdir=true
+         shift
+         ;;
+      --type)
+         build_type=$2
+         shift 2
+         ;;
       --help)
          print_help
          exit 0
@@ -81,6 +101,7 @@ while test $# -gt 0; do
          break
          ;;
       *)  # unrecognized arg; pass this and rest on to cmake
+         echo "Unrecognized option $1.  Passing on to cmake." >&2
          break
          ;;
    esac
@@ -91,11 +112,15 @@ if ! test -f CMakeLists.txt; then
    exit 1
 fi
 
-mkdir -p build
-cd build
+if ${subdir}; then
+   builddir=./build/${platform}/${build_type}
+fi
+
+mkdir -p ${builddir}
+cd ${builddir}
 
 # show what we're doing
 set -x
 
 # -Wdev: Enable developer warnings.
-cmake -Wdev .. "${cmake_args[@]}" "$@"
+cmake ${srcdir} -Wdev -DCMAKE_BUILD_TYPE=${build_type} "${cmake_args[@]}" "$@"

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


-- 
asterisk-scf/release/cmake.git



More information about the asterisk-scf-commits mailing list