@@ -22,9 +22,6 @@ if(EMSCRIPTEN)
2222 enable_language (CXX)
2323endif ()
2424
25- # To Auto-determine the installation suffixes
26- include (GNUInstallDirs)
27-
2825# This function generates all the local variables what end up getting written to config.
2926# We use a function as any vars set in this context don't mess with the rest of the file.
3027# e.g. Logging LIBUSB_ENABLE_LOGGING mapps to ENABLE_LOGGING in the config, keeps it clean
@@ -242,33 +239,28 @@ if(LIBUSB_BUILD_EXAMPLES)
242239endif ()
243240
244241if (LIBUSB_INSTALL_TARGETS)
245- if (MSVC )
246- set (LIBUSB_INSTALL_LIBRARY_DIR ${CMAKE_INSTALL_BINDIR} )
247- else ()
248- set (LIBUSB_INSTALL_LIBRARY_DIR ${CMAKE_INSTALL_LIBDIR} )
249- endif ()
250242 install (TARGETS usb-1.0
251243 EXPORT usb-1.0-targets
252- RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
253- LIBRARY DESTINATION ${LIBUSB_INSTALL_LIBRARY_DIR}
254- ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
255244 )
256- install (FILES "${LIBUSB_ROOT} /libusb.h" DESTINATION "${CMAKE_INSTALL_INCLUDEDIR} /libusb-1.0" )
245+
246+ install (FILES "${LIBUSB_ROOT} /libusb.h" DESTINATION "include/libusb-1.0" )
247+
257248 install (EXPORT usb-1.0-targets
258249 FILE libusb-targets.cmake
259250 NAMESPACE libusb::
260251 DESTINATION lib/cmake/libusb
261252 )
262253
263254 include (CMakePackageConfigHelpers)
255+
264256 write_basic_package_version_file(
265257 "${CMAKE_CURRENT_BINARY_DIR} /libusbConfigVersion.cmake"
266258 VERSION ${LIBUSB_VERSION}
267259 COMPATIBILITY SameMajorVersion
268260 )
261+
269262 install (FILES
270263 "${CMAKE_CURRENT_BINARY_DIR} /libusbConfigVersion.cmake"
271264 DESTINATION "${CMAKE_INSTALL_LIBDIR} /cmake/libusb"
272265 )
273- endif ()
274-
266+ endif ()
0 commit comments