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

[install] Install incorrect pdb name, missing suffix ${CMAKE_DEBUG_POSTFIX} #29

Open
JonLiu1993 opened this issue Feb 25, 2021 · 4 comments · May be fixed by #34 or #40
Open

[install] Install incorrect pdb name, missing suffix ${CMAKE_DEBUG_POSTFIX} #29

JonLiu1993 opened this issue Feb 25, 2021 · 4 comments · May be fixed by #34 or #40

Comments

@JonLiu1993
Copy link

Hi guys,
Today, I'm updating libraw in vcpkg, but some errors occurred during the installation process:

CMake Error at cmake_install.cmake:66 (file):
  file INSTALL cannot find
  "F:/vcpkg/buildtrees/libraw/x86-windows-dbg/raw.pdb": File exists.

After checking the generated files, I found that the pdb file "raw.pdb" does not exist in the debug folder. Instead, I found the file rawd.pdb.
So I checked the CMakeLists.txt:

LibRaw-cmake/CMakeLists.txt

Lines 108 to 110 in 5d54a89

IF(WIN32 AND NOT DEFINED CMAKE_DEBUG_POSTFIX)
SET(CMAKE_DEBUG_POSTFIX "d")
ENDIF()

When we set CMAKE_DEBUG_POSTFIX here, the target output name will always add the suffix d. The resulting pdb file is rawd/raw_rd instead of raw/raw_r.

So here:

LibRaw-cmake/CMakeLists.txt

Lines 623 to 632 in 5d54a89

IF(MSVC)
INSTALL(FILES ${PROJECT_BINARY_DIR}/raw.pdb
DESTINATION lib
CONFIGURATIONS Debug RelWithDebInfo
)
INSTALL(FILES ${PROJECT_BINARY_DIR}/raw_r.pdb
DESTINATION lib
CONFIGURATIONS Debug RelWithDebInfo
)
ENDIF()

Should be:

IF(MSVC AND BUILD_SHARED_LIBS)
    INSTALL(FILES ${PROJECT_BINARY_DIR}/raw${CMAKE_DEBUG_POSTFIX}.pdb
            DESTINATION lib
            CONFIGURATIONS Debug RelWithDebInfo
           )
    INSTALL(FILES ${PROJECT_BINARY_DIR}/raw_r${CMAKE_DEBUG_POSTFIX}.pdb
            DESTINATION lib
            CONFIGURATIONS Debug RelWithDebInfo
           )
ENDIF()

Thanks,
Jon

@letmaik
Copy link
Collaborator

letmaik commented Feb 25, 2021

Can you submit a PR?

@JonLiu1993
Copy link
Author

@letmaik ,I will submit pr later and link to this issue

@LaurentBerger
Copy link

INSTALL(FILES ${PROJECT_BINARY_DIR}/raw${CMAKE_DEBUG_POSTFIX}.pdb

Is debug folder missing in path?

INSTALL(FILES ${PROJECT_BINARY_DIR}/Debug/raw${CMAKE_DEBUG_POSTFIX}.pdb

@ribtoks
Copy link

ribtoks commented Sep 2, 2023

Yes, I can confirm that debug folder is missing in path too

@ribtoks ribtoks linked a pull request Sep 2, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants