From 720cf9f0ff68328309974534be625aded7eb4616 Mon Sep 17 00:00:00 2001 From: Shaun Reed Date: Sat, 21 Jan 2023 08:01:13 -0500 Subject: [PATCH] Fetchcontent for assimp + Trying to fix windows -.- --- .github/workflows/all-builds.yml | 23 +++++++++++++++++++++++ CMakeLists.txt | 14 ++++++++++---- 2 files changed, 33 insertions(+), 4 deletions(-) diff --git a/.github/workflows/all-builds.yml b/.github/workflows/all-builds.yml index 01ff4ef..17ca56f 100644 --- a/.github/workflows/all-builds.yml +++ b/.github/workflows/all-builds.yml @@ -35,6 +35,14 @@ jobs: args: install pkgconfiglite --checksum e87b5ea3c9142256af60f2d5b917aa63b571e6a0 --checksum-type sha1 - name: Build Qtk + if: matrix.os == 'windows-latest' + shell: bash + run: | + cmake -B build/ ${{ matrix.cmake }} -DQTK_UPDATE_SUBMODULES=ON + cmake --build build/ -- /m + + - name: Build Qtk + if: matrix.os != 'windows-latest' shell: bash run: | cmake -B build/ ${{ matrix.cmake }} -DQTK_UPDATE_SUBMODULES=ON @@ -52,6 +60,14 @@ jobs: path: install/* - name: Package Qtk + if: matrix.os == 'windows-latest' + shell: bash + run: | + cd build/ + cmake --build . --target package -- /m + + - name: Package Qtk + if: matrix.os != 'windows-latest' shell: bash run: | cd build/ @@ -104,6 +120,13 @@ jobs: sudo apt install libassimp-dev - name: Build Qtk + if: matrix.os == 'windows-latest' + shell: bash + run: | + cmake -B build/ ${{ matrix.cmake }} && cmake --build build/ -- /m + + - name: Build Qtk + if: matrix.os != 'windows-latest' shell: bash run: | cmake -B build/ ${{ matrix.cmake }} && cmake --build build/ -- -j $(nproc) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5fae330..ff7e9fc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -116,12 +116,18 @@ if(NOT Qt6_FOUND) endif() # Find Assimp -set(ASSIMP_BUILD_TESTS OFF) if(QTK_UPDATE_SUBMODULES) message(STATUS "[Qtk] Updating submodules...") - set(ASSIMP_INSTALL OFF) - submodule_update("${CMAKE_CURRENT_SOURCE_DIR}/extern/assimp/assimp/") - add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/extern/assimp/assimp/") + include(FetchContent) + set(FETCHCONTENT_BASE_DIR ${PROJECT_SOURCE_DIR}/libs CACHE PATH "Missing description." FORCE) + FetchContent_Declare(assimp + GIT_REPOSITORY https://github.com/assimp/assimp.git + GIT_TAG master) + set(BUILD_SHARED_LIBS OFF CACHE BOOL "" FORCE) + set(ASSIMP_BUILD_TESTS OFF CACHE BOOL "" FORCE) + set(ASSIMP_INJECT_DEBUG_POSTFIX OFF CACHE BOOL "" FORCE) + set(ASSIMP_INSTALL OFF CACHE BOOL "" FORCE) + FetchContent_MakeAvailable(assimp) else() find_package(assimp REQUIRED) endif()