Skip to content

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

@JonLiu1993

Description

@JonLiu1993

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions