-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
110 lines (78 loc) · 3.74 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
# ----------------------------------------------------------------------------
# Root CMake file for the Mooxygen project
# Run with "cmake ." or "cmakegui"
#
# Jose Luis Blanco <jlblanco@ual.es>
# https://github.com/jlblancoc/mooxygen
# ----------------------------------------------------------------------------
PROJECT(mooxygen)
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
# --------------------------------------------------------------
# Indicate CMake 2.7 and above that we don't want to mix relative
# and absolute paths in linker lib lists.
# Run "cmake --help-policy CMP0003" for more information.
# --------------------------------------------------------------
if(COMMAND cmake_policy)
cmake_policy(SET CMP0003 NEW)
endif(COMMAND cmake_policy)
# MOOXYGEN version from the .h file:
# -------------------------------------------
file(READ "src/moox_version.h" STR_MOOX_VERSION)
STRING(REGEX MATCHALL "[0-9]+.[0-9]+.[0-9]+" MOOXYGEN_VERSION "${STR_MOOX_VERSION}")
STRING(REGEX MATCHALL "[0-9]+" MOOXYGEN_VERSION_PARTS "${MOOXYGEN_VERSION}")
LIST(GET MOOXYGEN_VERSION_PARTS 0 MOOXYGEN_VERSION_MAJOR)
LIST(GET MOOXYGEN_VERSION_PARTS 1 MOOXYGEN_VERSION_MINOR)
LIST(GET MOOXYGEN_VERSION_PARTS 2 MOOXYGEN_VERSION_PATCH)
MESSAGE(STATUS "Parsed Mooxygen version: ${MOOXYGEN_VERSION_MAJOR}.${MOOXYGEN_VERSION_MINOR}.${MOOXYGEN_VERSION_PATCH}")
SET( EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/ CACHE PATH "Output directory for applications" )
# Go and define the targets
add_subdirectory(src)
# ----------------------------------------------------------------------------
# Include the "CPack" package generator
# ----------------------------------------------------------------------------
INCLUDE(InstallRequiredSystemLibraries)
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Mooxygen - A documentation generator for MOOS")
SET(CPACK_PACKAGE_VENDOR "Jose Luis Blanco Claraco")
SET(CPACK_PACKAGE_CONTACT "Jose Luis Blanco Claraco <jlblanco@ctima.uma.es>")
SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/COPYING")
SET(CPACK_RESOURCE_FILE_README "${CMAKE_CURRENT_SOURCE_DIR}/README.md")
SET(CPACK_PACKAGE_VERSION_MAJOR "${MOOXYGEN_VERSION_MAJOR}")
SET(CPACK_PACKAGE_VERSION_MINOR "${MOOXYGEN_VERSION_MINOR}")
SET(CPACK_PACKAGE_VERSION_PATCH "${MOOXYGEN_VERSION_PATCH}")
SET(CPACK_SOURCE_GENERATOR "TGZ;ZIP")
SET(CPACK_PACKAGE_INSTALL_DIRECTORY "mooxygen-${MOOXYGEN_VERSION_MAJOR}.${MOOXYGEN_VERSION_MINOR}.${MOOXYGEN_VERSION_PATCH}")
IF(WIN32)
# --------------------------------
# Packages for Windows
# --------------------------------
SET(CPACK_SOURCE_IGNORE_FILES ".svn/;.*~;build;CMakeCache.txt;_CPack_Pakages/;CMakeFiles/;install/;Makefile;*.cmake")
SET(CPACK_NSIS_HELP_LINK "http:\\\\\\\\https://github.com/jlblancoc/mooxygen")
SET(CPACK_NSIS_URL_INFO_ABOUT "http:\\\\\\\\www.ual.es\\\\jlblanco")
SET(CPACK_NSIS_CONTACT "joseluisblancoc@gmail.com")
# Add mrpt/bin dir to system PATH
SET(CPACK_NSIS_MODIFY_PATH ON)
# Install header and source files:
# ---------------------------------------------
INSTALL(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/src/"
DESTINATION src
PATTERN ".svn" EXCLUDE
PATTERN "*~" EXCLUDE)
INSTALL(FILES
CMakeLists.txt
COPYING
README.txt
DESTINATION .)
SET(CPACK_PACKAGE_EXECUTABLES
"mooxygen;Mooxygen")
SET(CPACK_NSIS_MENU_LINKS
"bin;Mooxygen BIN directory")
ENDIF(WIN32)
IF(UNIX)
SET(CPACK_SOURCE_IGNORE_FILES ".svn;CMakeFiles;CMakeCache.txt;CPack*;progress.make;install_manifest.txt;cmake_install.cmake;cmake_psdk.cmake$;Makefile;.swp$;.*~;tags;cmake_uninstall.cmake$")
SET(CPACK_OUTPUT_FILE_PATH "mooxygen-${MOOXYGEN_VERSION_MAJOR}.${MOOXYGEN_VERSION_MINOR}.${MOOXYGEN_VERSION_PATCH}.deb")
SET(CPACK_GENERATOR "TGZ;DEB")
ENDIF(UNIX)
IF(APPLE)
SET(CPACK_GENERATOR "TGZ;TBZ2;OSXX11")
Endif(APPLE)
INCLUDE(CPack)