Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.
 
 
 
 
 

32 righe
975 B

  1. cmake_minimum_required(VERSION 3.10)
  2. project(gpio VERSION 0.1)
  3. set(TARGET gpio)
  4. # Have CMake find pthreads library within our toolchain
  5. set(CMAKE_THREAD_PREFER_PTHREAD TRUE)
  6. find_package(Threads REQUIRED)
  7. # Source Files
  8. set(gpio_src
  9. gpio.c readall.c
  10. )
  11. # Add library target
  12. add_executable (${TARGET} ${gpio_src})
  13. # Add include directory for gpio
  14. target_include_directories (${TARGET} PUBLIC
  15. ${CMAKE_CURRENT_SOURCE_DIR}
  16. ${CMAKE_CURRENT_SOURCE_DIR}/../wiringPiDev
  17. ${CMAKE_CURRENT_SOURCE_DIR}/../wiringPi
  18. ${CMAKE_INSTALL_PREFIX}/include)
  19. # Add the following required libraries: wiringPi, wiringPiDev, Threads, Math, Crypt, and RealTime
  20. target_link_directories(${TARGET} PUBLIC ${CMAKE_INSTALL_PREFIX}/lib)
  21. target_link_libraries(${TARGET} wiringPi wiringPiDev ${CMAKE_THREAD_LIBS_INIT} crypt m rt)
  22. # Add install
  23. install(TARGETS ${TARGET} DESTINATION bin)