From a328b57c3c30ca42965d8d098f1d459f9ab10ec7 Mon Sep 17 00:00:00 2001 From: Pcornat Date: Thu, 24 Oct 2024 11:14:17 +0200 Subject: [PATCH] Add assimp --- .gitmodules | 3 +++ CMakeLists.txt | 25 ++++++++++++++++++++----- external/assimp | 1 + 3 files changed, 24 insertions(+), 5 deletions(-) create mode 100644 .gitmodules create mode 160000 external/assimp diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..834c95d --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "external/assimp"] + path = external/assimp + url = https://github.com/assimp/assimp.git diff --git a/CMakeLists.txt b/CMakeLists.txt index a1d25c3..341273e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -45,19 +45,34 @@ if (${ENABLE_COVERAGE}) list(APPEND LINKER_FLAGS gcov) endif () +option(BUILD_SHARED_LIBS "Build package with shared libraries." ON) +option(ASSIMP_NO_EXPORT "Disable Assimp's export functionality." ON) +option(ASSIMP_INSTALL "Disable this if you want to use assimp as a submodule." OFF) +option(ASSIMP_BUILD_ZLIB "Build your own zlib" OFF) +option(ASSIMP_BUILD_TESTS "If the test suite for Assimp is built in addition to the library." OFF) +option(ASSIMP_WARNINGS_AS_ERRORS "Treat all warnings as errors." OFF) +option(ASSIMP_INSTALL_PDB "Install MSVC debug files." OFF) +option(ASSIMP_INJECT_DEBUG_POSTFIX "Inject debug postfix in .a/.so/.dll lib names" OFF) +if (CMAKE_BUILD_TYPE STREQUAL "Debug") + option(ASSIMP_INJECT_DEBUG_POSTFIX "Inject debug postfix in .a/.so/.dll lib names" ON) +else () + option(ASSIMP_INJECT_DEBUG_POSTFIX "Inject debug postfix in .a/.so/.dll lib names" OFF) +endif () +add_subdirectory(external/assimp EXCLUDE_FROM_ALL) + add_executable(LearnGtk4 main.cpp hello_world.cpp hello_world.hpp) -set_target_properties(LearnGtk4 PROPERTIES - CXX_STANDARD 20 +set_target_properties(LearnGtk4 assimp PROPERTIES + CXX_STANDARD 17 CXX_STANDARD_REQUIRED ON CXX_EXTENSIONS OFF INTERPROCEDURAL_OPTIMIZATION ON - UNITY_BUILD ON ) target_compile_definitions(LearnGtk4 PUBLIC $<$:_GLIBCXX_DEBUG>) -target_compile_options(LearnGtk4 PUBLIC ${COMPILE_OPTIONS}) +target_compile_definitions(assimp PUBLIC $<$:_GLIBCXX_DEBUG>) +target_compile_options(LearnGtk4 PUBLIC ${COMPILE_FLAGS}) target_link_options(LearnGtk4 PUBLIC ${LINKER_OPTIONS}) -target_link_libraries(LearnGtk4 PkgConfig::GTKMM4) +target_link_libraries(LearnGtk4 PkgConfig::GTKMM4 assimp) diff --git a/external/assimp b/external/assimp new file mode 160000 index 0000000..f6c6260 --- /dev/null +++ b/external/assimp @@ -0,0 +1 @@ +Subproject commit f6c62605c76001ac37f1d86da9922ef61e65501d