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.
 
 
 
 
 

59 lines
1.6 KiB

  1. # CMakeLists.txt for wiringPi
  2. project(WiringPi)
  3. # Source files
  4. set(SRC
  5. wiringPi.c
  6. wiringSerial.c wiringShift.c
  7. piHiPri.c piThread.c
  8. wiringPiSPI.c wiringPiI2C.c
  9. softPwm.c softTone.c
  10. mcp23008.c mcp23016.c mcp23017.c
  11. mcp23s08.c mcp23s17.c
  12. sr595.c
  13. pcf8574.c pcf8591.c
  14. mcp3002.c mcp3004.c mcp4802.c mcp3422.c
  15. max31855.c max5322.c ads1115.c
  16. sn3218.c
  17. bmp180.c htu21d.c ds18b20.c rht03.c
  18. drcSerial.c drcNet.c
  19. pseudoPins.c
  20. wpiExtensions.c
  21. wiringPiLegacy.c
  22. )
  23. # Headers
  24. set(HEADERS
  25. wiringPi.h
  26. wiringSerial.h wiringShift.h
  27. wiringPiSPI.h wiringPiI2C.h
  28. softPwm.h softTone.h
  29. mcp23008.h mcp23016.h mcp23017.h
  30. mcp23s08.h mcp23s17.h
  31. sr595.h
  32. pcf8574.h pcf8591.h
  33. mcp3002.h mcp3004.h mcp4802.h mcp3422.h
  34. max31855.h max5322.h ads1115.h
  35. sn3218.h
  36. bmp180.h htu21d.h ds18b20.h rht03.h
  37. drcSerial.h drcNet.h
  38. pseudoPins.h
  39. wpiExtensions.h
  40. )
  41. # Compiler flags
  42. set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wformat=2 -Winline -pipe -Wformat-security")
  43. # Add the library target
  44. add_library(wiringPi SHARED ${SRC})
  45. # Set the library version
  46. set_target_properties(wiringPi PROPERTIES VERSION ${WIRINGPI_VERSION} SOVERSION ${WIRINGPI_VERSION_MAJOR})
  47. target_include_directories(wiringPi PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
  48. # Add -lm to link with the math library
  49. target_link_libraries(wiringPi PUBLIC m crypt)
  50. # Install headers
  51. install(FILES ${HEADERS} DESTINATION include COMPONENT Development)
  52. # Install the library
  53. install(TARGETS wiringPi LIBRARY DESTINATION lib COMPONENT Runtime NAMELINK_COMPONENT Development)