浏览代码

HPCC-10169 Integrate ClientTools on Windows 32bit with Jenkins

1) Add FindBZip2.cmake to resolve BZip2
2) Update FindLIBARCHIVE.cmake and FindZLIB.cmake to get correct libraries
3) New variable SIGN_DIRECTORY in CMakeLists.txt to point location of sign files
   Assume  cmake option -DSIGN_DIRECTORY=<directory>
4) Update to ${PACKAGE_FILE_NAME_PREFIX}*.exe for correct window binary file in CMakeLists.txt

Complete cmake command parameters:
-DUSE_NATIVE_LIBRARIES=OFF -DCHECK_GIT_TAG=0 -DCLIENTTOOLS_ONLY=ON  -DUSE_PYTHON=OFF -DUSE_V8=OFF -DUSE_JNI=OFF -DUSE_RINSIDE=OFF -DSIGN_DIRECTORY=${SIGN_DIRECTORY}  -DEXTERNALS_DIRECTORY=${EXTERNALS_DIRECTORY} -DUSE_APR=OFF

SIGN_DIRECTORY and EXTERNALS_DIRECTORY are build node variables in chance they are different on systems.

cmake build commends are list in "Execute Windows batch command" since cmake plugin only allow one make command:
  cd build
  cmake --build . --config Release
  cmake --build . --config Release --target package
  cmake --build . --config Release --target sign
Xiaoming Wang 11 年之前
父节点
当前提交
f32607eb02
共有 4 个文件被更改,包括 70 次插入7 次删除
  1. 4 2
      CMakeLists.txt
  2. 52 0
      cmake_modules/FindBZip2.cmake
  3. 12 2
      cmake_modules/FindLIBARCHIVE.cmake
  4. 2 3
      cmake_modules/FindZLIB.cmake

+ 4 - 2
CMakeLists.txt

@@ -313,10 +313,12 @@ else ( PLATFORM )
         !define MUI_FINISHPAGE_NOAUTOCLOSE
       ")
 
-      file(STRINGS "${PROJECT_SOURCE_DIR}/../sign/passphrase.txt" PFX_PASSWORD LIMIT_COUNT 1)
+      file(STRINGS "${SIGN_DIRECTORY}/passphrase.txt" PFX_PASSWORD LIMIT_COUNT 1)
 
       add_custom_target(SIGN 
-          COMMAND signtool sign /f "${PROJECT_SOURCE_DIR}/../sign/hpcc_code_signing.pfx" /p "${PFX_PASSWORD}" /t "http://timestamp.verisign.com/scripts/timstamp.dll" "${CMAKE_BINARY_DIR}/${CPACK_PACKAGE_NAME}*.exe"
+          COMMAND signtool sign /f "${SIGN_DIRECTORY}/hpcc_code_signing.pfx"
+/p "${PFX_PASSWORD}" /t "http://timestamp.verisign.com/scripts/timstamp.dll"
+"${CMAKE_BINARY_DIR}/${PACKAGE_FILE_NAME_PREFIX}*.exe"
           COMMENT "Digital Signature"
       )
       add_dependencies(SIGN PACKAGE)

+ 52 - 0
cmake_modules/FindBZip2.cmake

