Pārlūkot izejas kodu

HPCC-27164 Add support for USE_BOOST_REGEX to vcpkg

Signed-off-by: Gordon Smith <GordonJSmith@gmail.com>
Gordon Smith 3 gadi atpakaļ
vecāks
revīzija
76125c8a8b

+ 0 - 122
cmake_modules/FindBOOST_REGEX.cmake

@@ -1,122 +0,0 @@
-################################################################################
-#    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 Boost regex library
-# Once done this will define
-#
-#  BOOST_REGEX_FOUND - system has the Boost regex library
-#  BOOST_REGEX_INCLUDE_DIR - the Boost regex include directory
-#  BOOST_REGEX_LIBRARIES - The libraries needed to use Boost regex
-#  BOOST_REGEX_LIBRARY_DIR - The directory containing libraries needed to use Boost regex
-
-IF (NOT BOOST_REGEX_FOUND)
-  IF (WIN32 AND USE_NATIVE_LIBRARIES)
-    set ( Boost_USE_STATIC_LIBS ON )
-    set ( Boost_USE_MULTITHREADED ON )
-    set ( Boost_USE_STATIC_RUNTIME OFF )
-    find_package( Boost COMPONENTS regex )
-    IF (Boost_FOUND)
-      set(BOOST_REGEX_FOUND TRUE)
-      set(BOOST_REGEX_LIBRARIES ${Boost_LIBRARIES})
-      set(BOOST_REGEX_INCLUDE_DIR ${Boost_INCLUDE_DIRS})
-      set(BOOST_REGEX_LIBRARY_DIR ${Boost_LIBRARY_DIRS})
-      link_directories(${BOOST_REGEX_LIBRARY_DIR})
-    ENDIF (Boost_FOUND)
-  ELSE (WIN32 AND USE_NATIVE_LIBRARIES)
-    IF (UNIX)
-      SET (boost_regex_lib "boost_regex-mt")
-      IF(Boost_USE_STATIC_LIBS)
-        SET (boost_regex_lib "libboost_regex-mt.a")
-      ENDIF()
-    ELSEIF(WIN32)
-      IF (MSVC_VERSION GREATER_EQUAL 1900)
-         SET (boost_regex_lib "boost_regex-vc140-mt-1_60.lib")
-      ELSEIF (MSVC12)
-         SET (boost_regex_lib "boost_regex-vc120-mt-1_57.lib")
-      ELSEIF (MSVC10)
-         SET (boost_regex_lib "boost_regex-vc100-mt-1_57.lib")
-      ELSEIF (MSVC90)
-         SET (boost_regex_lib "boost_regex-vc90-mt-1_57.lib")
-      ELSE ()
-         SET (boost_regex_lib "boost_regex-mt.lib")
-      ENDIF()
-    ENDIF()
-    IF (NOT "${EXTERNALS_DIRECTORY}" STREQUAL "")
-      IF (UNIX)
-        IF (${ARCH64BIT} EQUAL 1)
-        SET (osdir "linux-x86_64-gcc4")
-        ELSE()
-        SET (osdir "linux-i686-gcc4")
-        ENDIF()
-      ELSEIF(WIN32)
-        IF (${ARCH64BIT} EQUAL 1)
-          SET (osdir "windows-x86_64")
-        ELSE()
-          SET (osdir "windows-i386")
-        ENDIF()
-      ELSE()
-        SET (osdir "unknown")
-      ENDIF()
-
-      IF (NOT ("${osdir}" STREQUAL "unknown"))
-        FIND_PATH (BOOST_REGEX_INCLUDE_DIR NAMES boost/regex.h PATHS "${EXTERNALS_DIRECTORY}/boost/include" NO_DEFAULT_PATH)
-        FIND_LIBRARY (BOOST_REGEX_LIBRARIES NAMES ${boost_regex_lib} PATHS "${EXTERNALS_DIRECTORY}/boost/${osdir}/lib" NO_DEFAULT_PATH)
-      ENDIF() 
-    ENDIF()
-
-    # if we didn't find in externals, look in system include path
-    if (USE_NATIVE_LIBRARIES)
-       set(Boost_ADDITIONAL_VERSIONS "1.41" "1.41.0" "1.44.0")
-       set(Boost_USE_MULTITHREADED ON)
-       set (Boost_DETAILED_FAILURE_MSG ON)
-    # On centos we may have both boost-devel and boost141-devel installed. We need to look for the former first.
-       set(BOOST_ROOT "/usr/include/boost141")
-       set(BOOST_INCLUDEDIR "/usr/include/boost141")
-       if (${ARCH64BIT} EQUAL 1)
-         set(BOOST_LIBRARYDIR "/usr/lib64/boost141")
-       else()
-         set(BOOST_LIBRARYDIR "/usr/lib/boost141")
-       endif()
-       find_package( Boost 1.34.0 COMPONENTS regex )
-       if(Boost_FOUND)
-         set(BOOST_REGEX_LIBRARIES ${Boost_LIBRARIES})
-         set(BOOST_REGEX_INCLUDE_DIR ${Boost_INCLUDE_DIRS})
-       endif()
-    endif()
-
-    include(FindPackageHandleStandardArgs)
-    find_package_handle_standard_args(BOOST_REGEX DEFAULT_MSG
-      BOOST_REGEX_LIBRARIES 
-      BOOST_REGEX_INCLUDE_DIR
-    )
-
-    IF (BOOST_REGEX_FOUND)
-      IF (WIN32)
-        STRING(REPLACE "/${boost_regex_lib}" "" BOOST_REGEX_LIBRARY_DIR "${BOOST_REGEX_LIBRARIES}")
-        link_directories(${BOOST_REGEX_LIBRARY_DIR})
-        set (BOOST_REGEX_LIBRARIES "")  # the actual library to use is controlled by boost header files
-      ENDIF()
-      IF(EXISTS "${BOOST_REGEX_INCLUDE_DIR}/boost/version.hpp")
-        FILE (STRINGS "${BOOST_REGEX_INCLUDE_DIR}/boost/version.hpp" BOOST_REGEX_VERSION REGEX "#define *BOOST_VERSION [0-9]*")
-        STRING(REGEX REPLACE "#define *BOOST_VERSION *" "" BOOST_REGEX_VERSION "${BOOST_REGEX_VERSION}")
-        MESSAGE("BOOST_REGEX_VERSION is ${BOOST_REGEX_VERSION}")
-      ENDIF()
-      
-    ENDIF()
-    MARK_AS_ADVANCED(BOOST_REGEX_INCLUDE_DIR BOOST_REGEX_LIBRARIES)
-  ENDIF (WIN32 AND USE_NATIVE_LIBRARIES)
-ENDIF()

+ 2 - 2
cmake_modules/buildBOOST_REGEX.cmake

@@ -26,7 +26,7 @@ if(PLATFORM OR CLIENTTOOLS_ONLY)
     DESTINATION ${LIB_DIR})
 endif()
 
-set(BOOST_REGEX_INCLUDE_DIR ${CMAKE_BINARY_DIR}/downloads/boost_1_71_0)
-set(BOOST_REGEX_LIBRARIES ${CMAKE_BINARY_DIR}/downloads/boost_1_71_0/stage/lib/libboost_regex.so.1.17.0)
+set(Boost_INCLUDE_DIRS ${CMAKE_BINARY_DIR}/downloads/boost_1_71_0)
+set(Boost_REGEX_LIBRARY ${CMAKE_BINARY_DIR}/downloads/boost_1_71_0/stage/lib/libboost_regex.so.1.17.0)
 message(STATUS "----------------------- ${BOOST_REGEX_LIBRARIES}")
 mark_as_advanced(BOOST_REGEX_LIBRARIES BOOST_REGEX_INCLUDE_DIR)

+ 2 - 2
cmake_modules/commonSetup.cmake

@@ -961,8 +961,8 @@ IF ("${COMMONSETUP_DONE}" STREQUAL "")
           message(STATUS "CENTOS_6_BOOST_REGEX enabled")
           add_definitions (-D_USE_BOOST_REGEX)
         else()
-          find_package(BOOST_REGEX)
-          if (BOOST_REGEX_FOUND)
+          find_package(Boost COMPONENTS regex)
+          if (Boost_REGEX_FOUND)
             message(STATUS "BOOST_REGEX enabled")
             add_definitions (-D_USE_BOOST_REGEX)
           else()

+ 0 - 1
cmake_modules/vcpkgSetup.cmake

@@ -2,7 +2,6 @@ set (USE_OPENLDAP OFF)
 
 set (USE_CBLAS OFF)
 
-set (USE_BOOST_REGEX OFF)
 
 set (USE_AZURE OFF)
 set (USE_AWS OFF)

+ 1 - 1
configuration/configmgr/configmgrlib/CMakeLists.txt

@@ -63,7 +63,7 @@ INCLUDE_DIRECTORIES(
     ${HPCC_SOURCE_DIR}/configuration/configmgr/RapidJSON/include
     ${CMAKE_BINARY_DIR}
     ${CMAKE_BINARY_DIR}/oss
-    ${BOOST_REGEX_INCLUDE_DIR}
+    ${Boost_INCLUDE_DIRS}
 )
 
 ADD_DEFINITIONS( -D_USRDLL -DCFGMGRLIB_EXPORTS)

+ 1 - 1
esp/services/ws_configmgr/CMakeLists.txt

@@ -50,7 +50,7 @@ include_directories(
     ${CMAKE_BINARY_DIR}
     ${CMAKE_BINARY_DIR}/oss
     ${CMAKE_BINARY_DIR}/esp/services/ws_configmgr
-    ${BOOST_REGEX_INCLUDE_DIR}
+    ${Boost_INCLUDE_DIRS}
     ${HPCC_SOURCE_DIR}/common/thorhelper
     )
 

+ 2 - 2
rtl/eclrtl/CMakeLists.txt

@@ -74,7 +74,7 @@ include_directories (
          ./../../system/jlib 
          ./../../roxie/roxiemem
          ./../../testing/unittests
-         ${BOOST_REGEX_INCLUDE_DIR}
+         ${Boost_INCLUDE_DIRS}
     )
 
 ADD_DEFINITIONS( -D_USRDLL -DECLRTL_EXPORTS )
@@ -93,7 +93,7 @@ if(CENTOS_6_BOOST)
   add_dependencies(eclrtl boost-regex)
   target_link_libraries( eclrtl boost-regex)
 else()
-  target_link_libraries( eclrtl ${BOOST_REGEX_LIBRARIES} )
+  target_link_libraries( eclrtl ${Boost_REGEX_LIBRARY} )
 endif()
 
 target_link_libraries ( eclrtl 

+ 1 - 0
vcpkg.json

@@ -13,6 +13,7 @@
             "features": []
         },
         "boost-property-tree",
+        "boost-regex",
         "python3",
         "apr",
         "apr-util",