diff options
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.txt | 63 |
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 @@ | |||
| 1 | list(APPEND HIDAPI_PUBLIC_HEADERS "hidapi_winapi.h") | ||
| 2 | |||
| 3 | set(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 | |||
| 13 | if(BUILD_SHARED_LIBS) | ||
| 14 | list(APPEND SOURCES hidapi.rc) | ||
| 15 | endif() | ||
| 16 | |||
| 17 | add_library(hidapi_winapi | ||
| 18 | ${HIDAPI_PUBLIC_HEADERS} | ||
| 19 | ${SOURCES} | ||
| 20 | ) | ||
| 21 | target_link_libraries(hidapi_winapi | ||
| 22 | PUBLIC hidapi_include | ||
| 23 | ) | ||
| 24 | |||
| 25 | if(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 | ) | ||
| 31 | endif() | ||
| 32 | |||
| 33 | set_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() | ||
| 42 | add_library(hidapi::winapi ALIAS hidapi_winapi) | ||
| 43 | # compatibility with raw library link | ||
| 44 | add_library(hidapi ALIAS hidapi_winapi) | ||
| 45 | |||
| 46 | if(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 | ) | ||
| 53 | endif() | ||
| 54 | |||
| 55 | hidapi_configure_pc("${PROJECT_ROOT}/pc/hidapi.pc.in") | ||
| 56 | |||
| 57 | if(HIDAPI_WITH_TESTS) | ||
| 58 | add_subdirectory(test) | ||
| 59 | endif() | ||
| 60 | |||
| 61 | if(DEFINED HIDAPI_BUILD_PP_DATA_DUMP AND HIDAPI_BUILD_PP_DATA_DUMP) | ||
| 62 | add_subdirectory(pp_data_dump) | ||
| 63 | endif() | ||
