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

Bug: With MSVC, the samples will always prefer freeglut.lib even with a debug build #5758

Open
PavelSharp opened this issue Sep 5, 2024 · 0 comments
Labels
Bug Global flag to mark a deviation from expected behaviour

Comments

@PavelSharp
Copy link

PavelSharp commented Sep 5, 2024

Describe the bug
A clear and concise description of what the bug is.
Files such as SimpleOpenGL/CMakeLists.txt and SimpleTexturedOpenGL/CMakeLists.txt contain are very similar section of code which seems to have an inaccuracy.
Consider

FIND_PACKAGE(GLUT)

IF ( NOT GLUT_FOUND )
  IF ( MSVC )
    SET ( GLUT_FOUND 1 )
    SET ( GLUT_INCLUDE_DIR ${Assimp_SOURCE_DIR}/samples/freeglut/ )
    SET ( GLUT_LIBRARIES ${Assimp_SOURCE_DIR}/samples/freeglut/lib/freeglut.lib )
  ELSE ()
    MESSAGE( WARNING "Please install glut." )
  ENDIF ()
ENDIF ()

Suppose we are starting a DEBUG(i.e. CMAKE_BUILD_TYPE = Debug) build in Windows using the MSVC compiler. This causes the assimp library to use a debugging runtime-library. However, by default, freeglut.lib prefer release runtime library.

To Reproduce
Steps to reproduce the behavior:

  1. Download assimp
  2. Download and build freeglut (with Debug and Release) and install both version in assimp/samples/freeglut
  3. Build assimp with the -DASSIMP_BUILD_SAMPLES=ON in Debug mode

Expected behavior
The CMakeLists.txt of these samples must automatically choose between freeglut.lib and freeglutd.lib

Platform (please complete the following information):

  • Windows, MSVC

Additional context
In general, according to my opinion, it all looks wierd. Because, FindGLUT.cmake, trying to find glut.h but these samples use freeglut.h. Am I missing something?

@PavelSharp PavelSharp added the Bug Global flag to mark a deviation from expected behaviour label Sep 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Global flag to mark a deviation from expected behaviour
Projects
None yet
Development

No branches or pull requests

1 participant