瀏覽代碼

build(wiringpid): added CMakeLists.txt for wiringPiD binary

pull/169/head
Lucino772 2 年之前
父節點
當前提交
eabecec8a3
共有 1 個檔案被更改,包括 30 行新增0 行删除
  1. +30
    -0
      wiringPiD/CMakeLists.txt

+ 30
- 0
wiringPiD/CMakeLists.txt 查看文件

@@ -0,0 +1,30 @@
cmake_minimum_required(VERSION 3.10)

project(wiringPiD VERSION 0.1)
set(TARGET wiringpid)

# Have CMake find pthreads library within our toolchain
set(CMAKE_THREAD_PREFER_PTHREAD TRUE)
find_package(Threads REQUIRED)

# Source Files
set(wiringPiD_src
wiringpid.c network.c runRemote.c daemonise.c
)

# Add library target
add_executable (${TARGET} ${wiringPiD_src})

# Add include directory for wiringPiD
target_include_directories (${TARGET} PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/../wiringPi
${CMAKE_INSTALL_PREFIX}/include)


# Add the following required libraries: wiringPi, wiringPiDev, Threads, Math, Crypt, and RealTime
target_link_directories(${TARGET} PUBLIC ${CMAKE_INSTALL_PREFIX}/lib)
target_link_libraries(${TARGET} wiringPi wiringPiDev ${CMAKE_THREAD_LIBS_INIT} crypt m rt)

# Add install
install(TARGETS ${TARGET} DESTINATION bin)

Loading…
取消
儲存