Skip to content

Commit

Permalink
chore: patch and build freexl locally
Browse files Browse the repository at this point in the history
  • Loading branch information
shun2wang authored Jan 10, 2025
1 parent 0c0167a commit 2847f33
Showing 1 changed file with 32 additions and 6 deletions.
38 changes: 32 additions & 6 deletions Tools/CMake/Conan.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,37 @@ if(USE_CONAN)
if(WIN32)

message(STATUS " ${CONAN_COMPILER_RUNTIME}")


message(STATUS "Cloning private freexl dependency")
set(FREEXL_VERSION "2.1.0-dev")
FetchContent_Declare(
freexl
GIT_REPOSITORY https://github.com/shun2wang/conan-recipes.git
GIT_TAG f014849188bddd01b9ca3ddf63dde8d2e3a45314
)
FetchContent_MakeAvailable(freexl)
if(freexl_POPULATED)

message(STATUS "Compiling freexl dependency")
execute_process(
COMMAND_ECHO STDOUT
WORKING_DIRECTORY ${freexl_SOURCE_DIR}/freexl
COMMAND
conan create . --version=${FREEXL_VERSION}
-s build_type=${CMAKE_BUILD_TYPE}
-c tools.cmake.cmaketoolchain:generator=${CMAKE_GENERATOR}
-s compiler.runtime=${CONAN_COMPILER_RUNTIME} --build=missing
#--test-missing
)
else()
message(CHECK_FAIL "build freexl failed")
endif()

execute_process(
COMMAND_ECHO STDOUT
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
COMMAND
conan install ${CONAN_FILE_PATH} --output-folder=${CMAKE_BINARY_DIR}/conan_build
conan install ${CONAN_FILE_PATH} --output-folder=${CMAKE_BINARY_DIR}/_conan_build
-s build_type=${CMAKE_BUILD_TYPE}
-s compiler.runtime=${CONAN_COMPILER_RUNTIME} --build=missing)

Expand All @@ -49,7 +74,7 @@ if(USE_CONAN)
COMMAND
conan install ${CONAN_FILE_PATH} -s build_type=${CMAKE_BUILD_TYPE} -s
os.version=${CMAKE_OSX_DEPLOYMENT_TARGET} -s
arch=${CONAN_ARCH} -s arch_build=${CONAN_ARCH} --build=missing -of ${CMAKE_BINARY_DIR}/conan_build)
arch=${CONAN_ARCH} -s arch_build=${CONAN_ARCH} --build=missing -of ${CMAKE_BINARY_DIR}/_conan_build)

else()

Expand All @@ -59,13 +84,13 @@ if(USE_CONAN)
COMMAND
conan install ${CONAN_FILE_PATH} -s build_type=${CMAKE_BUILD_TYPE} -s
os.version=${CMAKE_OSX_DEPLOYMENT_TARGET}
--build=missing -of ${CMAKE_BINARY_DIR}/conan_build)
--build=missing -of ${CMAKE_BINARY_DIR}/_conan_build)

endif()

endif()

if(EXISTS ${CMAKE_BINARY_DIR}/conan_build/${CONAN_RESULT_FILE})
if(EXISTS ${CMAKE_BINARY_DIR}/_conan_build/${CONAN_RESULT_FILE})
message(CHECK_PASS "successful")
else()
message(CHECK_FAIL "unsuccessful")
Expand All @@ -75,7 +100,8 @@ if(USE_CONAN)
)
endif()

include(${CMAKE_BINARY_DIR}/conan_build/conan_toolchain.cmake)
include(${CMAKE_BINARY_DIR}/_conan_build/conan_toolchain.cmake)
include(${freexl_SOURCE_DIR}/freexl/test_package/build/msvc-194-x86_64-17-${CMAKE_BUILD_TYPE}/generators/conan_toolchain.cmake)

endif()

Expand Down

0 comments on commit 2847f33

Please sign in to comment.