
cmake_minimum_required(VERSION 3.5)
project( rt_service CXX )

set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_PROCESSOR armv7-a)


# set(TOOLCHAIN_PREFIX $ENV{SYSROOTS}/x86_64-ostl_sdk-linux/usr/bin/arm-ostl-linux-gnueabi/arm-ostl-linux-gnueabi-)
set(CMAKE_C_COMPILER "home/markus/STM32MPU_workspace/STM32MP1-Ecosystem-V6.1.0/Distribution-Package-VRDevice/build-vrpmdv-stm32mp1/tmp-glibc/sysroots-components/x86_64/gcc-cross-arm/usr/bin/arm-ostl-linux-gnueabi/arm-ostl-linux-gnueabi-gcc")
set(CMAKE_CXX_COMPILER "home/markus/STM32MPU_workspace/STM32MP1-Ecosystem-V6.1.0/Distribution-Package-VRDevice/build-vrpmdv-stm32mp1/tmp-glibc/sysroots-components/x86_64/gcc-cross-arm/usr/bin/arm-ostl-linux-gnueabi/arm-ostl-linux-gnueabi-g++")
# set(CMAKE_CXX_COMPILER "home/markus/STM32MPU_workspace/STM32MP1-Ecosystem-V6.1.0/Distribution-Package-VRDevice/build-vrpmdv-stm32mp1/tmp-glibc/sysroots-components/x86_64/gcc-cross-arm/usr/bin/arm-ostl-linux-gnueabi/arm-ostl-linux-gnueabi-g++")




# -march=armv7ve -mthumb -mfpu=neon-vfpv4 -mfloat-abi=hard -mcpu=cortex-a7 --sysroot=<SDK installation directory>/SDK/sysroots/cortexa7t2hf-neon-vfpv4-ostl-linux-gnueabi
set(COMPILER_FLAGS " -march=armv7ve -mthumb -mfpu=neon-vfpv4 -mfloat-abi=hard -mcpu=cortex-a7 -m32")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${COMPILER_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${COMPILER_FLAGS}")


set(PYTHON_INCLUDE_DIRS "home/markus/STM32MPU_workspace/STM32MP1-Ecosystem-V6.1.0/Distribution-Package-VRDevice/build-vrpmdv-stm32mp1/tmp-glibc/sysroots-components/cortexa7t2hf-neon-vfpv4/python3/usr/include")
set(Boost_INCLUDE "home/markus/STM32MPU_workspace/STM32MP1-Ecosystem-V6.1.0/Distribution-Package-VRDevice/build-vrpmdv-stm32mp1/tmp-glibc/sysroots-components/cortexa7t2hf-neon-vfpv4/boost/include")
set(Boost_LIBRARIES "home/markus/STM32MPU_workspace/STM32MP1-Ecosystem-V6.1.0/Distribution-Package-VRDevice/build-vrpmdv-stm32mp1/tmp-glibc/sysroots-components/cortexa7t2hf-neon-vfpv4/boost/lib")
set(PYTHON_LIBRARIES "home/markus/STM32MPU_workspace/STM32MP1-Ecosystem-V6.1.0/Distribution-Package-VRDevice/build-vrpmdv-stm32mp1/tmp-glibc/sysroots-components/cortexa7t2hf-neon-vfpv4/python3/usr/lib")


# Without this, any build libraries automatically have names "lib{x}.so"
set(CMAKE_SHARED_MODULE_PREFIX "")

add_definitions(-DBOOST_BIND_GLOBAL_PLACEHOLDERS)


# Add a shared module - modules are intended to be imported at runtime.
# - This is where you add the source files
add_library(rt_service SHARED rt_service.cpp)
# add_library(rt_service MODULE rt_service.cpp)
set_target_properties(rt_service PROPERTIES LINKER_LANGUAGE CXX)



# Set up the libraries and header search paths for this target
target_link_libraries(rt_service ${Boost_LIBRARIES} ${PYTHON_LIBRARIES})
target_include_directories(rt_service PRIVATE ${PYTHON_INCLUDE_DIRS} ${Boost_INCLUDE})


