diff --git a/Tools/CMake/Conan.cmake b/Tools/CMake/Conan.cmake index 4ca79047d8..0bbd48eaaf 100644 --- a/Tools/CMake/Conan.cmake +++ b/Tools/CMake/Conan.cmake @@ -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) @@ -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() @@ -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") @@ -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()