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.
99 lines
2.5 KiB
99 lines
2.5 KiB
3 years ago
|
cmake_minimum_required(VERSION 3.15.0)
|
||
|
|
||
|
set(CMAKE_TOOLCHAIN_FILE cmake/toolchain.cmake)
|
||
|
|
||
|
file (STRINGS "VERSION" BUILD_VERSION)
|
||
|
project(wiringOP VERSION ${BUILD_VERSION})
|
||
|
|
||
|
#include(ExternalProject)
|
||
|
|
||
|
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
|
||
|
|
||
|
SET(CMAKE_C_FLAGS "-Wformat=2 -Wextra -Winline -pipe -fPIC")
|
||
|
|
||
|
if("a${BOARD}" STREQUAL "a")
|
||
|
set(BOARD orangepioneplus-h6)
|
||
|
endif()
|
||
|
|
||
|
if(BOARD STREQUAL "orangepi2giot")
|
||
|
add_definitions(-DCONFIG_ORANGEPI_2G_IOT)
|
||
|
endif()
|
||
|
|
||
|
if(BOARD STREQUAL "orangepipc2-h5")
|
||
|
add_definitions(-DCONFIG_ORANGEPI_PC2)
|
||
|
endif()
|
||
|
|
||
|
if(BOARD STREQUAL "orangepiprime-h5")
|
||
|
add_definitions(-DCONFIG_ORANGEPI_PRIME)
|
||
|
endif()
|
||
|
|
||
|
if(BOARD STREQUAL "orangepizeroplus-h5")
|
||
|
add_definitions(-DCONFIG_ORANGEPI_ZEROPLUS)
|
||
|
endif()
|
||
|
|
||
|
if(BOARD STREQUAL "orangepiwin-a64" OR BOARD STREQUAL "orangepiwinplus-a64")
|
||
|
add_definitions(-DCONFIG_ORANGEPI_WIN)
|
||
|
endif()
|
||
|
|
||
|
if(BOARD STREQUAL "orangepione-h3" OR BOARD STREQUAL "orangepilite-h3" OR BOARD STREQUAL "orangepipc-h3" OR BOARD STREQUAL "orangepiplus-h3" OR BOARD STREQUAL "orangepipcplus-h3" OR BOARD STREQUAL "orangepiplus2e-h3")
|
||
|
add_definitions(-DCONFIG_ORANGEPI_H3)
|
||
|
endif()
|
||
|
|
||
|
if(BOARD STREQUAL "orangepizero-h2" OR BOARD STREQUAL "orangepir1-h2")
|
||
|
add_definitions(-DCONFIG_ORANGEPI_ZERO)
|
||
|
endif()
|
||
|
|
||
|
if(BOARD STREQUAL "orangepioneplus-h6" OR BOARD STREQUAL "orangepilite2-h6")
|
||
|
add_definitions(-DCONFIG_ORANGEPI_LITE2)
|
||
|
endif()
|
||
|
|
||
|
if(BOARD STREQUAL "orangepi3-h6")
|
||
|
add_definitions(-DCONFIG_ORANGEPI_3)
|
||
|
endif()
|
||
|
|
||
|
if(BOARD STREQUAL "orangepizero2-h616")
|
||
|
add_definitions(-DCONFIG_ORANGEPI_ZERO2)
|
||
|
endif()
|
||
|
|
||
|
if(BOARD STREQUAL "orangepizeroplus2h3")
|
||
|
add_definitions(-DCONFIG_ORANGEPI_ZEROPLUS2_H3)
|
||
|
endif()
|
||
|
|
||
|
if(BOARD STREQUAL "orangepizeroplus2h5")
|
||
|
add_definitions(-DCONFIG_ORANGEPI_ZEROPLUS2_H5)
|
||
|
endif()
|
||
|
|
||
|
if(BOARD STREQUAL "orangepirk3399")
|
||
|
add_definitions(-DCONFIG_ORANGEPI_RK3399)
|
||
|
endif()
|
||
|
|
||
|
if(BOARD STREQUAL "orangepi4")
|
||
|
add_definitions(-DCONFIG_ORANGEPI_4)
|
||
|
endif()
|
||
|
|
||
|
if(BOARD STREQUAL "orangepi4-lts")
|
||
|
add_definitions(-DCONFIG_ORANGEPI_4_LTS)
|
||
|
endif()
|
||
|
|
||
|
if(BOARD STREQUAL "orangepi800")
|
||
|
add_definitions(-DCONFIG_ORANGEPI_800)
|
||
|
endif()
|
||
|
|
||
|
if(BOARD STREQUAL "orangepir1plus-rk3328")
|
||
|
add_definitions(-DCONFIG_ORANGEPI_R1PLUS)
|
||
|
endif()
|
||
|
add_definitions(-DCONFIG_ORANGEPI)
|
||
|
|
||
|
set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR})
|
||
|
if(NOT "a${PREFIX}" STREQUAL "a")
|
||
|
set(CMAKE_INSTALL_PREFIX ${PREFIX})
|
||
|
endif()
|
||
|
|
||
|
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/wiringPi)
|
||
|
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/devLib)
|
||
|
add_subdirectory(wiringPi)
|
||
|
add_subdirectory(devLib)
|
||
|
add_subdirectory(gpio)
|
||
|
|
||
|
|