set(GPIO gpio) include_directories(${CMAKE_CURRENT_SOURCE_DIR}) add_library(${GPIO}Obj OBJECT gpio.c readall.c OrangePi.c) add_library(${GPIO} STATIC $) add_library(${GPIO}shared SHARED $) set_target_properties(${GPIO}shared PROPERTIES OUTPUT_NAME ${GPIO}) install(TARGETS ${GPIO} ${GPIO}shared RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib)