From b22df1dac307392923f9044eca3bc3e29d696b42 Mon Sep 17 00:00:00 2001 From: Sergey Markov Date: Wed, 18 May 2022 16:38:52 +0300 Subject: [PATCH] migration to cmake --- CMakeLists.txt | 98 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..4f87682 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,98 @@ +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) + +