You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2021/02/24 22:25:16 UTC

[GitHub] [arrow] kou commented on a change in pull request #9553: ARROW-11580: [C++] Add CMake option ARROW_DEPENDENCY_SOURCE=VCPKG

kou commented on a change in pull request #9553:
URL: https://github.com/apache/arrow/pull/9553#discussion_r582342080



##########
File path: cpp/CMakeLists.txt
##########
@@ -58,6 +58,12 @@ endif()
 string(TOLOWER ${CMAKE_BUILD_TYPE} LOWERCASE_BUILD_TYPE)
 string(TOUPPER ${CMAKE_BUILD_TYPE} UPPERCASE_BUILD_TYPE)
 
+# this must be included before the project() command, because of the way
+# vcpkg (ab)uses CMAKE_TOOLCHAIN_FILE to inject its logic into CMake
+if(ARROW_DEPENDENCY_SOURCE STREQUAL "VCPKG")
+  include("${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules/Findvcpkg.cmake")

Review comment:
       Does this work?
   
   ```diff
   diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt
   index 24b6c57f6..e6799cafd 100644
   --- a/cpp/CMakeLists.txt
   +++ b/cpp/CMakeLists.txt
   @@ -58,10 +58,12 @@ endif()
    string(TOLOWER ${CMAKE_BUILD_TYPE} LOWERCASE_BUILD_TYPE)
    string(TOUPPER ${CMAKE_BUILD_TYPE} UPPERCASE_BUILD_TYPE)
    
   +list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules")
   +
    # this must be included before the project() command, because of the way
    # vcpkg (ab)uses CMAKE_TOOLCHAIN_FILE to inject its logic into CMake
    if(ARROW_DEPENDENCY_SOURCE STREQUAL "VCPKG")
   -  include("${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules/Findvcpkg.cmake")
   +  include(Findvcpkg)
    endif()
    
    project(arrow VERSION "${ARROW_BASE_VERSION}")
   @@ -94,8 +96,6 @@ message(STATUS "Arrow SO version: ${ARROW_SO_VERSION} (full: ${ARROW_FULL_SO_VER
    set(ARROW_SOURCE_DIR ${PROJECT_SOURCE_DIR})
    set(ARROW_BINARY_DIR ${PROJECT_BINARY_DIR})
    
   -set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules")
   -
    include(CMakePackageConfigHelpers)
    include(CMakeParseArguments)
    include(ExternalProject)
   ```

##########
File path: cpp/CMakeLists.txt
##########
@@ -58,6 +58,12 @@ endif()
 string(TOLOWER ${CMAKE_BUILD_TYPE} LOWERCASE_BUILD_TYPE)
 string(TOUPPER ${CMAKE_BUILD_TYPE} UPPERCASE_BUILD_TYPE)
 
+# this must be included before the project() command, because of the way
+# vcpkg (ab)uses CMAKE_TOOLCHAIN_FILE to inject its logic into CMake
+if(ARROW_DEPENDENCY_SOURCE STREQUAL "VCPKG")
+  include("${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules/Findvcpkg.cmake")

Review comment:
       We should not use `FindXXX.cmake` here because it's not a file for `find_package()`.
   How about `Setupvcpkg.cmake` or something?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org