source: branches/smartreader/csctapi/CMakeLists.txt@ 1198

Last change on this file since 1198 was 1198, checked in by rorothetroll, 11 years ago

add -DHAVE_LIBUSB to cflags when the lin if found on OS X

File size: 1.2 KB
Line 
1project (csctapi)
2
3file (GLOB csctapi_srcs "*.c")
4file (GLOB csctapi_hdrs "*.h")
5
6check_include_file ("usb.h" HAVE_LIBUSB)
7if (HAVE_LIBUSB)
8 add_definitions ("-DHAVE_LIBUSB")
9endif (HAVE_LIBUSB)
10
11if (HAVE_LIBUSB)
12 target_link_libraries (${exe_name} usb)
13endif (HAVE_LIBUSB)
14
15if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
16 add_definitions ("-O2 -Winline -Werror -finline-functions -fomit-frame-pointer -s -m32")
17 SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m32" )
18 FIND_PATH( USB_INCLUDE usb.h)
19 if( ${USB_INCLUDE} MATCHES "USB_INCLUDE-NOTFOUND" )
20 set (HAVE_LIBUSB "0")
21 else ( ${USB_INCLUDE} MATCHES "USB_INCLUDE-NOTFOUND" )
22 FIND_LIBRARY (USB_LIBRARY usb)
23 target_link_libraries ( ${exe_name} ${USB_LIBRARY})
24 include_directories( SYSTEM ${USB_INCLUDE} )
25 set (HAVE_LIBUSB "1")
26 add_definitions ("-DHAVE_LIBUSB")
27 endif ( ${USB_INCLUDE} MATCHES "USB_INCLUDE-NOTFOUND" )
28else (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
29 add_definitions ("-O2 -Winline -Werror -finline-functions -fomit-frame-pointer -s")
30endif (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
31
32set (lib_name "csctapi")
33add_library (${lib_name} STATIC ${csctapi_srcs} ${csctapi_hdrs})
34
Note: See TracBrowser for help on using the repository browser.