-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
71 lines (58 loc) · 2.27 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
cmake_minimum_required(VERSION 3.5)
# config project version
set(SFRCALIB_VERSION_MAJOR 0)
set(SFRCALIB_VERSION_MINOR 4)
set(SFRCALIB_VERSION_PATCH 0)
set(SFRCALIB_VERSION "${SFRCALIB_VERSION_MAJOR}.${SFRCALIB_VERSION_MINOR}.${SFRCALIB_VERSION_PATCH}")
message(STATUS "SfrCalib version is: ${SFRCALIB_VERSION}")
# local dependent package
set(THIRD_PARTY "${CMAKE_CURRENT_SOURCE_DIR}/third_party")
project(SfrCalib VERSION ${SFRCALIB_VERSION})
option(BUILD_EXAMPLES "build the examples." ON)
option(BUILD_DESIGNERPLUGIN "build the Designer Plugin." OFF)
option(SCANNE_PLUGIN "Plugin line scanner hand-eye calibration tool." ON)
option(CAMERA_PLUGIN "Plugin 2d camera hand-eye calibration tool." ON)
if (SCANNE_PLUGIN)
add_definitions(-DSCANNE_PLUGIN=${SCANNE_PLUGIN})
endif()
if (CAMERA_PLUGIN)
add_definitions(-DCAMERA_PLUGIN=${CAMERA_PLUGIN})
endif()
# set(CMAKE_CXX_STANDARD 17)
# set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_DEBUG_POSTFIX "d" CACHE STRING "add a postfix, usually d on windows")
set(CMAKE_RELEASE_POSTFIX "" CACHE STRING "add a postfix, usually empty on windows")
set(CMAKE_RELWITHDEBINFO_POSTFIX "rd" CACHE STRING "add a postfix, usually empty on windows")
set(CMAKE_MINSIZEREL_POSTFIX "s" CACHE STRING "add a postfix, usually empty on windows")
if(MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4819")
add_compile_options(/bigobj) # add big obj option to avoid calibrator build fail
endif()
# # cmd not visible when run exec
# if(WIN32)
# set(CMAKE_EXE_LINKER_FLAGS "/SUBSYSTEM:WINDOWS")
# elseif(UNIX AND NOT APPLE)
# set(CMAKE_EXE_LINKER_FLAGS "-ldl")
# endif()
include(CPack)
# platform check
if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "4")
set(SFRCALIB_PLATFORM "86")
else()
set(SFRCALIB_PLATFORM "64")
endif()
# add window platform resource config macro definition
include(cmake/WinResource.cmake)
# The bin file directory is one level above the current directory
if((${CMAKE_BUILD_TYPE}) STREQUAL "Debug")
set(SFRCALIB_BUILD_TYPE debug)
elseif((${CMAKE_BUILD_TYPE}) STREQUAL "Release")
set(SFRCALIB_BUILD_TYPE release)
endif()
set(SFRCALIB_BIN_NAME bin_${SFRCALIB_VERSION})
set(SFRCALIB_BIN_DIR ${CMAKE_CURRENT_SOURCE_DIR}/${SFRCALIB_BIN_NAME})
add_subdirectory(src)
add_subdirectory(cmake)
if(BUILD_EXAMPLES)
add_subdirectory(example)
endif()