-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
116 lines (91 loc) · 4.4 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
110
111
112
113
114
115
######################################################################
### Composite Build Script (CMake) ###
### http://gabe.is-a-geek.org/composite/ ###
######################################################################
CMAKE_MINIMUM_REQUIRED(VERSION 2.4)
######################################################################
### PROJECT META-INFO ###
######################################################################
PROJECT(composite)
SET(VERSION_MAJOR "0")
SET(VERSION_MINOR "009")
#SET(VERSION_PATCH "")
SET(VERSION "${VERSION_MAJOR}.${VERSION_MINOR}")
######################################################################
### CMAKE SETUP ###
######################################################################
SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules")
# The CMake Policy mechanism is designed to help keep existing
# projects building as new versions of CMake introduce changes in
# behavior.
# http://www.cmake.org/cmake/help/cmake2.6docs.html#command:cmake_policy
IF(COMMAND CMAKE_POLICY)
# CMAKE_POLICY(SET CMP0005 NEW)
CMAKE_POLICY(SET CMP0003 NEW) # add_library
ENDIF(COMMAND CMAKE_POLICY)
######################################################################
### CONFIGURATION OPTIONS ###
######################################################################
OPTION(WANT_LRDF
"Include LRDF (Lightweight Resource Description Framework with special support for LADSPA plugins) support <http://sourceforge.net/projects/lrdf/>"
OFF
)
OPTION(WANT_LIBARCHIVE
"Enable use of libarchive instead of libtar and libz. This is now the default."
ON )
######################################################################
### REQUIRED LIBRARIES ###
######################################################################
### See src/Tritium/CMakeLists.txt
### See src/composite-gui/CMakeLists.txt
######################################################################
### BUILD/INSTALL SETUP ###
######################################################################
SET(DATA_PATH "${CMAKE_INSTALL_PREFIX}/share/composite/data")
######################################################################
### CONFIGURING THE SOFTWARE.... ###
######################################################################
CONFIGURE_FILE(config.h.in config.h)
CONFIGURE_FILE(version.cpp.in version.cpp)
CONFIGURE_FILE(composite.desktop.in composite.desktop)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR})
ADD_SUBDIRECTORY(src)
ENABLE_TESTING()
INSTALL(DIRECTORY data DESTINATION ${DATA_PATH}/..)
INSTALL(FILES ${CMAKE_BINARY_DIR}/composite.desktop DESTINATION "${CMAKE_INSTALL_PREFIX}/share/applications")
INSTALL(FILES ${CMAKE_SOURCE_DIR}/data/doc/composite_sampler.1
DESTINATION share/man/man1)
INSTALL(FILES ${CMAKE_SOURCE_DIR}/data/doc/composite_midi.7
DESTINATION share/man/man7)
INCLUDE(InstallRequiredSystemLibraries)
######################################################################
### UTILS FOR MAKING OFFICIAL RELEASES ###
######################################################################
# Note that this assumes a Git archive, and packages
# Git HEAD.
ADD_CUSTOM_TARGET(dist
git archive --format=tar --prefix=composite-${VERSION}/ HEAD
| gzip -9
> ${CMAKE_BINARY_DIR}/composite_${VERSION}.orig.tar.gz
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
COMMENT "Making composite_${VERSION}.orig.tar.gz"
)
######################################################################
### CONFIGURATION SUMMARY ###
######################################################################
MESSAGE("\n"
"Overall Configuration Summary\n"
"-----------------------------\n"
"* Install Directory : ${CMAKE_INSTALL_PREFIX}\n"
"* Data path : ${DATA_PATH}\n"
)
MESSAGE(
"\n"
"-----------------------------------------------------------------\n"
"FOR ADVANCED CONFIGURATION, USE ccmake INSTEAD OF cmake\n"
"\n"
"IMPORTANT:\n"
"after installing missing packages, remove CMakeCache.txt before\n"
"running cmake again!\n"
"-----------------------------------------------------------------\n"
)