Fetchcontent for assimp

+ Trying to fix windows -.-
This commit is contained in:
Shaun Reed 2023-01-21 08:01:13 -05:00
parent 48719412f2
commit 1333fcc1c2
2 changed files with 33 additions and 4 deletions

View File

@ -35,6 +35,14 @@ jobs:
args: install pkgconfiglite --checksum e87b5ea3c9142256af60f2d5b917aa63b571e6a0 --checksum-type sha1 args: install pkgconfiglite --checksum e87b5ea3c9142256af60f2d5b917aa63b571e6a0 --checksum-type sha1
- name: Build Qtk - name: Build Qtk
if: matrix.os == 'windows-latest'
shell: bash
run: |
cmake -B build/ ${{ matrix.cmake }} -DQTK_UPDATE_SUBMODULES=ON
cmake --build build/
- name: Build Qtk
if: matrix.os != 'windows-latest'
shell: bash shell: bash
run: | run: |
cmake -B build/ ${{ matrix.cmake }} -DQTK_UPDATE_SUBMODULES=ON cmake -B build/ ${{ matrix.cmake }} -DQTK_UPDATE_SUBMODULES=ON
@ -52,6 +60,14 @@ jobs:
path: install/* path: install/*
- name: Package Qtk - name: Package Qtk
if: matrix.os == 'windows-latest'
shell: bash
run: |
cd build/
cmake --build . --target package
- name: Package Qtk
if: matrix.os != 'windows-latest'
shell: bash shell: bash
run: | run: |
cd build/ cd build/
@ -104,6 +120,13 @@ jobs:
sudo apt install libassimp-dev sudo apt install libassimp-dev
- name: Build Qtk - name: Build Qtk
if: matrix.os == 'windows-latest'
shell: bash
run: |
cmake -B build/ ${{ matrix.cmake }} && cmake --build build/
- name: Build Qtk
if: matrix.os != 'windows-latest'
shell: bash shell: bash
run: | run: |
cmake -B build/ ${{ matrix.cmake }} && cmake --build build/ -- -j $(nproc) cmake -B build/ ${{ matrix.cmake }} && cmake --build build/ -- -j $(nproc)

View File

@ -116,12 +116,18 @@ if(NOT Qt6_FOUND)
endif() endif()
# Find Assimp # Find Assimp
set(ASSIMP_BUILD_TESTS OFF)
if(QTK_UPDATE_SUBMODULES) if(QTK_UPDATE_SUBMODULES)
message(STATUS "[Qtk] Updating submodules...") message(STATUS "[Qtk] Updating submodules...")
set(ASSIMP_INSTALL OFF) include(FetchContent)
submodule_update("${CMAKE_CURRENT_SOURCE_DIR}/extern/assimp/assimp/") set(FETCHCONTENT_BASE_DIR ${PROJECT_SOURCE_DIR}/libs CACHE PATH "Missing description." FORCE)
add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/extern/assimp/assimp/") 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() else()
find_package(assimp REQUIRED) find_package(assimp REQUIRED)
endif() endif()