summaryrefslogtreecommitdiff
path: root/contrib/SDL-3.2.8/src/hidapi/windows/CMakeLists.txt
diff options
context:
space:
mode:
author3gg <3gg@shellblade.net>2025-12-27 12:03:39 -0800
committer3gg <3gg@shellblade.net>2025-12-27 12:03:39 -0800
commit5a079a2d114f96d4847d1ee305d5b7c16eeec50e (patch)
tree8926ab44f168acf787d8e19608857b3af0f82758 /contrib/SDL-3.2.8/src/hidapi/windows/CMakeLists.txt
Initial commit
Diffstat (limited to 'contrib/SDL-3.2.8/src/hidapi/windows/CMakeLists.txt')
-rw-r--r--contrib/SDL-3.2.8/src/hidapi/windows/CMakeLists.txt63
1 files changed, 63 insertions, 0 deletions
diff --git a/contrib/SDL-3.2.8/src/hidapi/windows/CMakeLists.txt b/contrib/SDL-3.2.8/src/hidapi/windows/CMakeLists.txt
new file mode 100644
index 0000000..c8228bc
--- /dev/null
+++ b/contrib/SDL-3.2.8/src/hidapi/windows/CMakeLists.txt
@@ -0,0 +1,63 @@
1list(APPEND HIDAPI_PUBLIC_HEADERS "hidapi_winapi.h")
2
3set(SOURCES
4 hid.c
5 hidapi_cfgmgr32.h
6 hidapi_descriptor_reconstruct.c
7 hidapi_descriptor_reconstruct.h
8 hidapi_hidclass.h
9 hidapi_hidpi.h
10 hidapi_hidsdi.h
11)
12
13if(BUILD_SHARED_LIBS)
14 list(APPEND SOURCES hidapi.rc)
15endif()
16
17add_library(hidapi_winapi
18 ${HIDAPI_PUBLIC_HEADERS}
19 ${SOURCES}
20)
21target_link_libraries(hidapi_winapi
22 PUBLIC hidapi_include
23)
24
25if(NOT BUILD_SHARED_LIBS)
26 target_compile_definitions(hidapi_winapi
27 # prevent marking functions as __declspec(dllexport) for static library build
28 # #480: this should be refactored for v1.0
29 PUBLIC HID_API_NO_EXPORT_DEFINE
30 )
31endif()
32
33set_target_properties(hidapi_winapi
34 PROPERTIES
35 EXPORT_NAME "winapi"
36 OUTPUT_NAME "hidapi"
37 VERSION ${PROJECT_VERSION}
38 PUBLIC_HEADER "${HIDAPI_PUBLIC_HEADERS}"
39)
40
41# compatibility with find_package()
42add_library(hidapi::winapi ALIAS hidapi_winapi)
43# compatibility with raw library link
44add_library(hidapi ALIAS hidapi_winapi)
45
46if(HIDAPI_INSTALL_TARGETS)
47 install(TARGETS hidapi_winapi EXPORT hidapi
48 RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
49 LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
50 ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
51 PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/hidapi"
52 )
53endif()
54
55hidapi_configure_pc("${PROJECT_ROOT}/pc/hidapi.pc.in")
56
57if(HIDAPI_WITH_TESTS)
58 add_subdirectory(test)
59endif()
60
61if(DEFINED HIDAPI_BUILD_PP_DATA_DUMP AND HIDAPI_BUILD_PP_DATA_DUMP)
62 add_subdirectory(pp_data_dump)
63endif()