[Cmake-commits] [cmake-commits] king committed CMakeLists.txt 1.15 1.16 Step1Patch.cmake 1.1 1.2

cmake-commits at cmake.org cmake-commits at cmake.org
Thu Apr 9 13:56:10 EDT 2009


Update of /cvsroot/CMake/CMake/Tests/ExternalProject
In directory public:/mounts/ram/cvs-serv22615/Tests/ExternalProject

Modified Files:
	CMakeLists.txt Step1Patch.cmake 
Log Message:
ENH: Allow lists in AddExternalProject arguments

The add_external_project function separates its arguments with ';'
separators, so previously no command line argument could contain one.
When specifying CMAKE_ARGS, some -D argument values may need to contain
a semicolon to form lists in the external project cache.

This adds add_external_project argument LIST_SEPARATOR to specify a list
separator string.  The separator is replaced by ';' in arguments to any
command created to drive the external project.  For example:

  add_external_project(...
    LIST_SEPARATOR ::
    CMAKE_ARGS -DSOME_LIST:STRING=A::B::C
    ...)

passes "-DSOME_LIST:STRING=A;B;C" to CMake for the external project.


Index: CMakeLists.txt
===================================================================
RCS file: /cvsroot/CMake/CMake/Tests/ExternalProject/CMakeLists.txt,v
retrieving revision 1.15
retrieving revision 1.16
diff -C 2 -d -r1.15 -r1.16
*** CMakeLists.txt	30 Mar 2009 15:36:32 -0000	1.15
--- CMakeLists.txt	9 Apr 2009 17:56:08 -0000	1.16
***************
*** 118,124 ****
--- 118,126 ----
  add_external_project(${proj}
    TAR "${CMAKE_CURRENT_SOURCE_DIR}/Step1.tar"
+   LIST_SEPARATOR ::
    PATCH_COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_SOURCE_DIR}/Step1Patch.cmake
    CMAKE_GENERATOR "${CMAKE_GENERATOR}"
    CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=${prefix}
+              -DTEST_LIST:STRING=A::B::C
    INSTALL_COMMAND ""
  )
***************
*** 127,131 ****
--- 129,135 ----
  add_external_project(${proj}
    TAR "${CMAKE_CURRENT_SOURCE_DIR}/Step1NoDir.tar"
+   LIST_SEPARATOR @@
    CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=${prefix} -G ${CMAKE_GENERATOR} ${source_dir}/${proj}
+              -DTEST_LIST:STRING=1@@2@@3
    INSTALL_COMMAND ""
  )

Index: Step1Patch.cmake
===================================================================
RCS file: /cvsroot/CMake/CMake/Tests/ExternalProject/Step1Patch.cmake,v
retrieving revision 1.1
retrieving revision 1.2
diff -C 2 -d -r1.1 -r1.2
*** Step1Patch.cmake	18 Mar 2009 15:01:02 -0000	1.1
--- Step1Patch.cmake	9 Apr 2009 17:56:08 -0000	1.2
***************
*** 18,21 ****
--- 18,25 ----
  # Patch by ExternalProject test:
  set_property(TARGET Tutorial PROPERTY OUTPUT_NAME EP-Tutorial)
+ list(LENGTH TEST_LIST len)
+ if(NOT len EQUAL 3)
+   message(FATAL_ERROR \"TEST_LIST length is \${len}, not 3\")
+ endif()
  ")
  message(STATUS "Patched ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt")



More information about the Cmake-commits mailing list