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.
 
 
 
 
 

38 regels
1.0 KiB

  1. cmake_minimum_required(VERSION 3.10)
  2. project(wiringPiDev VERSION 0.1)
  3. set(TARGET wiringPiDev)
  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(wiringPiDev_src
  9. ds1302.c maxdetect.c piNes.c gertboard.c
  10. piFace.c lcd128x64.c lcd.c scrollPhat.c
  11. piGlow.c
  12. )
  13. # Headers file
  14. set(wiringPiDev_h
  15. ds1302.h gertboard.h lcd128x64.h lcd.h maxdetect.h
  16. piFace.h piGlow.h piNes.h scrollPhat.h
  17. )
  18. # Add library target
  19. add_library (${TARGET} SHARED ${wiringPiDev_src})
  20. # Add include directory for wiringPiDev
  21. target_include_directories (${TARGET} PUBLIC
  22. ${CMAKE_CURRENT_SOURCE_DIR}
  23. ${CMAKE_CURRENT_SOURCE_DIR}/../wiringPi
  24. ${CMAKE_INSTALL_PREFIX}/include)
  25. # Add the following required libraries: Threads
  26. target_link_libraries(${TARGET} ${CMAKE_THREAD_LIBS_INIT})
  27. # Add install
  28. install(TARGETS ${TARGET} DESTINATION lib)
  29. install(FILES ${wiringPiDev_h} DESTINATION include)