Skip to content

Commit

Permalink
plugins/udmx: fix Windows build
Browse files Browse the repository at this point in the history
  • Loading branch information
mcallegari committed Nov 5, 2023
1 parent 76fff86 commit 5ba3e34
Showing 1 changed file with 11 additions and 21 deletions.
32 changes: 11 additions & 21 deletions plugins/udmx/src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
find_package(PkgConfig REQUIRED)

set(module_name "udmx")

set(TS_FILES
Expand All @@ -19,10 +21,7 @@ else()
qt5_add_translation(QM_FILES ${TS_FILES})
endif()

add_library(${module_name}
SHARED
${QM_FILES}
)
add_library(${module_name} SHARED ${QM_FILES})

target_sources(${module_name} PRIVATE
../../interfaces/qlcioplugin.cpp ../../interfaces/qlcioplugin.h
Expand All @@ -38,25 +37,16 @@ target_link_libraries(${module_name} PRIVATE
Qt${QT_MAJOR_VERSION}::Widgets
)

if(WIN32)
target_sources(${module_name} PRIVATE
libusb_dyn.c libusb_dyn.h
)
else()
target_sources(${module_name} PRIVATE
${module_name}.cpp ${module_name}.h
udmxdevice.cpp udmxdevice.h
)
endif()
target_sources(${module_name} PRIVATE
${module_name}.cpp ${module_name}.h
udmxdevice.cpp udmxdevice.h
)

if(${LIBUSB_1_FOUND})
target_include_directories(${module_name} PRIVATE
${LIBUSB_1_INCLUDE_DIRS}
)
pkg_check_modules(LIBUSB1 IMPORTED_TARGET libusb-1.0)

target_link_libraries(${module_name} PRIVATE
${LIBUSB_1_LINK_LIBRARIES}
)
if(${LIBUSB1_FOUND})
target_include_directories(${module_name} PRIVATE ${LIBUSB_1_INCLUDE_DIRS})
target_link_libraries(${module_name} PRIVATE ${LIBUSB_1_LINK_LIBRARIES})
endif()

install(TARGETS ${module_name}
Expand Down

0 comments on commit 5ba3e34

Please sign in to comment.