修改ARM下的Cmake;基础算法依赖的绝对路径
This commit is contained in:
parent
7204f3efca
commit
d0b88daf80
@ -2,6 +2,11 @@
|
||||
cmake_minimum_required(VERSION 3.5)
|
||||
project(ZAlgo)
|
||||
|
||||
# OpenCV版本选择:320 或 480
|
||||
# 使用方法:cmake -DOPENCV_VERSION=320 .. 或 cmake -DOPENCV_VERSION=480 ..
|
||||
set(OPENCV_VERSION "320" CACHE STRING "OpenCV版本选择: 320 或 480")
|
||||
set_property(CACHE OPENCV_VERSION PROPERTY STRINGS "320" "480")
|
||||
|
||||
set(DCMAKE_BUILD_SYSNAME Arm)
|
||||
set(CMAKE_BUILD_ARCH aarch64)
|
||||
|
||||
@ -20,41 +25,55 @@ SET(LIBRARY_OUTPUT_PATH ${CMAKE_CURRENT_SOURCE_DIR}/arm/libs)
|
||||
SET(EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_SOURCE_DIR}/arm/bin)
|
||||
|
||||
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../thirdParty/VzNLSDK/Inc)
|
||||
# INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../thirdParty/OpenCV320/include)
|
||||
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../thirdParty/opencv/build/include)
|
||||
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../thirdParty/eigen3)
|
||||
|
||||
# 根据OPENCV_VERSION选择不同的OpenCV路径
|
||||
if(OPENCV_VERSION STREQUAL "320")
|
||||
message(STATUS "使用 OpenCV 3.2.0")
|
||||
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../thirdParty/OpenCV320/include)
|
||||
add_definitions(-DOPENCV_VERSION_320)
|
||||
elseif(OPENCV_VERSION STREQUAL "480")
|
||||
message(STATUS "使用 OpenCV 4.8.0")
|
||||
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../thirdParty/opencv480/include)
|
||||
add_definitions(-DOPENCV_VERSION_480)
|
||||
else()
|
||||
message(FATAL_ERROR "不支持的OpenCV版本: ${OPENCV_VERSION},请使用 320 或 480")
|
||||
endif()
|
||||
|
||||
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/sourceCode/inc)
|
||||
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/sourceCode)
|
||||
|
||||
ADD_DEFINITIONS(-DSG_API_LIBRARY)
|
||||
|
||||
ADD_LIBRARY(baseAlgorithm SHARED sourceCode/SG_baseFunc.cpp
|
||||
sourceCode/SG_clustering.cpp
|
||||
sourceCode/SG_featureGrow.cpp
|
||||
sourceCode/SG_lineFeature.cpp
|
||||
sourceCode/SG_regionGrow.cpp
|
||||
sourceCode/WD_noiseFilter.cpp
|
||||
sourceCode/WD_watershed.cpp
|
||||
)
|
||||
if(OPENCV_VERSION STREQUAL "320")
|
||||
ADD_LIBRARY(baseAlgorithm SHARED sourceCode/SG_baseFunc.cpp
|
||||
sourceCode/SG_clustering.cpp
|
||||
sourceCode/SG_featureGrow.cpp
|
||||
sourceCode/SG_lineFeature.cpp
|
||||
sourceCode/SG_regionGrow.cpp
|
||||
sourceCode/WD_noiseFilter.cpp
|
||||
sourceCode/WD_watershed.cpp
|
||||
)
|
||||
|
||||
ADD_LIBRARY(bagPositioning SHARED sourceCode/SG_bagPositioning.cpp)
|
||||
ADD_LIBRARY(bagPositioning SHARED sourceCode/SG_bagPositioning.cpp)
|
||||
|
||||
ADD_LIBRARY(lapWeldDetection SHARED sourceCode/SX_lapWeldDetection.cpp)
|
||||
ADD_LIBRARY(lapWeldDetection SHARED sourceCode/SX_lapWeldDetection.cpp)
|
||||
|
||||
ADD_LIBRARY(beltTearingDetection SHARED sourceCode/beltTearingDetection.cpp)
|
||||
ADD_LIBRARY(beltTearingDetection SHARED sourceCode/beltTearingDetection.cpp)
|
||||
|
||||
ADD_LIBRARY(workpieceCornerExtraction SHARED sourceCode/BQ_workpieceCornerExtraction.cpp)
|
||||
ADD_LIBRARY(workpieceCornerExtraction SHARED sourceCode/BQ_workpieceCornerExtraction.cpp)
|
||||
|
||||
ADD_LIBRARY(particleSizeMeasurement SHARED sourceCode/WD_particleSizeMeasure.cpp)
|
||||
ADD_LIBRARY(particleSizeMeasurement SHARED sourceCode/WD_particleSizeMeasure.cpp)
|
||||
|
||||
ADD_LIBRARY(binocularMarkCam SHARED sourceCode/binocularMarkCam.cpp
|
||||
sourceCode/aruco/aruco.cpp
|
||||
sourceCode/aruco/aruco_calib.cpp
|
||||
)
|
||||
ADD_LIBRARY(wheelArchHeigthMeasure SHARED sourceCode/wheelArchHeigthMeasure.cpp)
|
||||
|
||||
#add executable file
|
||||
# ADD_EXECUTABLE(bagPositioning_test bagPositioning_test/bagPositioning_test.cpp)
|
||||
ADD_LIBRARY(channelSpaceMeasure SHARED sourceCode/channelSpaceMeasure.cpp)
|
||||
|
||||
# TARGET_LINK_LIBRARIES(bagPositioning_test
|
||||
# bagPositioning
|
||||
# )
|
||||
elseif(OPENCV_VERSION STREQUAL "480")
|
||||
ADD_LIBRARY(binocularMarkCam SHARED sourceCode/binocularMarkCam.cpp
|
||||
sourceCode/aruco/aruco.cpp
|
||||
sourceCode/aruco/aruco_calib.cpp
|
||||
)
|
||||
else()
|
||||
message(FATAL_ERROR "不支持的OpenCV版本: ${OPENCV_VERSION},请使用 320 或 480")
|
||||
endif()
|
||||
|
||||
@ -78,12 +78,12 @@
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
<IncludePath>..\..\thirdParty\VzNLSDK\Inc;..\..\thirdParty\opencv320\build\include;..\sourceCode;..\sourceCode\inc;F:\ShangGu\ProductDev\AlgoDev\thirdParty\PCL 1.12.0\3rdParty\Eigen\eigen3;$(IncludePath)</IncludePath>
|
||||
<IncludePath>..\..\thirdParty\VzNLSDK\Inc;..\..\thirdParty\opencv320\build\include;..\sourceCode;..\sourceCode\inc;..\..\thirdParty\PCL 1.12.0\3rdParty\Eigen\eigen3;$(IncludePath)</IncludePath>
|
||||
<OutDir>$(SolutionDir)build\$(Platform)\$(Configuration)\</OutDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<IncludePath>..\..\thirdParty\VzNLSDK\Inc;..\..\thirdParty\opencv320\build\include;..\sourceCode;..\sourceCode\inc;F:\ShangGu\ProductDev\AlgoDev\thirdParty\PCL 1.12.0\3rdParty\Eigen\eigen3;$(IncludePath)</IncludePath>
|
||||
<IncludePath>..\..\thirdParty\VzNLSDK\Inc;..\..\thirdParty\opencv320\build\include;..\sourceCode;..\sourceCode\inc;..\..\thirdParty\PCL 1.12.0\3rdParty\Eigen\eigen3;$(IncludePath)</IncludePath>
|
||||
<OutDir>$(SolutionDir)build\$(Platform)\$(Configuration)\</OutDir>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user