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.
 
 
 
 
 

61 line
1.5 KiB

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