Skip to content

Fix to correctly determine 'multi-configuration' on Windows - #5720

Merged
kimkulling merged 2 commits into
assimp:masterfrom
kenichiice:fix-msvc-install-error
Aug 29, 2024
Merged

kimkulling merged 2 commits into
assimp:masterfrom
kenichiice:fix-msvc-install-error

Conversation

@kenichiice

Copy link
Copy Markdown
Contributor

Probrem

An error occurs during the build and installation on Windows with the BUILD_SHARED_LIBS option set to OFF because assimp-vc143-mtd.pdb cannot be found.

Cause

Seems to be caused by an error in the following if command in code/CMakeLists.txt.

IF(GENERATOR_IS_MULTI_CONFIG)

Since GENERATOR_IS_MULTI_CONFIG is a property, not a variable, it doesn't work correctly when specified directly in the if command.

Solution

The value of GENERATOR_IS_MULTI_CONFIG is assigned to the variable is_multi_config elsewhere. This PR resolves the probrem by using the value of this variable.

Command line

The command line that results in a installation error is shown below.

c:\Users\kenic\Documents\dev\assimp>mkdir build

c:\Users\kenic\Documents\dev\assimp>cd build

c:\Users\kenic\Documents\dev\assimp\build>cmake .. -DBUILD_SHARED_LIBS=OFF
-- Building for: Visual Studio 17 2022
-- Selecting Windows SDK version 10.0.22621.0 to target Windows 10.0.22631.
-- The C compiler identification is MSVC 19.41.34120.0
-- The CXX compiler identification is MSVC 19.41.34120.0
<<snip>>
-- Configuring done (5.7s)
-- Generating done (0.1s)
-- Build files have been written to: C:/Users/kenic/Documents/dev/assimp/build

c:\Users\kenic\Documents\dev\assimp\build>cmake --build . --config Debug
MSBuild version 17.11.2+c078802d4 for .NET Framework

  1>Checking Build System
  Building Custom Rule C:/Users/kenic/Documents/dev/assimp/contrib/zlib/CMakeLists.txt
  adler32.c
<<snip>>
  gtest-all.cc
  unit.vcxproj -> C:\Users\kenic\Documents\dev\assimp\build\bin\Debug\unit.exe
  Building Custom Rule C:/Users/kenic/Documents/dev/assimp/CMakeLists.txt

c:\Users\kenic\Documents\dev\assimp\build>cmake --install . --config Debug --prefix out
-- Installing: C:/Users/kenic/Documents/dev/assimp/build/out/lib/cmake/assimp-5.4/assimpConfig.cmake
<<snip>>
-- Installing: C:/Users/kenic/Documents/dev/assimp/build/out/include/assimp/Compiler/pstdint.h
CMake Error at code/cmake_install.cmake:148 (file):
  file INSTALL cannot find
  "C:/Users/kenic/Documents/dev/assimp/build/code/assimp-vc143-mtd.pdb": File
  exists.
Call Stack (most recent call first):
  cmake_install.cmake:81 (include)

@kimkulling kimkulling left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine, thanks.

@kimkulling kimkulling left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine.

@kimkulling
kimkulling merged commit 11daaf7 into assimp:master Aug 29, 2024
@kimkulling

Copy link
Copy Markdown
Member

Merged, thanks a lot for your contribution.

@kenichiice
kenichiice deleted the fix-msvc-install-error branch August 29, 2024 23:53
kimkulling added a commit that referenced this pull request Jul 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

2 participants