소스 검색

Merge pull request #15794 from GordonSmith/HPCC-27209-NSIS

HPCC-27209 VCPKG Client Tools Support

Reviewed-By: Rodrigo Pastrana <rodrigo.pastrana@lexisnexis.com>
Reviewed-By: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman 3 년 전
부모
커밋
cee8f23694
5개의 변경된 파일93개의 추가작업 그리고 16개의 파일을 삭제
  1. 14 11
      CMakeLists.txt
  2. 1 1
      cmake_modules/vcpkgSetup.cmake
  3. 4 2
      esp/scm/CMakeLists.txt
  4. 4 2
      system/logaccess/CMakeLists.txt
  5. 70 0
      vcpkg.md

+ 14 - 11
CMakeLists.txt

@@ -201,9 +201,11 @@ elseif ( NOT MAKE_DOCS_ONLY )
 endif()
 
 HPCC_ADD_SUBDIRECTORY(docs "PLATFORM")
-if(APPLE OR WIN32)
-    HPCC_ADD_SUBDIRECTORY(lib2)
-endif(APPLE OR WIN32)
+if (NOT VCPKG_APPLOCAL_DEPS)
+    if(APPLE OR WIN32)
+        HPCC_ADD_SUBDIRECTORY(lib2)
+    endif(APPLE OR WIN32)
+endif()
 
 if(APPLE)
     HPCC_ADD_SUBDIRECTORY(package)
@@ -493,16 +495,17 @@ if(TOP_LEVEL_PROJECT)
 
             set(CPACK_NSIS_MODIFY_PATH "ON")
 
+            if (EXISTS "${SIGN_DIRECTORY}/passphrase.txt")
 
-            file(STRINGS "${SIGN_DIRECTORY}/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 "${SIGN_DIRECTORY}/hpcc_code_signing.pfx" /fd "SHA256"
-/p "${PFX_PASSWORD}" /tr "http://timestamp.digicert.com" "${CMAKE_BINARY_DIR}/${PACKAGE_FILE_NAME_PREFIX}*.exe"
-                COMMENT "Digital Signature"
-            )
-            add_dependencies(SIGN PACKAGE)
-            set_property(TARGET SIGN PROPERTY FOLDER "CMakePredefinedTargets")
+                add_custom_target(SIGN
+                    COMMAND signtool sign /f "${SIGN_DIRECTORY}/hpcc_code_signing.pfx" /fd "SHA256" /p "${PFX_PASSWORD}" /tr "http://timestamp.digicert.com" "${CMAKE_BINARY_DIR}/${PACKAGE_FILE_NAME_PREFIX}*.exe"
+                    COMMENT "Digital Signature"
+                )
+                add_dependencies(SIGN PACKAGE)
+                set_property(TARGET SIGN PROPERTY FOLDER "CMakePredefinedTargets")
+            endif()
         endif()
     endif(PLATFORM OR PLUGIN)
 endif(TOP_LEVEL_PROJECT)

+ 1 - 1
cmake_modules/vcpkgSetup.cmake

@@ -15,4 +15,4 @@ set (CMAKE_EXPORT_COMPILE_COMMANDS TRUE)
 option(BUILD_TESTS "Enable libgit2 tests (override libgit2 option)" ON)
 set (BUILD_TESTS OFF)
 set (SKIP_ECLWATCH ON)
-set (USE_OPTIONAL OFF)
+set (USE_OPTIONAL OFF)

+ 4 - 2
esp/scm/CMakeLists.txt

@@ -37,6 +37,8 @@ ADD_CUSTOM_TARGET(
   DEPENDS ${ESP_GENERATED_INCLUDES}
 )
 
-if (WIN32)
-  ADD_DEPENDENCIES(espscm copy_libssl)
+if (NOT VCPKG_APPLOCAL_DEPS)
+  if (WIN32)
+    ADD_DEPENDENCIES(espscm copy_libssl)
+  endif()
 endif()

+ 4 - 2
system/logaccess/CMakeLists.txt

@@ -14,6 +14,8 @@
 #    limitations under the License.
 ################################################################################
 
-IF((NOT WIN32) AND USE_ELASTICSTACK_CLIENT)
-  HPCC_ADD_SUBDIRECTORY (ElasticStack)
+IF(NOT CLIENTTOOLS_ONLY)
+  IF((NOT WIN32) AND USE_ELASTICSTACK_CLIENT)
+    HPCC_ADD_SUBDIRECTORY (ElasticStack)
+  ENDIF()
 ENDIF()

+ 70 - 0
vcpkg.md

@@ -0,0 +1,70 @@
+# Building with VCPKG
+
+_[vcpkg](https://github.com/microsoft/vcpkg) is a C++ Library Manager for Windows, Linux, and MacOS.  The primary motivation for integration into the HPCC-Platform build pipeline is to be able to build the platform / client tools without the need of any "secret sauce" or random downloads to third party libraries, especially when building on Windows and OSX._
+
+**Note:** _This is a work in progress and is not yet complete and the expectation is that the instructions will get simplified over time._
+
+## Prerequisits 
+
+* git
+* cmake
+* Build tools (gcc, clang, Visual Studio, NSIS etc.)
+
+## Steps
+
+### 1 - Clone the repository
+
+```sh
+git clone https://github.com/hpcc-systems/HPCC-Platform.git HPCC-Platform
+git checkout candidate-8.6.x
+cd HPCC-Platform
+git submodule update --init --recursive
+```
+
+### Create an out of source build folder
+```
+mkdir build
+cd build
+```
+
+### Generate build configurations
+
+#### OSX / Linux
+
+```sh
+cmake .. -DX_VCPKG_APPLOCAL_DEPS_INSTALL=ON -DCMAKE_TOOLCHAIN_FILE=../vcpkg/scripts/buildsystems/vcpkg.cmake -DCMAKE_BUILD_TYPE=Debug
+```
+
+#### Windows (VS 2019 x64) 
+
+```sh
+cmake .. -DX_VCPKG_APPLOCAL_DEPS_INSTALL=ON -DCMAKE_TOOLCHAIN_FILE=../vcpkg/scripts/buildsystems/vcpkg.cmake -G "Visual Studio 16 2019" -T host=x64 -A x64 
+```
+
+### Build
+
+#### OSX / Linux
+
+```sh
+cmake --build . -- -j
+```
+
+#### Windows (VS 2019 x64) 
+
+```sh
+cmake --build . --config Debug -- -m
+```
+
+### Create Installer
+
+#### OSX / Linux
+
+```sh
+cmake --build . --target package -- -j
+```
+
+#### Windows (VS 2019 x64) 
+
+```sh
+cmake --build . --config Release --target package -- -m
+```