Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
Aug 29, 2024

Conversation

kenichiice
Copy link
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)

Copy link
Member

@kimkulling kimkulling left a comment

Choose a reason for hiding this comment

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

Looks fine, thanks.

Copy link
Member

@kimkulling kimkulling left a comment

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
10 checks passed
@kimkulling
Copy link
Member

Merged, thanks a lot for your contribution.

@kenichiice kenichiice deleted the fix-msvc-install-error branch August 29, 2024 23:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants