Kiibohd Controller
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

CMakeLists.txt 1.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. ###| CMAKE teensy-loader-cli |###
  2. #
  3. # Jacob Alexander 2014
  4. # Written to replace the pjrc's kludey Makefiles
  5. # (that require hand edits for different platforms)
  6. #
  7. # Released into the Public Domain
  8. #
  9. ###
  10. #| Windows / Cygwin Compatibility options
  11. set( CMAKE_LEGACY_CYGWIN_WIN32 0 )
  12. set( CMAKE_USE_RELATIVE_PATHS 1 )
  13. ###
  14. # Project Description
  15. #
  16. #| Project
  17. project( teensy-loader-cli )
  18. #| Target Name (output name)
  19. set( TARGET teensy-loader-cli )
  20. #| General Settings
  21. cmake_minimum_required( VERSION 2.8 )
  22. ###
  23. # Source Defines
  24. #
  25. #| Sources
  26. set( SRCS
  27. teensy_loader_cli.c
  28. )
  29. ###
  30. # Platform Setup
  31. #
  32. list( APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR} ) # Use local find scripts
  33. #| Linux/Windows - libusb
  34. if( CMAKE_SYSTEM_NAME MATCHES "Linux" OR CMAKE_SYSTEM_NAME MATCHES "CYGWIN" )
  35. # Find libusb (not 1.0)
  36. find_package( LibUSB-1.0 REQUIRED )
  37. # Defines
  38. set( DEFINES -s -DUSE_LIBUSB )
  39. # Include directories
  40. set( INCLUDE_DIRS ${LIBUSB_INCLUDE_DIRS} )
  41. # Libraries
  42. set( LIBS ${LIBUSB_LIBRARIES} )
  43. #| Mac OS X
  44. elseif( CMAKE_SYSTEM_NAME MATCHES "Darwin" )
  45. message( AUTHOR_WARNING "Not Tested...")
  46. # Defines - XXX What is SDK?
  47. set( DEFINES -DUSE_APPLE_IOKIT -isysroot ${SDK} -Wl,-syslibroot,${SDK} -framework IOKit -framework CoreFoundation )
  48. #| BSD - NetBSD and OpenBSD
  49. elseif( CMAKE_SYSTEM_NAME MATCHES "BSD" )
  50. message( AUTHOR_WARNING "Not Tested...")
  51. # Defines
  52. set( DEFINES -s -DUSE_UHID )
  53. #| Unregonized OS
  54. else()
  55. message( FATAL_ERROR "${CMAKE_SYSTEM_NAME}: OS Not Recognized..." )
  56. endif()
  57. ###
  58. # Defines
  59. #
  60. #| Default CFLAGS
  61. set( CFLAGS -O2 -Wall -std=gnu99 )
  62. add_definitions( ${CFLAGS} ${DEFINES} )
  63. ###
  64. # Includes
  65. #
  66. #| Linux
  67. include_directories( ${INCLUDE_DIRS} )
  68. ###
  69. # Build Targets
  70. #
  71. #| Create the executable
  72. add_executable( ${TARGET} ${SRCS} )
  73. #| Link executable
  74. target_link_libraries( ${TARGET} ${LIBS} )