Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.
 
 
 
 
 

32 Zeilen
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)