File tree 1 file changed +17
-1
lines changed 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
21
21
OUTPUT_NAME "hidapi"
22
22
VERSION ${PROJECT_VERSION}
23
23
SOVERSION ${PROJECT_VERSION_MAJOR}
24
- MACHO_COMPATIBILITY_VERSION ${PROJECT_VERSION_MAJOR}
25
24
FRAMEWORK_VERSION ${PROJECT_VERSION_MAJOR}
26
25
PUBLIC_HEADER "${HIDAPI_PUBLIC_HEADERS} "
27
26
)
28
27
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
+
29
45
# compatibility with find_package()
30
46
add_library (hidapi::darwin ALIAS hidapi_darwin)
31
47
# compatibility with raw library link
You can’t perform that action at this time.
0 commit comments