Skip to content

Possible malformed output dir string caused by typo in CMakeLists.txt #3373

Description

@nathanjhood

Hi! :)

Found a strange error in the outputted 'cmake_install.cmake', per below screenshot and quote (also visible on the current master branch, where I pulled fmt from a few hours ago);

Screenshot 2023-04-06 075211

Note the additional chars in the red-highlighted directory paths, like unresolved vars...? I believe that Lines 336 - 339 contain an unresolved var;

install(FILES $<TARGET_PDB_FILE:${INSTALL_TARGETS}>
        DESTINATION ${FMT_LIB_DIR} OPTIONAL)
install(FILES "${pkgconfig}" DESTINATION "${FMT_PKGCONFIG_DIR}")

Perhaps the FILES parameter should be resolved again(?):

install(FILES ${$<TARGET_PDB_FILE:${INSTALL_TARGETS}>}
        DESTINATION ${FMT_LIB_DIR} OPTIONAL)
install(FILES "${pkgconfig}" DESTINATION "${FMT_PKGCONFIG_DIR}")

Also, in your root folder 'CMakeLists.txt' on current main branch (lines 240 - 242):

target_include_directories(fmt ${FMT_SYSTEM_HEADERS_ATTRIBUTE} PUBLIC
  $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
  $<INSTALL_INTERFACE:${FMT_INC_DIR}>)

(note the errant closing parenthesis - the final char in the quote).

The same appears for the header-only target:

target_include_directories(fmt-header-only ${FMT_SYSTEM_HEADERS_ATTRIBUTE} INTERFACE
  $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
  $<INSTALL_INTERFACE:${FMT_INC_DIR}>)

Cheers and thanks so much for the awesome lib, and insights into the workings CMake!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions