-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
executable file
·69 lines (57 loc) · 2.15 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
project(nanogear CXX C)
cmake_minimum_required(VERSION 2.6)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/modules")
include(NanogearVersion)
message(STATUS "This is nanogear ${NANOGEAR_MAJOR}.${NANOGEAR_MINOR}.${NANOGEAR_PATCH}")
find_package(Qt4 REQUIRED)
set(QT_USE_QTNETWORK 1)
set(QT_DONT_USE_QTGUI 1)
include(${QT_USE_FILE})
#-----------------------------------------------------------------------------
# Output directories.
#
SET(output_dir ${nanogear_BINARY_DIR}/bin)
FOREACH(type LIBRARY RUNTIME ARCHIVE)
IF(NOT DEFINED CMAKE_${type}_OUTPUT_DIRECTORY)
SET(CMAKE_${type}_OUTPUT_DIRECTORY ${output_dir} CACHE INTERNAL "Single output directory for building all libraries.")
ENDIF()
ENDFOREACH()
#
# Build documentation if doxygen and graphviz are found
#
find_package(Doxygen)
if (DOXYGEN_FOUND AND DOXYGEN_DOT_FOUND)
message(STATUS "Use the 'apidocs' target to build documentation")
add_subdirectory(docs)
else (DOXYGEN_FOUND AND DOXYGEN_DOT_FOUND)
message(STATUS "You will need both doxygen and graphviz 'dot' to build documentation")
endif (DOXYGEN_FOUND AND DOXYGEN_DOT_FOUND)
#
# Pedantic mode
# Enable all warnings and treat them as errors
#
if (${PEDANTIC})
if (${CMAKE_COMPILER_IS_GNUCC} OR ${CMAKE_COMPILER_IS_GNUCXX})
message(STATUS "-- Pedantic mode enabled for GCC compiler")
add_definitions(-W -Wall -pedantic -Werror)
else (${CMAKE_COMPILER_IS_GNUCC} OR ${CMAKE_COMPILER_IS_GNUCXX})
message(STATUS "-- Unable to find a supported compiler")
endif (${CMAKE_COMPILER_IS_GNUCC} OR ${CMAKE_COMPILER_IS_GNUCXX})
else (${PEDANTIC})
message(STATUS "Pedantic mode is NOT enabled")
message(STATUS " If you are a developer you are strongly encouraged to activate")
message(STATUS " the pedantic mode")
endif (${PEDANTIC})
#
# Continue build
#
add_subdirectory(src)
if (${WITH_EXAMPLES})
add_subdirectory(examples)
endif (${WITH_EXAMPLES})
#-----------------------------------------------------------------------------
# Generate nanogear file
#
CONFIGURE_FILE(Usenanogear.cmake.in
${nanogear_BINARY_DIR}/Usenanogear.cmake COPYONLY)
INCLUDE(GeneratenanogearConfig.cmake)