-
Notifications
You must be signed in to change notification settings - Fork 36
/
Copy pathCMakeLists.txt
68 lines (58 loc) · 1.88 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
# MatlabIO CMakeLists.txt
cmake_minimum_required(VERSION 2.8)
project(cvmatio)
# -----------------------------------------------
# USER-DEFINED VARIABLES
option(BUILD_EXECUTABLE "Build as executable to test functionality" OFF)
option(BUILD_DOC "Build documentation with Doxygen" ON)
# --------------------
# CATKIN
set(BUILD_CATKIN OFF)
if (catkin_FOUND)
set(BUILD_CATKIN ON)
if (${catkin_VERSION} VERSION_GREATER "0.5.28")
catkin_package(INCLUDE_DIRS include)
else()
catkin_stack()
catkin_project(cvmatio
DEPENDS Boost OpenCV
INCLUDE_DIRS include
LIBRARIES cvmatio
)
endif()
endif()
# --------------------
# COMMON
# include all warning types
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wno-unused-parameter -Werror -pedantic")
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()
# find the dependencies
find_package(Boost REQUIRED)
find_package(OpenCV REQUIRED)
include(FindZLIB)
# include the dependencies
include_directories(SYSTEM ${OPENCV_INCLUDE_DIRS}
${Boost_INCLUDE_DIRS}
${ZLIB_INCLUDE_DIR})
include_directories("include")
# build the project
add_subdirectory(src)
# build the doxygen pdf
if(BUILD_DOC)
add_subdirectory(doc)
endif()
# configuration summary
message("")
message("---------------------------------------------")
message(${PROJECT_NAME} " Configuration Summary")
message("")
message("Building with ECTO/Catkin: ${BUILD_CATKIN}")
message("Build as executable: ${BUILD_EXECUTABLE}")
message("Build with documentation: ${BUILD_DOC}")
message("Build type: ${CMAKE_BUILD_TYPE}")
message("")
message("---------------------------------------------")