Changeset 1132


Ignore:
Timestamp:
01/08/10 22:57:14 (12 years ago)
Author:
rorothetroll
Message:

fix the CMakelist.txt to properly detect libusb on OS X and linux

Location:
branches/smartreader
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/smartreader/CMakeLists.txt

    r1128 r1132  
    5555        set (CS_OS_HW "mac")
    5656        set (CS_OS_SYS "macosx")
     57        SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m32" )
     58        SET( CMAKE_CFLAGS "${CMAKE_CFLAGS} -m32" )
    5759    elseif (${CYGWIN})
    5860        set (OSCamOperatingSystem "Windows/Cygwin")
     
    139141if (HAVE_LIBUSB)
    140142    add_definitions ("-DHAVE_LIBUSB")
    141     add_definitions ("`libusb-config --cflags`")
     143elseif (HAVE_USB)
     144    message(STATUS "  no libusb found. No smartreader ")
    142145endif (HAVE_LIBUSB)
    143146
     
    214217    if( ${USB_INCLUDE} MATCHES "USB_INCLUDE-NOTFOUND" )
    215218        set (HAVE_LIBUSB "0")
    216         message (STATUS "libusb usb.h include not found .. no smartreader support")
     219        message (STATUS "OS X libusb includes not found .. no smartreader support")
    217220    else ( ${USB_INCLUDE} MATCHES "USB_INCLUDE-NOTFOUND" )
    218         message (STATUS "libusb usb.h include : ${USB_INCLUDE}")
     221        message (STATUS "OS X libusb include : ${USB_INCLUDE}")
    219222        FIND_LIBRARY (USB_LIBRARY usb)
    220223        message (STATUS "OS X libusb : ${USB_LIBRARY}")
    221            target_link_libraries ( ${exe_name} ${USB_LIBRARY})
    222            include_directories( SYSTEM ${USB_INCLUDE} )
     224        target_link_libraries ( ${exe_name} ${USB_LIBRARY})
     225        include_directories( SYSTEM ${USB_INCLUDE})
    223226        set (HAVE_LIBUSB "1")
    224227    endif ( ${USB_INCLUDE} MATCHES "USB_INCLUDE-NOTFOUND" )
    225     message(STATUS "include dirs : ${INCLUDE_DIRECTORIES}")
    226    
    227228elseif (OSCamOperatingSystem MATCHES "Tuxbox")
    228229    target_link_libraries ( ${exe_name} dl)
  • branches/smartreader/csctapi/CMakeLists.txt

    r1128 r1132  
    44file (GLOB csctapi_hdrs "*.h")
    55
     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
    615if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
    7 add_definitions ("-O2 -Winline -Werror -finline-functions -fomit-frame-pointer -s -m32")
     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    endif ( ${USB_INCLUDE} MATCHES "USB_INCLUDE-NOTFOUND" )
    827else (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
    9 add_definitions ("-O2 -Winline -Werror -finline-functions -fomit-frame-pointer -s")
     28    add_definitions ("-O2 -Winline -Werror -finline-functions -fomit-frame-pointer -s")
    1029endif (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
    1130
    12 FIND_PATH( USB_INCLUDE usb.h)
    13 if( ${USB_INCLUDE} MATCHES "USB_INCLUDE-NOTFOUND" )
    14     set (HAVE_LIBUSB "0")
    15     message (STATUS "libusb usb.h include not found .. no smartreader support")
    16 else ( ${USB_INCLUDE} MATCHES "USB_INCLUDE-NOTFOUND" )
    17     message (STATUS "libusb usb.h include : ${USB_INCLUDE}")
    18     FIND_LIBRARY (USB_LIBRARY usb)
    19     message (STATUS "OS X libusb : ${USB_LIBRARY}")
    20        target_link_libraries ( ${exe_name} ${USB_LIBRARY})
    21        include_directories( SYSTEM ${USB_INCLUDE} )
    22     set (HAVE_LIBUSB "1")
    23 endif ( ${USB_INCLUDE} MATCHES "USB_INCLUDE-NOTFOUND" )
    24 message(STATUS "include dirs : ${INCLUDE_DIRECTORIES}")
    25 
    2631set (lib_name "csctapi")
    27 
    2832add_library (${lib_name} STATIC ${csctapi_srcs} ${csctapi_hdrs})
    2933
Note: See TracChangeset for help on using the changeset viewer.