Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
 
 
 
 
 

67 wiersze
1.9 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. set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-soname,libwiringPi.so${WIRINGPI_SONAME_SUFFIX}")
  45. # Read version from version.h
  46. file(READ "${CMAKE_CURRENT_SOURCE_DIR}/../version.h" VERSION)
  47. string(REGEX REPLACE ".*VERSION \"([0-9]+.[0-9]+)\".*" "\\1" VERSION "${VERSION}")
  48. # Add the library target
  49. add_library(wiringPi SHARED ${SRC})
  50. # Set the library version
  51. set(WIRINGPI_SONAME_SUFFIX "1")
  52. set_target_properties(wiringPi PROPERTIES VERSION ${VERSION} SOVERSION ${WIRINGPI_SONAME_SUFFIX})
  53. target_include_directories(wiringPi PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
  54. # Add -lm to link with the math library
  55. target_link_libraries(wiringPi PUBLIC m crypt)
  56. # Install headers
  57. install(FILES ${HEADERS} DESTINATION include)
  58. # Install the library
  59. install(TARGETS wiringPi LIBRARY DESTINATION lib)