Browse Source

HPCC-14160 Made safe for reconfigure of cmake

Signed-off-by: Michael Gardner <Michael.Gardner@lexisnexis.com>
Michael Gardner 9 years ago
parent
commit
278fe8afc3

+ 41 - 6
cmake_modules/commonSetup.cmake

@@ -739,16 +739,51 @@ IF ("${COMMONSETUP_DONE}" STREQUAL "")
         endif()
   ENDMACRO()
 
+  function(LIST_TO_STRING separator outvar)
+    set ( tmp_str "" )
+    list (LENGTH ARGN list_length)
+    if ( ${list_length} LESS 2 )
+      set ( tmp_str "${ARGN}" )
+    else()
+      math(EXPR last_index "${list_length} - 1")
+
+      foreach( index RANGE ${last_index} )
+        if ( ${index} GREATER 0 )
+          list( GET ARGN ${index} element )
+          set( tmp_str "${tmp_str}${separator}${element}")
+        else()
+          list( GET ARGN 0 element )
+          set( tmp_str "${element}")
+        endif()
+      endforeach()
+    endif()
+    set ( ${outvar} "${tmp_str}" PARENT_SCOPE )
+  endfunction()
+
+  function(STRING_TO_LIST separator outvar stringvar)
+    set( tmp_list "" )
+    string(REPLACE "${separator}" ";" tmp_list ${stringvar})
+    string(STRIP "${tmp_list}" tmp_list)
+    set( ${outvar} "${tmp_list}" PARENT_SCOPE)
+  endfunction()
+
   ###########################################################################
   ###
   ## The following sets the dependency list for a package
   ###
-  MACRO(SET_DEPENDENCIES cpackvar dependencies)
-    if ( ${cpackvar} )
-      set ( ${cpackvar} "${dependencies}, ${${cpackvar}}" CACHE STRING "" FORCE )
-    else()
-      set ( ${cpackvar} "${dependencies}" CACHE STRING "" )
+  ###########################################################################
+  function(SET_DEPENDENCIES cpackvar)
+    set(_tmp "")
+    if(${cpackvar})
+      STRING_TO_LIST(", " _tmp ${${cpackvar}})
     endif()
-  ENDMACRO()
+    foreach(element ${ARGN})
+      list(APPEND _tmp ${element})
+    endforeach()
+    list(REMOVE_DUPLICATES _tmp)
+    LIST_TO_STRING(", " _tmp "${_tmp}")
+    set(${cpackvar} "${_tmp}" CACHE STRING "" FORCE)
+    message(STATUS "Updated ${cpackvar} to ${${cpackvar}}")
+  endfunction()
 
 endif ("${COMMONSETUP_DONE}" STREQUAL "")

+ 1 - 1
cmake_modules/dependencies/el5.cmake

@@ -1 +1 @@
-set ( CPACK_RPM_PACKAGE_REQUIRES "boost141-regex, openldap, libicu, m4, libtool, libxslt, libxml2, gcc-c++, openssh-server, openssh-clients, expect, libarchive, rsync, apr, apr-util, zip, tbb" CACHE STRING "" FORCE )
+SET_DEPENDENCIES ( CPACK_RPM_PACKAGE_REQUIRES boost141-regex openldap libicu m4 libtool libxslt libxml2 gcc-c++ openssh-server openssh-clients expect libarchive rsync apr apr-util zip tbb )

+ 1 - 1
cmake_modules/dependencies/el6.cmake

@@ -1 +1 @@
-set ( CPACK_RPM_PACKAGE_REQUIRES "boost-regex, openldap, libicu, m4, libtool, libxslt, libxml2, gcc-c++, openssh-server, openssh-clients, expect, libarchive, rsync, apr, apr-util, zip, tbb" CACHE STRING "" FORCE )
+SET_DEPENDENCIES ( CPACK_RPM_PACKAGE_REQUIRES boost-regex openldap libicu m4 libtool libxslt libxml2 gcc-c++ openssh-server openssh-clients expect libarchive rsync apr apr-util zip tbb )

+ 1 - 1
cmake_modules/dependencies/el7.cmake

