From 8b9ed34eaa3e6ad24254cb7e058fb9150f66b865 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Sun, 7 Apr 2024 22:14:12 +0100 Subject: [PATCH] Update CMakeLists.txt (#5531) * Update CMakeLists.txt * Update Version.cpp * Update CMakeLists.txt Update minimum version of cmake * Update utVersion.cpp Adapt unittest --- CMakeLists.txt | 24 ++++++++++++------------ code/CMakeLists.txt | 2 +- code/Common/Version.cpp | 2 +- test/unit/utVersion.cpp | 10 +++++----- 4 files changed, 19 insertions(+), 19 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a19bad32e..31c5e6615 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -38,9 +38,9 @@ SET(CMAKE_POLICY_DEFAULT_CMP0012 NEW) SET(CMAKE_POLICY_DEFAULT_CMP0074 NEW) SET(CMAKE_POLICY_DEFAULT_CMP0092 NEW) -CMAKE_MINIMUM_REQUIRED( VERSION 3.10 ) +CMAKE_MINIMUM_REQUIRED( VERSION 3.22 ) -# Disabled importers: m3d for 5.1 +# Disabled importers: m3d for 5.1 or later ADD_DEFINITIONS( -DASSIMP_BUILD_NO_M3D_IMPORTER) ADD_DEFINITIONS( -DASSIMP_BUILD_NO_M3D_EXPORTER) # Toggles the use of the hunter package manager @@ -55,7 +55,7 @@ IF(ASSIMP_HUNTER_ENABLED) add_definitions(-DASSIMP_USE_HUNTER) ENDIF() -PROJECT(Assimp VERSION 5.3.0) +PROJECT(Assimp VERSION 5.4.0) # All supported options ############################################### @@ -131,18 +131,18 @@ OPTION ( ASSIMP_IGNORE_GIT_HASH IF (WIN32) OPTION( ASSIMP_BUILD_ZLIB - "Build your own zlib" + "Build your zlib" ON ) ELSE() OPTION( ASSIMP_BUILD_ZLIB - "Build your own zlib" + "Build your zlib" OFF ) ENDIF() IF (WIN32) - # Use subset of Windows.h + # Use a subset of Windows.h ADD_DEFINITIONS( -DWIN32_LEAN_AND_MEAN ) IF(MSVC) @@ -150,16 +150,16 @@ IF (WIN32) "Install MSVC debug files." ON ) IF(NOT (MSVC_VERSION LESS 1900)) - # Multibyte character set is deprecated since at least MSVC2015 (possibly earlier) + # Multibyte character set has been deprecated since at least MSVC2015 (possibly earlier) ADD_DEFINITIONS( -DUNICODE -D_UNICODE ) ENDIF() - # Link statically against c/c++ lib to avoid missing redistriburable such as + # Link statically against c/c++ lib to avoid missing redistributable such as # "VCRUNTIME140.dll not found. Try reinstalling the app.", but give users # a choice to opt for the shared runtime if they want. option(USE_STATIC_CRT "Link against the static runtime libraries." OFF) - # The CMAKE_CXX_FLAGS vars can be overriden by some Visual Studio generators, so we use an alternative + # The CMAKE_CXX_FLAGS vars can be overridden by some Visual Studio generators, so we use an alternative # global method here: if (${USE_STATIC_CRT}) add_compile_options( @@ -249,9 +249,9 @@ SET(ASSIMP_LIBRARY_SUFFIX "" CACHE STRING "Suffix to append to library names") IF( UNIX ) # Use GNUInstallDirs for Unix predefined directories INCLUDE(GNUInstallDirs) - # Ensure that we do not run into issues like http://www.tcm.phy.cam.ac.uk/sw/inodes64.html on 32 bit linux + # Ensure that we do not run into issues like http://www.tcm.phy.cam.ac.uk/sw/inodes64.html on 32 bit Linux IF(NOT ${OPERATING_SYSTEM} MATCHES "Android") - IF ( CMAKE_SIZEOF_VOID_P EQUAL 4) # only necessary for 32-bit linux + IF ( CMAKE_SIZEOF_VOID_P EQUAL 4) # only necessary for 32-bit Linux ADD_DEFINITIONS(-D_FILE_OFFSET_BITS=64 ) ENDIF() ENDIF() @@ -289,7 +289,7 @@ ELSEIF(MSVC) IF(MSVC12) ADD_COMPILE_OPTIONS(/wd4351) ENDIF() - # supress warning for double to float conversion if Double precission is activated + # supress warning for double to float conversion if Double precision is activated ADD_COMPILE_OPTIONS(/wd4244) SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /D_DEBUG /Zi /Od") SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}") diff --git a/code/CMakeLists.txt b/code/CMakeLists.txt index 28e2d40c6..0a7be6247 100644 --- a/code/CMakeLists.txt +++ b/code/CMakeLists.txt @@ -42,7 +42,7 @@ # 3) Add libassimp using the file lists (eliminates duplication of file names between # source groups and library command) # -cmake_minimum_required( VERSION 3.10 ) +cmake_minimum_required( VERSION 3.22 ) SET( HEADER_PATH ../include/assimp ) if(NOT ANDROID AND ASSIMP_ANDROID_JNIIOSYSTEM) diff --git a/code/Common/Version.cpp b/code/Common/Version.cpp index 24a5f5250..10ccf58e7 100644 --- a/code/Common/Version.cpp +++ b/code/Common/Version.cpp @@ -52,7 +52,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. static constexpr char LEGAL_INFORMATION[] = "Open Asset Import Library (Assimp).\n" "A free C/C++ library to import various 3D file formats into applications\n\n" - "(c) 2006-2023, Assimp team\n" + "(c) 2006-2024, Assimp team\n" "License under the terms and conditions of the 3-clause BSD license\n" "https://www.assimp.org\n"; diff --git a/test/unit/utVersion.cpp b/test/unit/utVersion.cpp index bba97a135..838d2dd7f 100644 --- a/test/unit/utVersion.cpp +++ b/test/unit/utVersion.cpp @@ -48,18 +48,18 @@ TEST_F( utVersion, aiGetLegalStringTest ) { EXPECT_NE( lv, nullptr ); std::string text( lv ); - size_t pos = text.find(std::string("2023")); + size_t pos = text.find(std::string("2024")); EXPECT_NE(pos, std::string::npos); } -TEST_F( utVersion, aiGetVersionMinorTest ) { - EXPECT_EQ(aiGetVersionMinor(), 3U); -} - TEST_F( utVersion, aiGetVersionMajorTest ) { EXPECT_EQ( aiGetVersionMajor(), 5U ); } +TEST_F( utVersion, aiGetVersionMinorTest ) { + EXPECT_EQ(aiGetVersionMinor(), 4U); +} + TEST_F( utVersion, aiGetVersionPatchTest ) { EXPECT_EQ(aiGetVersionPatch(), 0U ); }