[Cmake-commits] CMake branch, next, updated. v2.8.3-880-g35cd138

Bill Hoffman bill.hoffman at kitware.com
Tue Dec 14 15:04:20 EST 2010


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
       via  35cd1383e56e1aef0a1c35f75aab328ff3150094 (commit)
       via  cdf92c952a40650a5bc37e93489e4b3130841d82 (commit)
       via  08f829b50971d7d848b8c4398f9c559fcf338d8e (commit)
       via  58bd4f21855f1ee4889ba7d933bd84fb24da672b (commit)
       via  dd2a5aa69fa1ba9fc73740355971fc28bfb504c0 (commit)
       via  88b7f4252c86f655c026d0906e7a8396cf75b70c (commit)
      from  631504cbc0a6f85090711c4d3aca8582ca2de262 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=35cd1383e56e1aef0a1c35f75aab328ff3150094
commit 35cd1383e56e1aef0a1c35f75aab328ff3150094
Merge: 631504c cdf92c9
Author:     Bill Hoffman <bill.hoffman at kitware.com>
AuthorDate: Tue Dec 14 15:04:18 2010 -0500
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Tue Dec 14 15:04:18 2010 -0500

    Merge topic 'CPack-AddMoreTests' into next
    
    cdf92c9 Precise the project config type when invoking cpack
    08f829b Arrange output in a better way
    58bd4f2 CPackTest spit out more output in case of failure
    dd2a5aa CPack  Default component test for ZIP should be OK
    88b7f42 CPack new tests for component install


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=cdf92c952a40650a5bc37e93489e4b3130841d82
commit cdf92c952a40650a5bc37e93489e4b3130841d82
Author:     Eric NOULARD <eric.noulard at gmail.com>
AuthorDate: Sun Dec 12 22:45:48 2010 +0100
Commit:     Bill Hoffman <bill.hoffman at kitware.com>
CommitDate: Tue Dec 14 12:21:02 2010 -0500

    Precise the project config type when invoking cpack

diff --git a/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake b/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake
index ee6b227..b0cacb8 100644
--- a/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake
+++ b/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake
@@ -25,7 +25,7 @@ set(expected_file_mask "")
 # CPACK_COMPONENT_xxx values
 set(expected_count 1)
 
