Skip to content

Instantly share code, notes, and snippets.

@lteu
Created September 26, 2018 11:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lteu/0321fb4d5bf0f8b2860498c65fa86865 to your computer and use it in GitHub Desktop.
Save lteu/0321fb4d5bf0f8b2860498c65fa86865 to your computer and use it in GitHub Desktop.
cmake_minimum_required(VERSION 2.8.4 FATAL_ERROR)
cmake_policy(SET CMP0002 NEW)
cmake_policy(SET CMP0003 NEW)
cmake_policy(SET CMP0011 NEW)
# The project and cmake vars must only be defined in case that only the base
# filter should be build.
if(NOT AADC_BUILD_ALL_IN_ONE)
# define a project name
project(aadc_user)
# CMAKE_BUILD_TYPE is empty on Unix systems, but needed by ADTF. Otherwise the ADTF libs
# can't be found and linked.
if(UNIX AND NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING
"Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel."
FORCE)
endif(UNIX AND NOT CMAKE_BUILD_TYPE)
endif(NOT AADC_BUILD_ALL_IN_ONE)
#-------General------------
set(AADC_FOUND FALSE)
set(AADC_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../)
find_package(AADC REQUIRED)
if (AADC_FOUND)
message("-- AADC found")
else(AADC_FOUND)
message(FATAL_ERROR "-- AADC not found")
endif (AADC_FOUND)
find_package(ADTF REQUIRED)
message(STATUS "Found ADTF: ${ADTF_VERSION}")
## EDIT BY GIACOMO
##------------------------------------------------------------------
##--------lib protobuf------------------------------------------
##------------------------------------------------------------------
if(UNIX)
set(protobuf_MODULE_COMPATIBLE TRUE)
FIND_PACKAGE(Protobuf 3.5.0 REQUIRED)
if (Protobuf_FOUND)
message(STATUS "Found Protobuf lib with version ${Protobuf_VERSION}, libs are: ${Protobuf_LIBRARIES}; Include Dir is ${Protobuf_INCLUDE_DIRS}")
else (Protobuf_FOUND)
message(FATAL_ERROR "Protobuf lib not found")
endif (Protobuf_FOUND)
endif(UNIX)
##------------------------------------------------------------------
##--------lib eigen------------------------------------------
##------------------------------------------------------------------
if(UNIX)
FIND_PACKAGE(Eigen3 3.3.4 REQUIRED PATHS "/opt/eigen/3.3.4")
if (Eigen3_FOUND)
message(STATUS "Found Eigen ${EIGEN3_VERSION_STRING} ; Include Dir is ${EIGEN3_INCLUDE_DIRS}")
else (Eigen3_FOUND)
message(FATAL_ERROR "Eigen not found")
endif (Eigen3_FOUND)
endif(UNIX)
set(TENSORFLOW_DIR "/opt/tensorflow/1.8.0")
set(TENSORFLOW_INCLUDE_DIRS "${TENSORFLOW_DIR}/include")
FIND_LIBRARY(TENSORFLOW_LIB NAMES
tensorflow_cc
PATHS
"${TENSORFLOW_DIR}/lib"
)
FIND_LIBRARY(TENSORFLOW_FRAMEWORK NAMES
tensorflow_framework
PATHS
"${TENSORFLOW_DIR}/lib"
)
set(TENSORFLOW_LIBS "${TENSORFLOW_LIB};${TENSORFLOW_FRAMEWORK}")
if (TENSORFLOW_LIBS)
message(STATUS "Found Tensorflow. Tensorflow libs are: ${TENSORFLOW_LIBS}; Include Dir is ${TENSORFLOW_INCLUDE_DIRS}")
else (TENSORFLOW_LIBS)
message(FATAL_ERROR "Tensorflow lib not found under ${TENSORFLOW_DIR}")
endif (TENSORFLOW_LIBS)
#--------------add private macros-----------------
include(${AADC_DIR}/AADC_PRIVATE.cmake)
include(${AADC_DIR}/AADCConfigVersion.cmake)
#--------------sources----------------------------
include_directories(${AADC_DIR}/include)
include_directories(${CMAKE_INSTALL_INCLUDE})
#add_subdirectory(OpenCVTemplate)
#add_subdirectory(TemplateFilter)
add_subdirectory(playground2)
#add_subdirectory(EmergencyBrake)
#add_subdirectory(SpeedController)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment