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.
 
 
 
 
 

29 lines
625 B

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