-execute_process(COMMAND ${CPackCommand} -G ${CPackGen}
+execute_process(COMMAND ${CPackCommand} -G ${CPackGen} -C Release
     RESULT_VARIABLE CPack_result
     OUTPUT_VARIABLE CPack_output
     ERROR_VARIABLE CPack_error

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=08f829b50971d7d848b8c4398f9c559fcf338d8e
commit 08f829b50971d7d848b8c4398f9c559fcf338d8e
Author:     Eric NOULARD <eric.noulard at gmail.com>
AuthorDate: Sun Dec 12 22:35:18 2010 +0100
Commit:     Bill Hoffman <bill.hoffman at kitware.com>
CommitDate: Tue Dec 14 12:21:00 2010 -0500

    Arrange output in a better way

diff --git a/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake b/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake
index e519893..ee6b227 100644
--- a/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake
+++ b/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake
@@ -32,9 +32,9 @@ execute_process(COMMAND ${CPackCommand} -G ${CPackGen}
     WORKING_DIRECTORY ${CPackComponentsForAll_BINARY_DIR})
 
 if (CPack_result)
-  message(SEND_ERROR "CPack_output=${CPack_output}")
-  message(SEND_ERROR "CPack_error=${CPack_error}")
-  message(FATAL_ERROR "error: CPack execution went wrong!")
+  message(FATAL_ERROR "error: CPack execution went wrong!, CPack_output=${CPack_output}, CPack_error=${CPack_error}")
+else (CPack_result)
+  message(STATUS "CPack_output=${CPack_output}")
 endif(CPack_result)
 
 if(CPackGen MATCHES "ZIP")
@@ -55,16 +55,12 @@ if(expected_file_mask)
   message(STATUS "expected_file_mask='${expected_file_mask}'")
 
   if(NOT expected_file)
-    message(SEND_ERROR "CPack_output=${CPack_output}")
-    message(SEND_ERROR "CPack_error=${CPack_error}")
-    message(FATAL_ERROR "error: expected_file=${expected_file} does not exist: CPackComponentsForAll test fails.")
+    message(FATAL_ERROR "error: expected_file=${expected_file} does not exist: CPackComponentsForAll test fails. (CPack_output=${CPack_output}, CPack_error=${CPack_error}")
   endif(NOT expected_file)
 
   list(LENGTH expected_file actual_count)
   message(STATUS "actual_count='${actual_count}'")
   if(NOT actual_count EQUAL expected_count)
-    message(SEND_ERROR "CPack_output=${CPack_output}")
-    message(SEND_ERROR "CPack_error=${CPack_error}")
-    message(FATAL_ERROR "error: expected_count=${expected_count} does not match actual_count=${actual_count}: CPackComponents test fails.")
+    message(FATAL_ERROR "error: expected_count=${expected_count} does not match actual_count=${actual_count}: CPackComponents test fails. (CPack_output=${CPack_output}, CPack_error=${CPack_error})")
   endif(NOT actual_count EQUAL expected_count)
 endif(expected_file_mask)

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=58bd4f21855f1ee4889ba7d933bd84fb24da672b
commit 58bd4f21855f1ee4889ba7d933bd84fb24da672b
Author:     Eric NOULARD <eric.noulard at gmail.com>
AuthorDate: Sun Dec 12 12:19:50 2010 +0100
Commit:     Bill Hoffman <bill.hoffman at kitware.com>
CommitDate: Tue Dec 14 12:20:58 2010 -0500

    CPackTest spit out more output in case of failure

diff --git a/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake b/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake
index b24ae5a..e519893 100644
--- a/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake
+++ b/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake
@@ -20,14 +20,23 @@ endif(NOT CPackComponentWay)
 
 set(expected_file_mask "")
 # The usual default behavior is to expect a single file
+# Then some specific generators (Archive, RPM, ...)
+# May produce several numbers of files depending on
+# CPACK_COMPONENT_xxx values
 set(expected_count 1)
 
 execute_process(COMMAND ${CPackCommand} -G ${CPackGen}
-    RESULT_VARIABLE result
-    OUTPUT_VARIABLE stdout
-    ERROR_VARIABLE stderr
+    RESULT_VARIABLE CPack_result
+    OUTPUT_VARIABLE CPack_output
+    ERROR_VARIABLE CPack_error
     WORKING_DIRECTORY ${CPackComponentsForAll_BINARY_DIR})
 
+if (CPack_result)
+  message(SEND_ERROR "CPack_output=${CPack_output}")
+  message(SEND_ERROR "CPack_error=${CPack_error}")
+  message(FATAL_ERROR "error: CPack execution went wrong!")
+endif(CPack_result)
+
 if(CPackGen MATCHES "ZIP")
     set(expected_file_mask "${CPackComponentsForAll_BINARY_DIR}/MyLib-*.zip")
     if (${CPackComponentWay} STREQUAL "default")
@@ -46,12 +55,16 @@ if(expected_file_mask)
   message(STATUS "expected_file_mask='${expected_file_mask}'")
 
   if(NOT expected_file)
+    message(SEND_ERROR "CPack_output=${CPack_output}")
+    message(SEND_ERROR "CPack_error=${CPack_error}")
     message(FATAL_ERROR "error: expected_file=${expected_file} does not exist: CPackComponentsForAll test fails.")
   endif(NOT expected_file)
 
   list(LENGTH expected_file actual_count)
   message(STATUS "actual_count='${actual_count}'")
   if(NOT actual_count EQUAL expected_count)
+    message(SEND_ERROR "CPack_output=${CPack_output}")
+    message(SEND_ERROR "CPack_error=${CPack_error}")
     message(FATAL_ERROR "error: expected_count=${expected_count} does not match actual_count=${actual_count}: CPackComponents test fails.")
   endif(NOT actual_count EQUAL expected_count)
 endif(expected_file_mask)

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=dd2a5aa69fa1ba9fc73740355971fc28bfb504c0
commit dd2a5aa69fa1ba9fc73740355971fc28bfb504c0
Author:     Eric NOULARD <eric.noulard at gmail.com>
AuthorDate: Sat Dec 11 11:59:02 2010 +0100
Commit:     Bill Hoffman <bill.hoffman at kitware.com>
CommitDate: Tue Dec 14 12:20:56 2010 -0500

    CPack  Default component test for ZIP should be OK

diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index 3538e44..2e88bcf 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -540,8 +540,9 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
 
     set(CPackRun_CPackGen  "-DCPackGen=ZIP")
     set(CPackRun_CPackCommand "-DCPackCommand=${CMAKE_CPACK_COMMAND}")
+    set(CPackRun_CPackComponentWay "-DCPackComponentWay=default")
 
-    ADD_TEST(CPackComponentsForAll-ZIP-NoComponent ${CMAKE_CTEST_COMMAND}
+    ADD_TEST(CPackComponentsForAll-ZIP-default ${CMAKE_CTEST_COMMAND}
       --build-and-test
       "${CMake_SOURCE_DIR}/Tests/CPackComponentsForAll"
       "${CMake_BINARY_DIR}/Tests/CPackComponentsForAll/buildZIP-NoComponent"
@@ -556,6 +557,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
         "-DCPackComponentsForAll_BINARY_DIR:PATH=${CMake_BINARY_DIR}/Tests/CPackComponentsForAll/buildZIP-NoComponent"
         "${CPackRun_CPackCommand}"
         "${CPackRun_CPackGen}"
+        "${CPackRun_CPackComponentWay}"
         -P "${CMake_SOURCE_DIR}/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake")
 
     LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CPackComponentsForAll")
diff --git a/Tests/CPackComponentsForAll/CMakeLists.txt b/Tests/CPackComponentsForAll/CMakeLists.txt
index 4153ac9..971b2dc 100644
--- a/Tests/CPackComponentsForAll/CMakeLists.txt
+++ b/Tests/CPackComponentsForAll/CMakeLists.txt
@@ -7,7 +7,7 @@
 # Depending on the CPack generator and on some CPACK_xxx var values
 # the generator may produce a single (NSIS, PackageMaker)
 # or several package files (Archive Generators, RPM, DEB)
-cmake_minimum_required(VERSION 2.8.3 FATAL_ERROR)
+cmake_minimum_required(VERSION 2.8.3.20101130 FATAL_ERROR)
 project(CPackComponentsForAll)
 
 # Create the mylib library
diff --git a/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake b/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake
index 6b471ca..b24ae5a 100644
--- a/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake
+++ b/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake
@@ -13,7 +13,14 @@ endif(NOT CPackGen)
 if(NOT CPackCommand)
   message(FATAL_ERROR "CPackCommand not set")
 endif(NOT CPackCommand)
+
+if(NOT CPackComponentWay)
+  message(FATAL_ERROR "CPackComponentWay not set")
+endif(NOT CPackComponentWay)
+
 set(expected_file_mask "")
+# The usual default behavior is to expect a single file
+set(expected_count 1)
 
 execute_process(COMMAND ${CPackCommand} -G ${CPackGen}
     RESULT_VARIABLE result
@@ -23,10 +30,14 @@ execute_process(COMMAND ${CPackCommand} -G ${CPackGen}
 
 if(CPackGen MATCHES "ZIP")
     set(expected_file_mask "${CPackComponentsForAll_BINARY_DIR}/MyLib-*.zip")
-    set(expected_count 2)
+    if (${CPackComponentWay} STREQUAL "default")
+        set(expected_count 1)
+    endif(${CPackComponentWay} STREQUAL "default")
 endif(CPackGen MATCHES "ZIP")
 
-
+# Now verify if the number of expected file is OK
+# - using expected_file_mask and
+# - expected_count
 if(expected_file_mask)
   file(GLOB expected_file "${expected_file_mask}")
 
@@ -35,12 +46,12 @@ if(expected_file_mask)
   message(STATUS "expected_file_mask='${expected_file_mask}'")
 
   if(NOT expected_file)
-    message(FATAL_ERROR "error: expected_file does not exist: CPackComponentsForAll test fails.")
+    message(FATAL_ERROR "error: expected_file=${expected_file} does not exist: CPackComponentsForAll test fails.")
   endif(NOT expected_file)
 
   list(LENGTH expected_file actual_count)
   message(STATUS "actual_count='${actual_count}'")
   if(NOT actual_count EQUAL expected_count)
-    message(FATAL_ERROR "error: expected_count does not match actual_count: CPackComponents test fails.")
+    message(FATAL_ERROR "error: expected_count=${expected_count} does not match actual_count=${actual_count}: CPackComponents test fails.")
   endif(NOT actual_count EQUAL expected_count)
 endif(expected_file_mask)

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=88b7f4252c86f655c026d0906e7a8396cf75b70c
commit 88b7f4252c86f655c026d0906e7a8396cf75b70c
Author:     Eric NOULARD <eric.noulard at gmail.com>
AuthorDate: Thu Dec 2 22:56:26 2010 +0100
Commit:     Bill Hoffman <bill.hoffman at kitware.com>
CommitDate: Tue Dec 14 12:20:54 2010 -0500

    CPack new tests for component install

diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index 04f0774..3538e44 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -486,6 +486,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
   #
   set(CTEST_RUN_CPackComponents ${CTEST_TEST_CPACK})
   set(CTEST_package_X11_TEST ${CTEST_TEST_CPACK})
+  set(CTEST_RUN_CPackComponentsForAll ${CTEST_TEST_CPACK})
 
   find_program(NSIS_MAKENSIS_EXECUTABLE NAMES makensis
     PATHS [HKEY_LOCAL_MACHINE\\SOFTWARE\\NSIS]
@@ -534,6 +535,32 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
     LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CPackComponents")
   ENDIF(CTEST_RUN_CPackComponents)
 
+  IF(CTEST_RUN_CPackComponentsForAll)
+    set(CPackComponentsForAll_EXTRA_OPTIONS)
+
+    set(CPackRun_CPackGen  "-DCPackGen=ZIP")
+    set(CPackRun_CPackCommand "-DCPackCommand=${CMAKE_CPACK_COMMAND}")
+
+    ADD_TEST(CPackComponentsForAll-ZIP-NoComponent ${CMAKE_CTEST_COMMAND}
+      --build-and-test
+      "${CMake_SOURCE_DIR}/Tests/CPackComponentsForAll"
+      "${CMake_BINARY_DIR}/Tests/CPackComponentsForAll/buildZIP-NoComponent"
+      --build-generator ${CMAKE_TEST_GENERATOR}
+      --build-project CPackComponentsForAll
+      --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
+      --build-options
+        -DCPACK_BINARY_ZIP:BOOL=ON
+        ${CPackComponentsForAll_EXTRA_OPTIONS}
+        --graphviz=CPackComponentsForAll.dot
+      --test-command ${CMAKE_CMAKE_COMMAND}
+        "-DCPackComponentsForAll_BINARY_DIR:PATH=${CMake_BINARY_DIR}/Tests/CPackComponentsForAll/buildZIP-NoComponent"
+        "${CPackRun_CPackCommand}"
+        "${CPackRun_CPackGen}"
+        -P "${CMake_SOURCE_DIR}/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake")
+
+    LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CPackComponentsForAll")
+  ENDIF(CTEST_RUN_CPackComponentsForAll)
+
   # By default, turn this test off (because it takes a long time...)
   #
   if(NOT DEFINED CTEST_RUN_CPackTestAllGenerators)
diff --git a/Tests/CPackComponentsForAll/CMakeLists.txt b/Tests/CPackComponentsForAll/CMakeLists.txt
new file mode 100644
index 0000000..4153ac9
--- /dev/null
+++ b/Tests/CPackComponentsForAll/CMakeLists.txt
@@ -0,0 +1,120 @@
+# CPack Example: User-selectable Installation Components
+#
+# In this example, we have a simple library (mylib) with an example
+# application (mylibapp). We create a binary installer (a CPack Generator)
+# which supports CPack components.
+#
+# Depending on the CPack generator and on some CPACK_xxx var values
+# the generator may produce a single (NSIS, PackageMaker)
+# or several package files (Archive Generators, RPM, DEB)
+cmake_minimum_required(VERSION 2.8.3 FATAL_ERROR)
+project(CPackComponentsForAll)
+
+# Create the mylib library
+add_library(mylib mylib.cpp)
+
+# Create the mylibapp application
+add_executable(mylibapp mylibapp.cpp)
+target_link_libraries(mylibapp mylib)
+
+# Duplicate of mylibapp application
+# which won't be put in any component (?mistake?)
+add_executable(mylibapp2 mylibapp.cpp)
+target_link_libraries(mylibapp2 mylib)
+
+# Create installation targets. Note that we put each kind of file
+# into a different component via COMPONENT. These components will
+# be used to create the installation components.
+install(TARGETS mylib
+  ARCHIVE
+  DESTINATION lib
+  COMPONENT libraries)
+install(TARGETS mylibapp
+  RUNTIME
+  DESTINATION bin
+  COMPONENT applications)
+
+# This application does not belong to any component
+# thus (as of cmake 2.8.2) it will be left "uninstalled"
+# by a component-aware installer unless a
+# CPACK_MONOLITHIC_INSTALL=1 is set (at cmake time).
+install(TARGETS mylibapp2
+  RUNTIME
+  DESTINATION bin)
+
+install(FILES mylib.h
+  DESTINATION include
+  COMPONENT headers)
+
+# CPack boilerplate for this project
+set(CPACK_PACKAGE_NAME "MyLib")
+set(CPACK_PACKAGE_CONTACT "None")
+set(CPACK_PACKAGE_VENDOR "CMake.org")
+set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "MyLib - CPack Component Installation Example")
+set(CPACK_PACKAGE_VERSION "1.0.2")
+set(CPACK_PACKAGE_VERSION_MAJOR "1")
+set(CPACK_PACKAGE_VERSION_MINOR "0")
+set(CPACK_PACKAGE_VERSION_PATCH "2")
+set(CPACK_PACKAGE_INSTALL_DIRECTORY "CPack Component Example")
+
+# Tell CPack all of the components to install. The "ALL"
+# refers to the fact that this is the set of components that
+# will be included when CPack is instructed to put everything
+# into the binary installer (the default behavior).
+set(CPACK_COMPONENTS_ALL applications libraries headers Unspecified)
+
+# Set the displayed names for each of the components to install.
+# These will be displayed in the list of components inside the installer.
+set(CPACK_COMPONENT_APPLICATIONS_DISPLAY_NAME "MyLib Application")
+set(CPACK_COMPONENT_LIBRARIES_DISPLAY_NAME "Libraries")
+set(CPACK_COMPONENT_HEADERS_DISPLAY_NAME "C++ Headers")
+
+# Provide descriptions for each of the components to install.
+# When the user hovers the mouse over the name of a component,
+# the description will be shown in the "Description" box in the
+# installer. If no descriptions are provided, the "Description"
+# box will be removed.
+set(CPACK_COMPONENT_APPLICATIONS_DESCRIPTION
+  "An extremely useful application that makes use of MyLib")
+set(CPACK_COMPONENT_LIBRARIES_DESCRIPTION
+  "Static libraries used to build programs with MyLib")
+set(CPACK_COMPONENT_HEADERS_DESCRIPTION
+  "C/C++ header files for use with MyLib")
+
+# Put the components into two different groups: "Runtime" and "Development"
+set(CPACK_COMPONENT_APPLICATIONS_GROUP "Runtime")
+set(CPACK_COMPONENT_LIBRARIES_GROUP "Development")
+set(CPACK_COMPONENT_HEADERS_GROUP "Development")
+
+# Expand the "Development" group by default, since we have so few components.
+# Also, provide this group with a description.
+set(CPACK_COMPONENT_GROUP_DEVELOPMENT_EXPANDED ON)
+set(CPACK_COMPONENT_GROUP_DEVELOPMENT_DESCRIPTION
+  "All of the tools you'll ever need to develop software")
+
+# It doesn't make sense to install the headers without the libraries
+# (because you could never use the headers!), so make the headers component
+# depend on the libraries component.
+set(CPACK_COMPONENT_HEADERS_DEPENDS libraries)
+
+# Create two installation types with pre-selected components.
+# The "Developer" installation has just the library and headers,
+# while the "Full" installation has everything.
+set(CPACK_ALL_INSTALL_TYPES Full Developer)
+set(CPACK_INSTALL_TYPE_FULL_DISPLAY_NAME "Everything")
+set(CPACK_COMPONENT_LIBRARIES_INSTALL_TYPES Developer Full)
+set(CPACK_COMPONENT_HEADERS_INSTALL_TYPES Developer Full)
+set(CPACK_COMPONENT_APPLICATIONS_INSTALL_TYPES Full)
+
+# We may use the CPack specific config file in order
+# to tailor CPack behavio on a CPack generator specific way
+# (Behavior would be different for RPM or TGZ or DEB ...)
+if (USE_CPACK_PROJECT_CONFIG)
+  # Setup project specific CPack-time CPack Config file.
+  configure_file(${MyLib_SOURCE_DIR}/MyLibCPackConfig.cmake.in
+    ${MyLib_BINARY_DIR}/MyLibCPackConfig.cmake
+    @ONLY)
+  set(CPACK_PROJECT_CONFIG_FILE ${MyLib_BINARY_DIR}/MyLibCPackConfig.cmake)
+endif (USE_CPACK_PROJECT_CONFIG)
+# Include CPack to introduce the appropriate targets
+include(CPack)
\ No newline at end of file
diff --git a/Tests/CPackComponentsForAll/MyLibCPackConfig.cmake.in b/Tests/CPackComponentsForAll/MyLibCPackConfig.cmake.in
new file mode 100644
index 0000000..7ffafae
--- /dev/null
+++ b/Tests/CPackComponentsForAll/MyLibCPackConfig.cmake.in
@@ -0,0 +1,7 @@
+if(CPACK_GENERATOR MATCHES "ZIP")
+#  set(CPACK_COMPONENTS_ALL_IN_ONE_PACKAGE 1)
+endif(CPACK_GENERATOR MATCHES "ZIP")
+
+if(CPACK_GENERATOR MATCHES "TGZ")
+  set(CPACK_MONOLITHIC_INSTALL 1)
+endif(CPACK_GENERATOR MATCHES "TGZ")
diff --git a/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake b/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake
new file mode 100644
index 0000000..6b471ca
--- /dev/null
+++ b/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake
@@ -0,0 +1,46 @@
+message(STATUS "=============================================================================")
+message(STATUS "CTEST_FULL_OUTPUT (Avoid ctest truncation of output)")
+message(STATUS "")
+
+if(NOT CPackComponentsForAll_BINARY_DIR)
+  message(FATAL_ERROR "CPackComponentsForAll_BINARY_DIR not set")
+endif(NOT CPackComponentsForAll_BINARY_DIR)
+
+if(NOT CPackGen)
+  message(FATAL_ERROR "CPackGen not set")
+endif(NOT CPackGen)
+
+if(NOT CPackCommand)
+  message(FATAL_ERROR "CPackCommand not set")
+endif(NOT CPackCommand)
+set(expected_file_mask "")
+
+execute_process(COMMAND ${CPackCommand} -G ${CPackGen}
+    RESULT_VARIABLE result
+    OUTPUT_VARIABLE stdout
+    ERROR_VARIABLE stderr
+    WORKING_DIRECTORY ${CPackComponentsForAll_BINARY_DIR})
+
+if(CPackGen MATCHES "ZIP")
+    set(expected_file_mask "${CPackComponentsForAll_BINARY_DIR}/MyLib-*.zip")
+    set(expected_count 2)
+endif(CPackGen MATCHES "ZIP")
+
+
+if(expected_file_mask)
+  file(GLOB expected_file "${expected_file_mask}")
+
+  message(STATUS "expected_count='${expected_count}'")
+  message(STATUS "expected_file='${expected_file}'")
+  message(STATUS "expected_file_mask='${expected_file_mask}'")
+
+  if(NOT expected_file)
+    message(FATAL_ERROR "error: expected_file does not exist: CPackComponentsForAll test fails.")
+  endif(NOT expected_file)
+
+  list(LENGTH expected_file actual_count)
+  message(STATUS "actual_count='${actual_count}'")
+  if(NOT actual_count EQUAL expected_count)
+    message(FATAL_ERROR "error: expected_count does not match actual_count: CPackComponents test fails.")
+  endif(NOT actual_count EQUAL expected_count)
+endif(expected_file_mask)
diff --git a/Tests/CPackComponentsForAll/mylib.cpp b/Tests/CPackComponentsForAll/mylib.cpp
new file mode 100644
index 0000000..8ddac19
--- /dev/null
+++ b/Tests/CPackComponentsForAll/mylib.cpp
@@ -0,0 +1,7 @@
+#include "mylib.h"
+#include "stdio.h"
+
+void mylib_function()
+{
+  printf("This is mylib");
+}
diff --git a/Tests/CPackComponentsForAll/mylib.h b/Tests/CPackComponentsForAll/mylib.h
new file mode 100644
index 0000000..5d0a822
--- /dev/null
+++ b/Tests/CPackComponentsForAll/mylib.h
@@ -0,0 +1 @@
+void mylib_function();
diff --git a/Tests/CPackComponentsForAll/mylibapp.cpp b/Tests/CPackComponentsForAll/mylibapp.cpp
new file mode 100644
index 0000000..a438ac7
--- /dev/null
+++ b/Tests/CPackComponentsForAll/mylibapp.cpp
@@ -0,0 +1,6 @@
+#include "mylib.h"
+
+int main()
+{
+  mylib_function();
+}

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

Summary of changes:


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list