Bernardo A. Rodrigues 4 年前
父节点
当前提交
a852ef82e5
共有 2 个文件被更改,包括 38 次插入0 次删除
  1. +21
    -0
      CMakeLists.txt
  2. +17
    -0
      rpi.cmake

+ 21
- 0
CMakeLists.txt 查看文件

@@ -0,0 +1,21 @@
cmake_minimum_required(VERSION 3.0)

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

# add all the *.c files as sources
FILE(GLOB SRC_FILES ${PROJECT_SOURCE_DIR}/wiringPiD/*.c
${PROJECT_SOURCE_DIR}/wiringPi/*.{c,h}
)

# make this output a shared library (with .so output)
add_library (wiringPi SHARED ${SRC_FILES})

# be sure to include the current source directory for header files
target_include_directories (wiringPi PUBLIC ${PROJECT_SOURCE_DIR}/wiringPi
)

# add the following required libraries:
# Threads, Math, Crypt, and RealTime
target_link_libraries(wiringPi ${CMAKE_THREAD_LIBS_INIT} crypt m rt)

+ 17
- 0
rpi.cmake 查看文件

@@ -0,0 +1,17 @@
# Define our host system
SET(CMAKE_SYSTEM_NAME Linux)
SET(CMAKE_SYSTEM_VERSION 1)

# Define the cross compiler location inside edi
SET(CMAKE_C_COMPILER /usr/bin/arm-linux-gnueabihf-gcc)
SET(CMAKE_CXX_COMPILER /usr/bin/arm-linux-gnueabihf-gcc)

# Define edi sysroot
SET(CMAKE_FIND_ROOT_PATH /)

# Use our definitions for compiler tools
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
# Search for libraries and headers in the target directories only
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
add_definitions(-Wall)

正在加载...
取消
保存