@@ -0,0 +1,52 @@
+################################################################################
+#    HPCC SYSTEMS software Copyright (C) 2012 HPCC Systems.
+#
+#    Licensed under the Apache License, Version 2.0 (the "License");
+#    you may not use this file except in compliance with the License.
+#    You may obtain a copy of the License at
+#
+#       http://www.apache.org/licenses/LICENSE-2.0
+#
+#    Unless required by applicable law or agreed to in writing, software
+#    distributed under the License is distributed on an "AS IS" BASIS,
+#    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#    See the License for the specific language governing permissions and
+#    limitations under the License.
+################################################################################
+
+
+# - Try to find the BZIP2 compression library
+# Once done this will define
+#
+#  BZIP2_FOUND - system has the BZIP2 library
+#  BZIP2_INCLUDE_DIR - the BZIP include directory
+#  BZIP2_LIBRARIES - The libraries needed to use BZIP2
+
+IF (NOT BZIP2_FOUND)
+  IF (NOT "${EXTERNALS_DIRECTORY}" STREQUAL "")
+    IF(WIN32)
+      SET (osdir "win32")
+      SET (bzip2ver "1.0.6")
+      SET (bzip2_lib "libbz2")
+    ENDIF()
+    IF (NOT ("${osdir}" STREQUAL "unknown"))
+      FIND_PATH (BZIP2_INCLUDE_DIR NAMES bzlib.h PATHS "${EXTERNALS_DIRECTORY}/bzip2/${bzip2ver}/include"
+NO_DEFAULT_PATH)
+      FIND_LIBRARY (BZIP2_LIBRARIES NAMES ${bzip2_lib} PATHS "${EXTERNALS_DIRECTORY}/bzip2/${bzip2ver}/lib/${osdir}" NO_DEFAULT_PATH)
+    ENDIF()
+  ENDIF()
+
+  IF (USE_NATIVE_LIBRARIES)
+    # if we didn't find in externals, look in system include path
+    FIND_PATH (BZIP2_INCLUDE_DIR NAMES bzlib.h)
+    FIND_LIBRARY (BZIP2_LIBRARIES NAMES ${bzip2_lib})
+  ENDIF()
+
+  include(FindPackageHandleStandardArgs)
+  find_package_handle_standard_args(BZip2 DEFAULT_MSG
+    BZIP2_LIBRARIES
+    BZIP2_INCLUDE_DIR
+  )
+
+  MARK_AS_ADVANCED(BZIP2_INCLUDE_DIR BZIP2_LIBRARIES)
+ENDIF()

+ 12 - 2
cmake_modules/FindLIBARCHIVE.cmake

@@ -23,13 +23,23 @@
 
 IF (NOT LIBARCHIVE_FOUND)
   IF (WIN32)
+    SET (libarchive_ver "3.1.2")
     SET (libarchive_lib "archive_static")
+    IF (${ARCH64BIT} EQUAL 1)
+        SET (osdir "Win64")
+    ELSE ()
+        SET (osdir "Win32")
+    ENDIF ()
+
+    FIND_PATH (LIBARCHIVE_INCLUDE_DIR NAMES archive.h PATHS "${EXTERNALS_DIRECTORY}/libarchive/${libarchive_ver}/include" NO_DEFAULT_PATH)
+    FIND_LIBRARY (LIBARCHIVE_LIBRARIES NAMES ${libarchive_lib} PATHS "${EXTERNALS_DIRECTORY}/libarchive/${libarchive_ver}/lib/${osdir}" NO_DEFAULT_PATH)
   ELSE()
     SET (libarchive_lib "archive")
+    FIND_PATH (LIBARCHIVE_INCLUDE_DIR NAMES archive.h)
+    FIND_LIBRARY (LIBARCHIVE_LIBRARIES NAMES ${libarchive_lib})
   ENDIF()
 
-  FIND_PATH (LIBARCHIVE_INCLUDE_DIR NAMES archive.h)
-  FIND_LIBRARY (LIBARCHIVE_LIBRARIES NAMES ${libarchive_lib})
+
 
   include(FindPackageHandleStandardArgs)
   find_package_handle_standard_args(libarchive DEFAULT_MSG

+ 2 - 3
cmake_modules/FindZLIB.cmake

@@ -40,11 +40,10 @@ IF (NOT ZLIB_FOUND)
     ELSEIF(WIN32)
       IF (${ARCH64BIT} EQUAL 1)
         SET (osdir "win64")
-        SET (zlibver "1.2.5")
       ELSE()
-        SET (osdir "")
-        SET (zlibver "1.2.1")
+        SET (osdir "win32")
       ENDIF()  
+      SET (zlibver "1.2.5")
     ELSE()
       SET (osdir "unknown")
       SET (zlibver "unknown")