@@ -1 +1 @@
-set ( CPACK_RPM_PACKAGE_REQUIRES "boost-regex, openldap, libicu, m4, libtool, libxslt, libxml2, gcc-c++, openssh-server, openssh-clients, expect, libarchive, rsync, apr, apr-util, zip, tbb" CACHE STRING "" FORCE )
+SET_DEPENDENCIES ( CPACK_RPM_PACKAGE_REQUIRES boost-regex openldap libicu m4 libtool libxslt libxml2 gcc-c++ openssh-server openssh-clients expect libarchive rsync apr apr-util zip tbb )

+ 1 - 1
cmake_modules/dependencies/lenny.cmake

@@ -1 +1 @@
-set ( CPACK_DEBIAN_PACKAGE_DEPENDS "libboost-regex1.34.1, libicu38, libxalan110, libxerces-c28, binutils, libldap-2.4-2, openssl, zlib1g, g++, sudo, openssh-client, openssh-server, expect, libarchive, rsync, libapr1, libaprutil1, zip, python, libtbb2" CACHE STRING "" FORCE )
+SET_DEPENDENCIES ( CPACK_DEBIAN_PACKAGE_DEPENDS libboost-regex1.34.1 libicu38 libxalan110 libxerces-c28 binutils libldap-2.4-2 openssl zlib1g g++ sudo openssh-client openssh-server expect libarchive rsync libapr1 libaprutil1 zip python libtbb2 )

+ 1 - 1
cmake_modules/dependencies/lucid.cmake

@@ -1 +1 @@
-set ( CPACK_DEBIAN_PACKAGE_DEPENDS "libboost-regex1.40.0, libicu42, libxslt1.1, libxml2, binutils, libldap-2.4-2, openssl, zlib1g, g++, openssh-client, openssh-server, expect, libarchive1, rsync, zip, python, libtbb2" CACHE STRING "" FORCE )
+SET_DEPENDENCIES ( CPACK_DEBIAN_PACKAGE_DEPENDS libboost-regex1.40.0 libicu42 libxslt1.1 libxml2 binutils libldap-2.4-2 openssl zlib1g g++ openssh-client openssh-server expect libarchive1 rsync zip python libtbb2 )

+ 1 - 1
cmake_modules/dependencies/natty.cmake

@@ -1 +1 @@
-set ( CPACK_DEBIAN_PACKAGE_DEPENDS "libboost-regex1.42.0, libicu44, libxalan110, libxerces-c28, binutils, libldap-2.4-2, openssl, zlib1g, g++, openssh-client, openssh-server, expect, libarchive1, rsync, zip, python, libtbb2" CACHE STRING "" FORCE )
+SET_DEPENDENCIES ( CPACK_DEBIAN_PACKAGE_DEPENDS libboost-regex1.42.0 libicu44 libxalan110 libxerces-c28 binutils libldap-2.4-2 openssl zlib1g g++ openssh-client openssh-server expect libarchive1 rsync zip python libtbb2 )

+ 1 - 1
cmake_modules/dependencies/oneiric.cmake

@@ -1 +1 @@
-set ( CPACK_DEBIAN_PACKAGE_DEPENDS "libboost-regex1.46.1, libicu44, libxalan110, libxerces-c28, binutils, libldap-2.4-2, openssl, zlib1g, g++, openssh-client, openssh-server, expect, libarchive1, rsync, libapr1, libaprutil1, zip, python, libtbb2" CACHE STRING "" FORCE )
+SET_DEPENDENCIES ( CPACK_DEBIAN_PACKAGE_DEPENDS libboost-regex1.46.1 libicu44 libxalan110 libxerces-c28 binutils libldap-2.4-2 openssl zlib1g g++ openssh-client openssh-server expect libarchive1 rsync libapr1 libaprutil1 zip python libtbb2 )

+ 1 - 1
cmake_modules/dependencies/precise.cmake

@@ -1 +1 @@
-set ( CPACK_DEBIAN_PACKAGE_DEPENDS "libboost-regex1.46.1, libicu48, libxslt1.1, libxml2, binutils, libldap-2.4-2, openssl, zlib1g, g++, openssh-client, openssh-server, expect, libarchive12, rsync, libapr1, libaprutil1, zip, python, libtbb2" CACHE STRING "" FORCE )
+SET_DEPENDENCIES ( CPACK_DEBIAN_PACKAGE_DEPENDS libboost-regex1.46.1 libicu48 libxslt1.1 libxml2 binutils libldap-2.4-2 openssl zlib1g g++ openssh-client openssh-server expect libarchive12 rsync libapr1 libaprutil1 zip python libtbb2 )

+ 1 - 1
cmake_modules/dependencies/quantal.cmake

@@ -1 +1 @@
-set ( CPACK_DEBIAN_PACKAGE_DEPENDS "libboost-regex1.49.0, libicu48, libxalan110, libxerces-c28, binutils, libldap-2.4-2, openssl, zlib1g, g++, openssh-client, openssh-server, expect, libarchive12, rsync, libapr1, libaprutil1, zip, python, libtbb2" CACHE STRING "" FORCE )
+SET_DEPENDENCIES ( CPACK_DEBIAN_PACKAGE_DEPENDS libboost-regex1.49.0 libicu48 libxalan110 libxerces-c28 binutils libldap-2.4-2 openssl zlib1g g++ openssh-client openssh-server expect libarchive12 rsync libapr1 libaprutil1 zip python libtbb2 )

+ 1 - 1
cmake_modules/dependencies/raring.cmake

@@ -1 +1 @@
-set ( CPACK_DEBIAN_PACKAGE_DEPENDS "libboost-regex1.49.0, libicu48, libxalan110, libxerces-c28, binutils, libldap-2.4-2, openssl, zlib1g, g++, openssh-client, openssh-server, expect, libarchive13, rsync, libapr1, libaprutil1, zip, libtbb2" CACHE STRING "" FORCE )
+SET_DEPENDENCIES ( CPACK_DEBIAN_PACKAGE_DEPENDS libboost-regex1.49.0 libicu48 libxalan110 libxerces-c28 binutils libldap-2.4-2 openssl zlib1g g++ openssh-client openssh-server expect libarchive13 rsync libapr1 libaprutil1 zip libtbb2 )

+ 1 - 1
cmake_modules/dependencies/saucy.cmake

@@ -1 +1 @@
-set ( CPACK_DEBIAN_PACKAGE_DEPENDS "libboost-regex1.53.0, libicu48, libxalan-c111, libxerces-c3.1, binutils, libldap-2.4-2, openssl, zlib1g, g++, openssh-client, openssh-server, expect, libarchive13, rsync, libapr1, libaprutil1, zip, python, libtbb2" CACHE STRING "" FORCE )
+SET_DEPENDENCIES ( CPACK_DEBIAN_PACKAGE_DEPENDS libboost-regex1.53.0 libicu48 libxalan-c111 libxerces-c3.1 binutils libldap-2.4-2 openssl zlib1g g++ openssh-client openssh-server expect libarchive13 rsync libapr1 libaprutil1 zip python libtbb2 )

+ 1 - 1
cmake_modules/dependencies/squeeze.cmake

@@ -1 +1 @@
-set ( CPACK_DEBIAN_PACKAGE_DEPENDS "libboost-regex1.42.0, libicu44, libxalan110, libxerces-c28, binutils, libldap-2.4-2, openssl, zlib1g, g++, openssh-client, openssh-server, expect, libarchive1, rsync, libapr1, libaprutil1, zip, python, libtbb2" CACHE STRING "" FORCE )
+SET_DEPENDENCIES ( CPACK_DEBIAN_PACKAGE_DEPENDS libboost-regex1.42.0 libicu44 libxalan110 libxerces-c28 binutils libldap-2.4-2 openssl zlib1g g++ openssh-client openssh-server expect libarchive1 rsync libapr1 libaprutil1 zip python libtbb2 )

+ 1 - 1
cmake_modules/dependencies/suse11.3.cmake

@@ -1 +1 @@
-set ( CPACK_RPM_PACKAGE_REQUIRES "binutils, gcc-c++, openssh, libldap-2_4-2, libicu, libboost_regex1_42_0, libxerces-c-3_0, libxalan-c110, expect, libarchive2, rsync, apr, apr-util, zip" CACHE STRING "" FORCE )
+SET_DEPENDENCIES ( CPACK_RPM_PACKAGE_REQUIRES binutils gcc-c++ openssh libldap-2_4-2 libicu libboost_regex1_42_0 libxerces-c-3_0 libxalan-c110 expect libarchive2 rsync apr apr-util zip )

+ 1 - 1
cmake_modules/dependencies/suse11.4.cmake

@@ -1 +1 @@
-set ( CPACK_RPM_PACKAGE_REQUIRES "binutils, gcc-c++, openssh, libldap-2_4-2, libicu, libboost_regex1_44_0, libxerces-c-3_0, libxalan-c110, expect, libarchive2, rsync, apr, apr-util, zip" CACHE STRING "" FORCE )
+SET_DEPENDENCIES ( CPACK_RPM_PACKAGE_REQUIRES binutils gcc-c++ openssh libldap-2_4-2 libicu libboost_regex1_44_0 libxerces-c-3_0 libxalan-c110 expect libarchive2 rsync apr apr-util zip )

+ 2 - 2
cmake_modules/dependencies/template.cmake

@@ -6,7 +6,7 @@
 #       ex. Centos 5.x            el5.cmake
 #
 # 2. Add a DEPENDS line based on the package system of your distribution.
-#       ex. set ( CPACK_DEBIAN_PACKAGE_DEPENDS "libicu, libboost-regex1.42.0" CACHE STRING "" FORCE )
-#       ex. set ( CPACK_RPM_PACKAGE_REQUIRES "libicu, boost" CACHE STRING "" FORCE )
+#       ex. SET_DEPENDENCIES ( CPACK_DEBIAN_PACKAGE_DEPENDS libicu libboost-regex1.42.0 )
+#       ex. SET_DEPENDENCIES ( CPACK_RPM_PACKAGE_REQUIRES libicu boost )
 #
 # 3. Save your changes and create a build from your build directory with `make package`

+ 1 - 1
cmake_modules/dependencies/trusty.cmake

@@ -1 +1 @@
-set ( CPACK_DEBIAN_PACKAGE_DEPENDS "libboost-regex1.54.0, libicu52, libxslt1.1, libxml2, binutils, libldap-2.4-2, openssl, zlib1g, g++, openssh-client, openssh-server, expect, libarchive13, rsync, libapr1, libaprutil1, zip, python, libtbb2" CACHE STRING "" FORCE )
+SET_DEPENDENCIES ( CPACK_DEBIAN_PACKAGE_DEPENDS libboost-regex1.54.0 libicu52 libxslt1.1 libxml2 binutils libldap-2.4-2 openssl zlib1g g++ openssh-client openssh-server expect libarchive13 rsync libapr1 libaprutil1 zip python libtbb2 )

+ 1 - 1
cmake_modules/dependencies/utopic.cmake

@@ -1 +1 @@
-set ( CPACK_DEBIAN_PAcKAGE_DEPENDS "libboost-regex1.55.0, libicu52, libxslt1.1, libxml2, binutils, libldap-2.4-2, openssl, zlib1g, g++, openssh-client, openssh-server, expect, libarchive13, rsync, libapr1, libaprutil1, python, libtbb2" CACHE STRING "" FORCE )
+SET_DEPENDENCIES ( CPACK_DEBIAN_PACKAGE_DEPENDS libboost-regex1.55.0 libicu52 libxslt1.1 libxml2 binutils libldap-2.4-2 openssl zlib1g g++ openssh-client openssh-server expect libarchive13 rsync libapr1 libaprutil1 python libtbb2 )

+ 1 - 1
cmake_modules/dependencies/vivid.cmake

@@ -1 +1 @@
-set ( CPACK_DEBIAN_PACKAGE_DEPENDS "libboost-regex1.55.0, libicu52, libxslt1.1, libxml2, binutils, libldap-2.4-2, openssl, zlib1g, g++, openssh-client, openssh-server, expect, libarchive13, rsync, libapr1, libaprutil1, python, libtbb2" CACHE STRING "" FORCE )
+SET_DEPENDENCIES ( CPACK_DEBIAN_PACKAGE_DEPENDS libboost-regex1.55.0 libicu52 libxslt1.1 libxml2 binutils libldap-2.4-2 openssl zlib1g g++ openssh-client openssh-server expect libarchive13 rsync libapr1 libaprutil1 python libtbb2 )