Compiling should work now on Pi as well as on desktop

This commit is contained in:
Johannes Wendel
2019-08-06 20:54:50 +02:00
parent 40ee54a1f8
commit 12a86989ae
40 changed files with 11 additions and 1913 deletions

View File

@@ -24,24 +24,6 @@ IF(NOT RPI_ROOT)
set(RPI_TOOLCHAIN ${RPI_ROOT}/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin)
ENDIF()
IF(CROSS_COMPILE)
SET(CMAKE_CROSSCOMPILING TRUE)
#SET(CMAKE_TOOLCHAIN_FILE ${RPI_ROOT}/Toolchain-RaspberryPi.cmake)
SET(CMAKE_SYSTEM_NAME Linux)
SET(CMAKE_SYSTEM_VERSION 1)
# Specify the cross compiler
SET(CMAKE_C_COMPILER /usr/bin/clang)
SET(CMAKE_CXX_COMPILER /usr/bin/clang)
# Where is the target environment
SET(CMAKE_FIND_ROOT_PATH ${RPI_ROOT}/rootfs)
# SET(CMAKE_FIND_ROOT_PATH $ENV{HOME}/raspberrypi/rootfs)
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
ENDIF(CROSS_COMPILE)
###################### START_CMAKE #######################
cmake_minimum_required(VERSION 3.0.1)
project(FlippR-Driver VERSION 0.1.0)# LANGUAGES CXX)
@@ -100,7 +82,10 @@ endif(Boost_FOUND)
##################### WIRING_PI ##########################
find_library(wiringPi_LIB wiringPi)
if(NOT wiringPi_LIB)
message(FATAL_ERROR "Could not find wiringPi library")
message(WARNING "Could not find wiringPi library, used testing wiring pi lib instead.")
add_definitions(-DNO_WIRING_PI)
else()
message (STATUS "Found wiring pi.")
endif()
target_link_libraries(${PROJECT_NAME} PUBLIC ${wiringPi_LIB})