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

Proposed fix for issue #1264 #1534

Closed
wants to merge 4 commits into from
Closed

Conversation

ambitslix
Copy link
Contributor

Fixes for issue:
#1264

I agree that my contributions are licensed under the {fmt} license, and agree to future changes to the licensing.

@vitaut
Copy link
Contributor

vitaut commented Jan 25, 2020

Thanks for the PR!

CMakeLists.txt Outdated Show resolved Hide resolved
CMakeLists.txt Outdated
string(TOLOWER ${PROJECT_NAME} PROJECT_NAME_LOWER)
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
get_target_property(_FMT_LIB_POSTFIX ${PROJECT_NAME_LOWER} DEBUG_POSTFIX)
set(FMT_LIB_NAME ${PROJECT_NAME_LOWER}${_FMT_LIB_POSTFIX})
Copy link
Contributor

Choose a reason for hiding this comment

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

I suggest defining FMT_DEBUG_POSTFIX and using it here and to set target postfix in line 177 above instead of getting it from the properties.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Like so?

set(FMT_DEBUG_POSTFIX d)

set_target_properties(fmt PROPERTIES
  OUTPUT_NAME fmt
  VERSION ${FMT_VERSION}
  SOVERSION ${CPACK_PACKAGE_VERSION_MAJOR}
  DEBUG_POSTFIX ${FMT_DEBUG_POSTFIX})

# Configure pkg-config fmt.pc properly
get_target_property(FMT_LIB_NAME fmt OUTPUT_NAME)
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
  set(FMT_LIB_NAME ${FMT_LIB_NAME}${FMT_DEBUG_POSTFIX})
endif()

Copy link
Contributor

Choose a reason for hiding this comment

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

Exactly. This simplifies the logic a bit.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Pushed.

@vitaut
Copy link
Contributor

vitaut commented Jan 27, 2020

Merged in 6c30f41, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants