-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
69 lines (59 loc) · 2.06 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
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
# Avoid repeating the IF statement in the ENDIF and ELSE
SET(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS true)
########### Project name ###########
SET(PACKAGE cv2cg)
PROJECT(${PACKAGE})
SET(VERSION_MAJOR "1")
SET(VERSION_MINOR "2")
SET(VERSION_PATCH "0")
SET(VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}")
########### Main global variables ###########
IF(NOT CMAKE_BUILD_TYPE)
SET(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel." FORCE)
ENDIF()
IF(UNIX AND NOT WIN32)
SET(CMAKE_CXX_FLAGS "-Wall -Wextra -Wno-unused-parameter") # Enable lots of warning flags
ELSE()
SET(CMAKE_CXX_FLAGS "/fp:precise /fp:except /bigobj /Zm1000 /EHsc /DWIN32") # Refer to Stellarium. Flags used on purpose
ENDIF()
########### Find packages ###########
SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake/)
FIND_PACKAGE(OpenCV REQUIRED)
SET(CV2CG_3RDPARTY_LINKEROPTION
${CV2CG_3RDPARTY_LINKEROPTION}
${OpenCV_LIBS}
)
#FIND_PACKAGE(Eigen3 REQUIRED)
#INCLUDE_DIRECTORIES(
# ${EIGEN3_INCLUDE_DIR}
#)
OPTION(USE_FLYCAP "Use Point Grey FlyCapture2 library" OFF)
IF(USE_FLYCAP)
FIND_PACKAGE(FlyCapture REQUIRED)
INCLUDE_DIRECTORIES(
${FLYCAPTURE_INCLUDE_PATH}
)
SET(CV2CG_3RDPARTY_LINKEROPTION
${CV2CG_3RDPARTY_LINKEROPTION}
${FLYCAPTURE_LIBRARY}
)
ENDIF(USE_FLYCAP)
CONFIGURE_FILE(
"${CMAKE_CURRENT_SOURCE_DIR}/include/cv2cgConfig.h.in"
"${CMAKE_CURRENT_BINARY_DIR}/include/cv2cgConfig.h")
INCLUDE_DIRECTORIES(
"${CMAKE_CURRENT_BINARY_DIR}/include"
)
########### uninstall files ###############
CONFIGURE_FILE(
"${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
IMMEDIATE @ONLY)
ADD_CUSTOM_TARGET(uninstall
"${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake")
########### Macros ###############
include(${CMAKE_SOURCE_DIR}/cmake/AutoAppConfig.cmake)
include(${CMAKE_SOURCE_DIR}/cmake/AutoAddSubDir.cmake)
########### Subdirectories ###############
ADD_SUBDIRECTORY(application)