Demo entry 6776315

cmake

   

Submitted by anonymous on Dec 01, 2018 at 23:09
Language: CMake. Code size: 3.1 kB.

project(remap-apex CXX)
file(GLOB SRC_FILES src/*.cpp)
add_executable(${PROJECT_NAME} ${SRC_FILES})

message( STATUS "\n[Autohitch]Compiling project: " ${PROJECT_NAME}  "\n")

# Set directories for NXP static librariesa
IF(CMAKE_SYSTEM MATCHES "QNX.*")
	IF(CMAKE_BUILD_TYPE MATCHES Debug)
		set(ODIR build-v234ce-qcc-qnx-d)
	ELSE(CMAKE_BUILD_TYPE MATCHES Debug)
		set(ODIR build-v234ce-qcc-qnx-o)
 	ENDIF()
	target_compile_options(${PROJECT_NAME} PUBLIC -U qnx -D OSDIR=qnx)
ELSE()
	IF(CMAKE_BUILD_TYPE MATCHES Debug)
		set(ODIR build-v234ce-gnu-linux-d)
	ELSE(CMAKE_BUILD_TYPE MATCHES Debug)
		set(ODIR build-v234ce-gnu-linux-o)
 	ENDIF()
	target_compile_options(${PROJECT_NAME} PRIVATE -U linux -D OSDIR=linux)
ENDIF()

# Set OpenCV directories
set(OpenCV_DIR "${CMAKE_SOURCE_DIR}/external/OpenCV/prebuilt/CortexA53-Linux")
set(OpenCV_INCLUDE_DIRS "${OpenCV_DIR}/include")
set(OpenCV_LIBS_DIR "${OpenCV_DIR}/lib")

# Export include files for current folder
target_include_directories(${PROJECT_NAME} PUBLIC
	$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include/>)

# Export include files of dependencies
include_directories(
		/opt/NXP/s32v234_sdk/libs/apex/acf/include/
    /opt/NXP/s32v234_sdk/libs/apex/icp/include/
		/opt/NXP/s32v234_sdk/libs/utils/common/include/
		/opt/NXP/s32v234_sdk/libs/utils/umat/include/
		/opt/NXP/s32v234_sdk/libs/apex/drivers/user/include/
		/opt/NXP/s32v234_sdk/libs/utils/oal/user/include/
		/opt/NXP/s32v234_sdk/libs/utils/log/include/
		/opt/NXP/s32v234_sdk/libs/utils/communications/include/
		/opt/NXP/s32v234_sdk/libs/apexcv_pro/remap/include/
    /opt/NXP/s32v234_sdk/include/
		/opt/NXP/s32v234_sdk/libs/apexcv_pro/remap/graphs/
		/opt/NXP/s32v234_sdk/libs/apexcv_pro/remap/graphs/build-apu-tct-sa-d/
    /opt/NXP/s32v234_sdk/libs/io/semihost/include/
    /opt/NXP/s32v234_sdk/3rdparty/iniparser4/src/ #Has header files as well
		${OpenCV_DIR}/include/
)

# NXP Libraries
target_link_libraries(${PROJECT_NAME}
		/opt/NXP/s32v234_sdk/libs/apex/acf/${ODIR}/libacf.a
		/opt/NXP/s32v234_sdk/libs/apex/icp/${ODIR}/libicp.a
		/opt/NXP/s32v234_sdk/libs/utils/common/${ODIR}/libcommon.a
		/opt/NXP/s32v234_sdk/libs/utils/umat/${ODIR}/libumat.a
		/opt/NXP/s32v234_sdk/libs/apexcv_pro/remap/${ODIR}/apexcv_pro_remap.a
		/opt/NXP/s32v234_sdk/libs/apex/acf/${ODIR}/libacf.a
		/opt/NXP/s32v234_sdk/libs/apex/drivers/user/${ODIR}/libapexdrv.a
		/opt/NXP/s32v234_sdk/libs/utils/oal/user/${ODIR}/liboal.a
		/opt/NXP/s32v234_sdk/libs/utils/log/${ODIR}/liblog.a
		/opt/NXP/s32v234_sdk/libs/utils/communications/${ODIR}/lib_communications.a)

# OpenCV Libraries
target_link_libraries(${PROJECT_NAME}
	${OpenCV_DIR}/lib/libopencv_calib3d.a
	${OpenCV_DIR}/lib/libopencv_video.a
	${OpenCV_DIR}/lib/libopencv_highgui.a
	${OpenCV_DIR}/lib/libopencv_imgproc.a
	${OpenCV_DIR}/lib/libopencv_core.a
	${OpenCV_DIR}/share/OpenCV/3rdparty/lib/libzlib.a
	${OpenCV_DIR}/share/OpenCV/3rdparty/lib/liblibprotobuf.a
	${OpenCV_DIR}/share/OpenCV/3rdparty/lib/libtegra_hal.a)

# Check formatting
#dat_set_clang_tidy(${PROJECT_NAME})

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).