File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed
Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -21,11 +21,27 @@ set_target_properties(hidapi_darwin
2121 OUTPUT_NAME "hidapi"
2222 VERSION ${PROJECT_VERSION}
2323 SOVERSION ${PROJECT_VERSION_MAJOR}
24- MACHO_COMPATIBILITY_VERSION ${PROJECT_VERSION_MAJOR}
2524 FRAMEWORK_VERSION ${PROJECT_VERSION_MAJOR}
2625 PUBLIC_HEADER "${HIDAPI_PUBLIC_HEADERS} "
2726)
2827
28+ if (NOT CMAKE_VERSION VERSION_LESS 3.17)
29+ option (HIDAPI_USE_LEGACY_COMPATIBILITY_VERSION "Legacy Autotools build system hard-coded 1.0.0 for compatibility version" FALSE )
30+ if (HIDAPI_USE_LEGACY_COMPATIBILITY_VERSION)
31+ # TODO: v1: remove this workaround
32+ set_target_properties (hidapi_darwin
33+ PROPERTIES
34+ MACHO_COMPATIBILITY_VERSION "1.0.0"
35+ MACHO_CURRENT_VERSION "1.0.0"
36+ )
37+ else ()
38+ set_target_properties (hidapi_darwin
39+ PROPERTIES
40+ MACHO_COMPATIBILITY_VERSION ${PROJECT_VERSION_MAJOR}
41+ )
42+ endif ()
43+ endif ()
44+
2945# compatibility with find_package()
3046add_library (hidapi::darwin ALIAS hidapi_darwin)
3147# compatibility with raw library link
You can’t perform that action at this time.
0 commit comments