diff options
author | Vitali Lovich <vlovich@aliph.com> | 2011-09-06 11:46:00 +0100 |
---|---|---|
committer | Vitali Lovich <vlovich@aliph.com> | 2011-09-06 12:18:58 +0100 |
commit | a6479690a3717bc53e62614a68f063e315a50c08 (patch) | |
tree | d3dcdd4b7d4a437ea430db943eb8c9a26542be02 /examples | |
parent | 4504b66235e179276ad0bf30432eae7fd300d578 (diff) | |
download | libusb-a6479690a3717bc53e62614a68f063e315a50c08.tar.gz |
[contrib] add non-officially supported CMake support
Diffstat (limited to 'examples')
-rw-r--r-- | examples/CMakeLists.txt | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt new file mode 100644 index 0000000..d73d729 --- /dev/null +++ b/examples/CMakeLists.txt @@ -0,0 +1,27 @@ +include(CheckFunctionExists) +include(FindThreads) + +check_function_exists(sigaction HAVE_SIGACTION) + +if (WITH_SHARED) + set(LIBUSB_LIBRARY usb-1.0) +else() + set(LIBUSB_LIBRARY usb-1.0-static) +endif() + +include_directories(../libusb) + +add_executable(lsusb lsusb.c) +target_link_libraries(lsusb ${LIBUSB_LIBRARY}) +add_executable(xusb xusb.c) +target_link_libraries(xusb ${LIBUSB_LIBRARY}) + +if (HAVE_SIGACTION) + add_executable(dpfp dpfp.c) + target_link_libraries(dpfp ${LIBUSB_LIBRARY}) + + if (CMAKE_USE_PTHREADS_INIT) + add_executable(dpfp_threaded dpfp_threaded.c) + target_link_libraries(dpfp_threaded ${LIBUSB_LIBRARY}) + endif() +endif() |