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

macOS: add option to mimic 1.0.0 compatibility version #709

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion mac/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,27 @@ set_target_properties(hidapi_darwin
OUTPUT_NAME "hidapi"
VERSION ${PROJECT_VERSION}
SOVERSION ${PROJECT_VERSION_MAJOR}
MACHO_COMPATIBILITY_VERSION ${PROJECT_VERSION_MAJOR}
FRAMEWORK_VERSION ${PROJECT_VERSION_MAJOR}
PUBLIC_HEADER "${HIDAPI_PUBLIC_HEADERS}"
)

if(NOT CMAKE_VERSION VERSION_LESS 3.17)
option(HIDAPI_USE_LEGACY_COMPATIBILITY_VERSION "Legacy Autotools build system hard-coded 1.0.0 for compatibility version" FALSE)
if(HIDAPI_USE_LEGACY_COMPATIBILITY_VERSION)
# TODO: v1: remove this workaround
set_target_properties(hidapi_darwin
PROPERTIES
MACHO_COMPATIBILITY_VERSION "1.0.0"
MACHO_CURRENT_VERSION "1.0.0"
)
else()
set_target_properties(hidapi_darwin
PROPERTIES
MACHO_COMPATIBILITY_VERSION ${PROJECT_VERSION_MAJOR}
)
endif()
endif()

# compatibility with find_package()
add_library(hidapi::darwin ALIAS hidapi_darwin)
# compatibility with raw library link
Expand Down
Loading