您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 
 
 

31 行
627 B

  1. # CMakeLists.txt for gpio
  2. cmake_minimum_required(VERSION 3.10)
  3. project(gpio)
  4. find_package(PkgConfig REQUIRED)
  5. pkg_check_modules(libcrypt REQUIRED IMPORTED_TARGET)
  6. find_package(Threads REQUIRED)
  7. # Source files
  8. set(SRC
  9. gpio.c
  10. readall.c
  11. )
  12. # Compiler flags
  13. set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra")
  14. # Add the executable target
  15. add_executable(gpio ${SRC})
  16. # Link the required libraries
  17. target_link_libraries(gpio wiringPi wiringPiDev Threads::Threads m PkgConfig::libcrypt)
  18. # Install the executable
  19. install(TARGETS gpio DESTINATION bin)
  20. # Install man page
  21. install(FILES gpio.1 DESTINATION share/man/man1)