Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 487 lines (393 sloc) 15.834 kB
372b6dd @timblechmann cmake build system: require cmake 2.8
timblechmann authored
1 cmake_minimum_required (VERSION 2.8)
018a3b5 basic cmake-based build system:
Tim Blechmann authored
2 project (SuperCollider)
591b039 @timblechmann cmake build system: cdash support
timblechmann authored
3
8081c23 @lijon Improve setting of current SC version.
lijon authored
4 include("SCVersion.txt")
5 set(PROJECT_VERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}${PROJECT_VERSION_PATCH}")
6 message(STATUS "SuperCollider Version: ${PROJECT_VERSION}")
7
591b039 @timblechmann cmake build system: cdash support
timblechmann authored
8 include(CTest)
a4fd005 @timblechmann import cmake-based build system
timblechmann authored
9 enable_testing()
018a3b5 basic cmake-based build system:
Tim Blechmann authored
10
e6b75c5 @timblechmann reorganize cmake build system
timblechmann authored
11 include (cmake_modules/FinalFile.cmake)
018a3b5 basic cmake-based build system:
Tim Blechmann authored
12
069bf90 @danstowell Default cmake build type set to Release
danstowell authored
13 if (NOT CMAKE_BUILD_TYPE)
f77b544 @timblechmann cmake build system: default to RelWithDebInfo
timblechmann authored
14 message(STATUS "Build type defaulting to \"RelWithDebInfo\"")
15 set(CMAKE_BUILD_TYPE "RelWithDebInfo")
069bf90 @danstowell Default cmake build type set to Release
danstowell authored
16 endif()
17
3e6a2fc @timblechmann cmake build system: reject in-place builds
timblechmann authored
18 if (${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
6c91bf0 @timblechmann cmake build system: allow in-place builds, but post a big fat warning
timblechmann authored
19 message(WARNING "WARNING: IN-PLACE BUILDS ARE NOT RECOMMENDED - PLEASE USE A BUILD DIRECTORY")
3e6a2fc @timblechmann cmake build system: reject in-place builds
timblechmann authored
20 endif()
21
22
e6b75c5 @timblechmann reorganize cmake build system
timblechmann authored
23 set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules
018a3b5 basic cmake-based build system:
Tim Blechmann authored
24 ${CMAKE_MODULE_PATH})
25
26 CONFIGURE_FILE(
e6b75c5 @timblechmann reorganize cmake build system
timblechmann authored
27 "${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules/cmake_uninstall.cmake.in"
018a3b5 basic cmake-based build system:
Tim Blechmann authored
28 "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
29 IMMEDIATE @ONLY)
30
31 ADD_CUSTOM_TARGET(uninstall
32 "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake")
33
b575612 @danstowell Detect Mac SDK version in cmake script
danstowell authored
34 if(APPLE)
35 STRING(REGEX REPLACE "^.*MacOSX10.([0-9]+).*$" "\\1" MAC_OSX_SDK_VERSION "${CMAKE_OSX_SYSROOT}")
58e8efe @danstowell Use cmake detection of 10.4 mac SDK to compile HID_Utilities_10_4 (re…
danstowell authored
36
0df93a9 @timblechmann cmake build system: select HID utilities based on deployment target
timblechmann authored
37 if(CMAKE_OSX_DEPLOYMENT_TARGET)
38 if (CMAKE_OSX_DEPLOYMENT_TARGET GREATER 10.4)
39 set(HID_UTIL_DIR "HID_Utilities")
40 else()
41 set(HID_UTIL_DIR "HID_Utilities_10_4")
42 endif()
58e8efe @danstowell Use cmake detection of 10.4 mac SDK to compile HID_Utilities_10_4 (re…
danstowell authored
43 else()
0df93a9 @timblechmann cmake build system: select HID utilities based on deployment target
timblechmann authored
44 if (${MAC_OSX_SDK_VERSION} GREATER 4)
45 set(HID_UTIL_DIR "HID_Utilities")
46 else()
47 set(HID_UTIL_DIR "HID_Utilities_10_4")
48 endif()
58e8efe @danstowell Use cmake detection of 10.4 mac SDK to compile HID_Utilities_10_4 (re…
danstowell authored
49 endif()
50 MESSAGE( STATUS "Using HID Utilities from folder '${HID_UTIL_DIR}'")
b575612 @danstowell Detect Mac SDK version in cmake script
danstowell authored
51 endif()
52
553b126 @timblechmann cmake build system: intel compiler support
timblechmann authored
53 if (CMAKE_SYSTEM_NAME MATCHES "Linux")
54 set(LINUX 1)
55 endif()
56
c6f18e7 @danstowell cmake build improvements:
danstowell authored
57 #############################################
58 # Compiler flags etc
59
a3c268a @jleben add WIN32_LEAN_AND_MEAN preprocessor definition to the whole project
jleben authored
60 add_definitions(-DWIN32_LEAN_AND_MEAN)
61
c6f18e7 @danstowell cmake build improvements:
danstowell authored
62 if (${CMAKE_COMPILER_IS_GNUCXX})
9d04cc8 @timblechmann cmake build system: don't enable -ffast-math for gcc-4.0
timblechmann authored
63 exec_program(${CMAKE_CXX_COMPILER} ARGS -dumpversion OUTPUT_VARIABLE _gcc_version)
64
65 add_definitions("-fschedule-insns2" "-fomit-frame-pointer")
66
77ddd0d @timblechmann cmake build system: update gcc compile flags
timblechmann authored
67 add_definitions("-Wreturn-type")
68
156facd @timblechmann cmake build sytem: disable -ffast-math completely
timblechmann authored
69 # disabled for now: -ffast-math breaks avx intrinsics and -fsigned-zeros/-fno-associative-math are not available in some versions
70 # if (${_gcc_version} VERSION_GREATER 4.0.99)
71 # add_definitions("-ffast-math -fsigned-zeros -fno-associative-math")
72 # endif()
c6f18e7 @danstowell cmake build improvements:
danstowell authored
73
203be5a @timblechmann cmake build system: don't use dso visibility by default
timblechmann authored
74 option(DSO_VISIBILITY "DSO visibility support for gcc" OFF)
75
76 if (DSO_VISIBILITY)
77 add_definitions(-fvisibility=hidden)
78 endif()
4ee01de @timblechmann symbol visibility support for libscsynth and libsclang
timblechmann authored
79
c6f18e7 @danstowell cmake build improvements:
danstowell authored
80 if(APPLE)
9d04cc8 @timblechmann cmake build system: don't enable -ffast-math for gcc-4.0
timblechmann authored
81 exec_program(${CMAKE_CXX_COMPILER} ARGS --version OUTPUT_VARIABLE _gcc_version_info)
82 if ("${_gcc_version_info}" MATCHES "Apple")
83 add_definitions("-fpascal-strings")
84 endif()
c6f18e7 @danstowell cmake build improvements:
danstowell authored
85 add_definitions("-D_REENTRANT")
1bfe781 @timblechmann cmake build system: fix mingw condition
timblechmann authored
86 elseif(NOT (WIN32 AND NOT CYGWIN))
c6f18e7 @danstowell cmake build improvements:
danstowell authored
87 add_definitions("-pthread")
88 endif()
89 endif ()
90
553b126 @timblechmann cmake build system: intel compiler support
timblechmann authored
91 if (${CMAKE_CXX_COMPILER} MATCHES icpc)
92 set(CMAKE_COMPILER_IS_INTEL 1)
93 add_definitions(-Wno-unknown-pragmas)
94 add_definitions(-simd)
95 endif()
96
da634c1 @timblechmann cmake build system: better clang++ support
timblechmann authored
97 if (${CMAKE_CXX_COMPILER} MATCHES clang)
e3117ef @timblechmann cmake build system: visiblity support for clang
timblechmann authored
98 option(DSO_VISIBILITY "DSO visibility support for clang" OFF)
99
100 if (DSO_VISIBILITY)
101 add_definitions(-fvisibility=hidden)
102 endif()
103
da634c1 @timblechmann cmake build system: better clang++ support
timblechmann authored
104 set(CMAKE_COMPILER_IS_CLANG 1)
105 endif()
106
018a3b5 basic cmake-based build system:
Tim Blechmann authored
107 if(APPLE)
108 set_property(DIRECTORY
c6f18e7 @danstowell cmake build improvements:
danstowell authored
109 APPEND
110 PROPERTY COMPILE_DEFINITIONS SC_DARWIN)
018a3b5 basic cmake-based build system:
Tim Blechmann authored
111 elseif(CMAKE_SYSTEM_NAME MATCHES "Linux")
c6f18e7 @danstowell cmake build improvements:
danstowell authored
112 add_definitions("-DSC_LINUX")
63d3201 @lijon CMake: set SC_DATA_DIR on linux
lijon authored
113 add_definitions(-DSC_DATA_DIR="${CMAKE_INSTALL_PREFIX}/share/SuperCollider")
922bc82 @danstowell cmake FreeBSD tweaks - initial and untested
danstowell authored
114 elseif(CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
115 add_definitions("-DSC_FREEBSD")
116 add_definitions(-DSC_DATA_DIR="${CMAKE_INSTALL_PREFIX}/share/SuperCollider")
5a7d021 cmake build system: possibility to disable nova-simd
Tim Blechmann authored
117 endif()
018a3b5 basic cmake-based build system:
Tim Blechmann authored
118
c6f18e7 @danstowell cmake build improvements:
danstowell authored
119 if(WIN32)
daebe22 @timblechmann cmake build system: win32/mingw support
timblechmann authored
120 set_property(DIRECTORY
121 APPEND
374c562 @timblechmann win32: require at least windows 2000
timblechmann authored
122 PROPERTY COMPILE_DEFINITIONS SC_WIN32 NOMINMAX _WIN32_WINNT=0x0500)
daebe22 @timblechmann cmake build system: win32/mingw support
timblechmann authored
123
124 if(MSVC)
4b0ec40 @mozinator These definitions are needed to compile with Visual C++
mozinator authored
125 SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_RELEASE} /MTd")
126 SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_DEBUG} /MT")
daebe22 @timblechmann cmake build system: win32/mingw support
timblechmann authored
127 endif()
e6b75c5 @timblechmann reorganize cmake build system
timblechmann authored
128 endif()
129
130
131 #############################################
132 # some default libraries
133
134 find_package(Pthreads)
135
136 if (NOT PTHREADS_FOUND)
137 message(SEND_ERROR "cannot find libpthreads")
138 endif()
139 include_directories(${PTHREADS_INCLUDE_DIR})
140
d617012 @timblechmann cmake build system: better win32 support
timblechmann authored
141 if (MSVC OR MINGW)
5d08ccc @timblechmann cmake build system: define dummy math library for msvc
timblechmann authored
142 set(MATH_LIBRARY "")
143 else()
daebe22 @timblechmann cmake build system: win32/mingw support
timblechmann authored
144 find_library(MATH_LIBRARY m)
145 endif()
e6b75c5 @timblechmann reorganize cmake build system
timblechmann authored
146
147 if(CURL)
148 find_package(CURL)
149 if(CURL_FOUND)
150 add_definitions("-DHAVE_LIBCURL")
151 include_directories(${CURL_INCLUDE_DIRS})
152 endif()
c6f18e7 @danstowell cmake build improvements:
danstowell authored
153 endif()
154
155 #############################################
156 # Options
5a7d021 cmake build system: possibility to disable nova-simd
Tim Blechmann authored
157 option(NOVA_SIMD "Build with nova-simd support." ON)
ff71d3b cmake build system: make the use of a final-file optional
Tim Blechmann authored
158 option(FINAL_BUILD "Build as single source file." OFF)
159
c6f18e7 @danstowell cmake build improvements:
danstowell authored
160 option(CURL "Build with curl for remote file download." ON)
161
162 option(FFT_GREEN "Use internal 'Green' FFT lib rather than FFTW. (Not recommended.)" OFF)
163
78121f3 @timblechmann merge supernova/master into supernova
timblechmann authored
164 option(SSE "Compile with support for SSE instructions.")
165 option(SSE41 "Compile with support for SSE4.1 instructions.")
166 option(SSE42 "Compile with support for SSE4.2 instructions.")
a4fd005 @timblechmann import cmake-based build system
timblechmann authored
167
f5dcc83 @timblechmann cmake build system: don't build supernova on osx by default
timblechmann authored
168
09f875d @danstowell cmake option INSTALL_HELP added
danstowell authored
169 option(INSTALL_HELP "Install help docs and examples along with the software" ON)
5b43805 @timblechmann cmake build system: add command line flag to avoid installing old help
timblechmann authored
170 option(INSTALL_OLD_HELP "Install old and deprecated help files" ON)
6fc0c39 @lijon Renamed HelpBase to RenderedHelp and other related tweaks in cmakelis…
lijon authored
171 option(SC_DOC_RENDER "Pre-render SCDoc documentation. (For putting online, etc)" OFF)
90cd7d9 @timblechmann cmake build system: make scdoc generation optional
timblechmann authored
172
f5dcc83 @timblechmann cmake build system: don't build supernova on osx by default
timblechmann authored
173 if(CMAKE_SYSTEM_NAME MATCHES "Linux")
48a65af @timblechmann cmake build system: fix typo
timblechmann authored
174 option(SUPERNOVA "Build with supernova as optional audio synthesis server" ON)
f5dcc83 @timblechmann cmake build system: don't build supernova on osx by default
timblechmann authored
175 elseif()
48a65af @timblechmann cmake build system: fix typo
timblechmann authored
176 option(SUPERNOVA "Build with supernova as optional audio synthesis server" OFF)
f5dcc83 @timblechmann cmake build system: don't build supernova on osx by default
timblechmann authored
177 endif()
2e13dde @timblechmann common: alloc pool - bypass memory pools with preprocessor definition
timblechmann authored
178
3794a3e @timblechmann cmake build system: conditional compilation of supernova
timblechmann authored
179 option(SN_MEMORY_DEBUGGING "Build supernova for memory debugging (disable memory pools).")
2e13dde @timblechmann common: alloc pool - bypass memory pools with preprocessor definition
timblechmann authored
180 option(SC_MEMORY_DEBUGGING "Build sclang&scsynth for memory debugging (disable memory pools).")
afe8e7b @timblechmann sclang: enable gc sanity checks with a compile-time flag
timblechmann authored
181 option(GC_SANITYCHECK "Enable sanity checks in the sclang garbage collector.")
162040d @timblechmann adapt cmake build system for supernova
timblechmann authored
182
c6f18e7 @danstowell cmake build improvements:
danstowell authored
183 option(NO_LIBSNDFILE "Disable soundfile functionality. (Not recommended.)" OFF)
184
364f0ac Fixes for the build system, to allow building scsynth/sclang in a bar…
tkatchev authored
185 option(NO_AVAHI "Disable Avahi support. (Not recommended.)" OFF)
186
ac7866f @jleben sclang: enable internal server on Windows
jleben authored
187 option(SCLANG_SERVER "Build with internal server." ON)
018a3b5 basic cmake-based build system:
Tim Blechmann authored
188
189 if(CMAKE_SYSTEM_NAME MATCHES "Linux")
2094b48 @timblechmann cmake: build sclang with wii support
timblechmann authored
190 option(SC_WII "Build sclang with WII support" ON)
191 endif()
192
f3f09b5 @jleben Accomodate QtCollider to new folder structure
jleben authored
193 option(SC_QT "Build SuperCollider with Qt GUI" ON)
464056c @jleben qtcollider: compile everything into libsclang and SC.app
jleben authored
194 if (SC_QT)
195 message( STATUS "Compiling with Qt GUI" )
196 endif (SC_QT)
b8c2383 @jleben Merge branch 'master' of git://supercollider.git.sourceforge.net/gitr…
jleben authored
197
3e0f7c6 @timblechmann cmake build system: build PySCLang from cmake
timblechmann authored
198 if(WIN32)
199 option(SC_PSYCOLLIDER "Build PsyCollider" ON)
200 else()
201 option(SC_PSYCOLLIDER "Build PsyCollider" OFF)
202 endif()
203
3b61c59 @jleben NSIS windows installer
jleben authored
204 if(WIN32)
205 option(SC_WIN_DEP_DIRS
206 "A list of directories where dependencies will be searched for when packaging.")
207 endif()
208
a4fd005 @timblechmann import cmake-based build system
timblechmann authored
209 if(CMAKE_COMPILER_IS_GNUCXX)
5f2498c @timblechmann cmake build system: improve documentation of NATIVE option
timblechmann authored
210 option(NATIVE "Optimize binary for this architecture (binaries may not run on other machines, requires gcc-4.3 or higher).")
78121f3 @timblechmann merge supernova/master into supernova
timblechmann authored
211 option(LTO "Use GCC's link time optimizer' (experimental).")
212 endif()
2ce0bbf @timblechmann libs: find pthread library & implrove boost.thread build
timblechmann authored
213
061c5b5 @miguel-negrao SC_SYMLINK_CLASSLIB cmake option
miguel-negrao authored
214 option(SC_SYMLINK_CLASSLIB "Place a symlink of SCCLassLibrary instead of copying" OFF)
1b925a6 @timblechmann cmake build system: conditionally enable c++0x support
timblechmann authored
215 option(SC_OX "Try to compile with support for C++0x (experimental, mainly related to supernova)" OFF)
061c5b5 @miguel-negrao SC_SYMLINK_CLASSLIB cmake option
miguel-negrao authored
216
78121f3 @timblechmann merge supernova/master into supernova
timblechmann authored
217 #############################################
218 # some preprocessor flags
da634c1 @timblechmann cmake build system: better clang++ support
timblechmann authored
219 if (CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_CLANG)
553b126 @timblechmann cmake build system: intel compiler support
timblechmann authored
220 if (SSE)
221 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -msse -mfpmath=sse")
222 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse -mfpmath=sse")
223 endif()
224 if (SSE41)
225 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -msse4.1")
226 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse4.1")
227 endif()
228 if (SSE42)
229 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -msse4.2")
230 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse4.2")
231 endif()
232 if (NATIVE)
233 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -march=native")
234 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=native")
235 endif()
1b925a6 @timblechmann cmake build system: conditionally enable c++0x support
timblechmann authored
236
237 if (SC_OX)
238 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
239 endif()
553b126 @timblechmann cmake build system: intel compiler support
timblechmann authored
240 endif()
241
242 if (CMAKE_COMPILER_IS_INTEL AND NOT WIN32)
243 if (SSE42)
244 add_definitions(-xSSE4.2)
245 elseif (SSE41)
246 add_definitions(-xSSE4.1)
247 elseif (SSE)
248 add_definitions(-mia32)
249 endif()
1b925a6 @timblechmann cmake build system: conditionally enable c++0x support
timblechmann authored
250 if (SC_OX)
251 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
252 endif()
e3c4ebe @timblechmann cmake build system: silence some warnings of the intel compiler
timblechmann authored
253
254 # disable warnings
255 add_definitions(-diag-disable 170) # pointer points outside of underlying object ... used heavily in sclang
256 add_definitions(-diag-disable 279) # controlling expression is constant
257
78121f3 @timblechmann merge supernova/master into supernova
timblechmann authored
258 endif()
259
2e13dde @timblechmann common: alloc pool - bypass memory pools with preprocessor definition
timblechmann authored
260 if (SC_MEMORY_DEBUGGING)
261 add_definitions(-DDISABLE_MEMORY_POOLS)
262 endif()
dadbb9f @timblechmann cmake build system: set gcc flags only when using gcc
timblechmann authored
263
c6f18e7 @danstowell cmake build improvements:
danstowell authored
264 #############################################
265 # subdirectories
28bb1c7 @timblechmann sclang: class library compilation - parallelize method table compression
timblechmann authored
266 add_subdirectory(external_libraries)
e6b75c5 @timblechmann reorganize cmake build system
timblechmann authored
267 add_subdirectory(server)
268 add_subdirectory(lang)
269 add_subdirectory(bindings)
270 add_subdirectory(editors)
3b61c59 @jleben NSIS windows installer
jleben authored
271 add_subdirectory(platform)
49de177 @timblechmann cmake build system: install headers on linux
timblechmann authored
272
922bc82 @danstowell cmake FreeBSD tweaks - initial and untested
danstowell authored
273 if(CMAKE_SYSTEM_NAME MATCHES "Linux" OR CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
2b0cbcd @timblechmann cmake build system: fix header installation
timblechmann authored
274 install(DIRECTORY include/common include/plugin_interface include/server include/lang
49de177 @timblechmann cmake build system: install headers on linux
timblechmann authored
275 DESTINATION ${CMAKE_INSTALL_PREFIX}/include/SuperCollider
2b0cbcd @timblechmann cmake build system: fix header installation
timblechmann authored
276 FILES_MATCHING PATTERN "*.h"
49de177 @timblechmann cmake build system: install headers on linux
timblechmann authored
277 )
278 endif()
f8d2ec0 @timblechmann initial cpack support
timblechmann authored
279
e6b75c5 @timblechmann reorganize cmake build system
timblechmann authored
280 if(APPLE)
281 # determines the app name and app install location (scappbundlename, scappdir):
282 include (cmake_modules/MacAppFolder.cmake)
283
284 set(auxresourcesdir ${scappauxresourcesdir})
285
286 # Some aux files which go in the app's folder
3ca0163 @lijon OSX: Bundle everything inside the .app, except examples/, README, Cha…
lijon authored
287 install(FILES README.txt ChangeLog COPYING AUTHORS platform/mac/MOVED_STUFF.txt
288 DESTINATION ${scappbundlename}
e6b75c5 @timblechmann reorganize cmake build system
timblechmann authored
289 )
7fe9de9 @timblechmann cmake build system: initial cpack support for windows
timblechmann authored
290 elseif (WIN32)
291 set(auxresourcesdir "SuperCollider")
e6b75c5 @timblechmann reorganize cmake build system
timblechmann authored
292 else()
293 set(auxresourcesdir "share/SuperCollider")
294 endif()
295
b0b5a4a @jleben cmake: do not install PsycolliderDocument.sc on Windows
jleben authored
296 set(SCCLASSLIB_EXCLUDE_REGEX "IGNOREME")
297
1e5135d @jleben cmake: if not building QtCollider do not install its SC classes
jleben authored
298 if(NOT SC_QT)
b0b5a4a @jleben cmake: do not install PsycolliderDocument.sc on Windows
jleben authored
299 set(SCCLASSLIB_EXCLUDE_REGEX "${SCCLASSLIB_EXCLUDE_REGEX}|QtCollider")
300 endif()
301
302 if(WIN32)
303 set(SCCLASSLIB_EXCLUDE_REGEX "${SCCLASSLIB_EXCLUDE_REGEX}|PsycolliderDocument")
1e5135d @jleben cmake: if not building QtCollider do not install its SC classes
jleben authored
304 endif()
305
b0b5a4a @jleben cmake: do not install PsycolliderDocument.sc on Windows
jleben authored
306
061c5b5 @miguel-negrao SC_SYMLINK_CLASSLIB cmake option
miguel-negrao authored
307 if(APPLE)
308
309 if(SC_SYMLINK_CLASSLIB)
310
311 #if there are folders inside SCCLassLibrary abort cmake.
4605df2 @miguel-negrao OSX: Fix cmake -DSC_SYMLINK_CLASSLIB=ON and add symlink for HelpSourc…
miguel-negrao authored
312 file(GLOB classlibraryfolders "${CMAKE_INSTALL_PREFIX}/${auxresourcesdir}/SCClassLibrary/[^.]*")
061c5b5 @miguel-negrao SC_SYMLINK_CLASSLIB cmake option
miguel-negrao authored
313 foreach(onedirectory ${classlibraryfolders})
4605df2 @miguel-negrao OSX: Fix cmake -DSC_SYMLINK_CLASSLIB=ON and add symlink for HelpSourc…
miguel-negrao authored
314 message( "${onedirectory}" )
061c5b5 @miguel-negrao SC_SYMLINK_CLASSLIB cmake option
miguel-negrao authored
315 if(NOT IS_SYMLINK "${onedirectory}")
316 message(FATAL_ERROR "Symlinking will fail ! SCClassLibrary folder already exists and has directories inside, please delete it first." )
317 endif()
318 endforeach(onedirectory)
319
4605df2 @miguel-negrao OSX: Fix cmake -DSC_SYMLINK_CLASSLIB=ON and add symlink for HelpSourc…
miguel-negrao authored
320 message(STATUS "Will create symlink of SCClassLibrary to ${CMAKE_INSTALL_PREFIX}/${auxresourcesdir}/SCClassLibrary" )
321 if(NOT EXISTS "{CMAKE_INSTALL_PREFIX}/${auxresourcesdir}/SCClassLibrary")
322 install( CODE "EXECUTE_PROCESS(COMMAND mkdir ${CMAKE_INSTALL_PREFIX}/${auxresourcesdir}/SCClassLibrary)" )
061c5b5 @miguel-negrao SC_SYMLINK_CLASSLIB cmake option
miguel-negrao authored
323 endif()
324 #symlink the folders inside SCCLassLibrary. Check if QtCollider folder should be symlinked or not.
325 file(GLOB classlibraryfolders RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}/SCClassLibrary" "SCClassLibrary/[^.]*")
326 foreach(onedirectory ${classlibraryfolders})
327 if(NOT "${onedirectory}" MATCHES "${SCCLASSLIB_EXCLUDE_REGEX}")
328 install( CODE
4605df2 @miguel-negrao OSX: Fix cmake -DSC_SYMLINK_CLASSLIB=ON and add symlink for HelpSourc…
miguel-negrao authored
329 "EXECUTE_PROCESS(COMMAND ln -shF ${CMAKE_CURRENT_SOURCE_DIR}/SCClassLibrary/${onedirectory} ${CMAKE_INSTALL_PREFIX}/${auxresourcesdir}/SCClassLibrary/${onedirectory} )" )
061c5b5 @miguel-negrao SC_SYMLINK_CLASSLIB cmake option
miguel-negrao authored
330 endif()
331 endforeach(onedirectory)
332 else()
cb7bda3 @lijon osx: standalone build fixes
lijon authored
333 message(STATUS "Will copy SCCLassLibrary to ${CMAKE_INSTALL_PREFIX}/${auxresourcesdir}")
4605df2 @miguel-negrao OSX: Fix cmake -DSC_SYMLINK_CLASSLIB=ON and add symlink for HelpSourc…
miguel-negrao authored
334
335 #if directory contains symlinks, unlink them.
336 if(EXISTS "${CMAKE_INSTALL_PREFIX}/${auxresourcesdir}/SCClassLibrary")
337 file(GLOB classlibraryfolders "${CMAKE_INSTALL_PREFIX}/${auxresourcesdir}/SCClassLibrary/[^.]*")
338 foreach(onedirectory ${classlibraryfolders})
339 if(IS_SYMLINK "${onedirectory}")
340 message(STATUS "Unlinking ${onedirectory}")
341 install( CODE "EXECUTE_PROCESS(COMMAND unlink ${onedirectory} )" )
342 endif()
343 endforeach(onedirectory)
344 endif()
345
061c5b5 @miguel-negrao SC_SYMLINK_CLASSLIB cmake option
miguel-negrao authored
346 install(DIRECTORY SCClassLibrary
347 DESTINATION ${auxresourcesdir}
348 REGEX ${SCCLASSLIB_EXCLUDE_REGEX} EXCLUDE
349 )
350 endif()
351 else()
352 install(DIRECTORY SCClassLibrary
353 DESTINATION ${auxresourcesdir}
354 REGEX ${SCCLASSLIB_EXCLUDE_REGEX} EXCLUDE
5fc0cd7 @timblechmann cmake build system: avoid installation of temporary files
timblechmann authored
355 PATTERN "*~" EXCLUDE
356 PATTERN "*#" EXCLUDE
061c5b5 @miguel-negrao SC_SYMLINK_CLASSLIB cmake option
miguel-negrao authored
357 )
358 endif()
359
06a604c @lijon Move configured SCVersion.sc -> SCVersion/SCVersion.sc
lijon authored
360 configure_file(platform/SCVersion.sc.in SCVersion/SCVersion.sc)
361 install(DIRECTORY "${CMAKE_BINARY_DIR}/SCVersion" DESTINATION "${auxresourcesdir}/SCClassLibrary")
e6b75c5 @timblechmann reorganize cmake build system
timblechmann authored
362
09f875d @danstowell cmake option INSTALL_HELP added
danstowell authored
363 install(DIRECTORY sounds
85f080a @timblechmann cmake build system: compile scdoc html files from build system
timblechmann authored
364 DESTINATION ${auxresourcesdir}
365 )
5b43805 @timblechmann cmake build system: add command line flag to avoid installing old help
timblechmann authored
366
3ca0163 @lijon OSX: Bundle everything inside the .app, except examples/, README, Cha…
lijon authored
367 if(APPLE AND ("${standalone}" STREQUAL ""))
368 set(exampledir "${scappbundlename}")
369 else()
370 set(exampledir "${auxresourcesdir}")
371 endif()
372
373 install(DIRECTORY examples
374 DESTINATION ${exampledir}
375 PATTERN "*~" EXCLUDE
376 PATTERN "*#" EXCLUDE
377 )
378
5b43805 @timblechmann cmake build system: add command line flag to avoid installing old help
timblechmann authored
379 if(INSTALL_OLD_HELP)
380 install(DIRECTORY Help
381 DESTINATION ${auxresourcesdir}
382 )
383 endif()
384
09f875d @danstowell cmake option INSTALL_HELP added
danstowell authored
385 if(INSTALL_HELP)
4605df2 @miguel-negrao OSX: Fix cmake -DSC_SYMLINK_CLASSLIB=ON and add symlink for HelpSourc…
miguel-negrao authored
386 if(SC_SYMLINK_CLASSLIB AND APPLE)
387 message(STATUS "Will create symlink of HelpSource to ${CMAKE_INSTALL_PREFIX}/${auxresourcesdir}/HelpSource")
388 if(EXISTS "${CMAKE_INSTALL_PREFIX}/${auxresourcesdir}/HelpSource")
389 message(FATAL_ERROR "Symlinking will fail ! HelpSource folder already exists, please delete it first." )
390 endif()
391 install( CODE
392 "EXECUTE_PROCESS(COMMAND ln -shF ${CMAKE_CURRENT_SOURCE_DIR}/HelpSource ${CMAKE_INSTALL_PREFIX}/${auxresourcesdir}/HelpSource )" )
393 else()
cb7bda3 @lijon osx: standalone build fixes
lijon authored
394 message(STATUS "Will copy HelpSource to ${CMAKE_INSTALL_PREFIX}/${auxresourcesdir}")
4605df2 @miguel-negrao OSX: Fix cmake -DSC_SYMLINK_CLASSLIB=ON and add symlink for HelpSourc…
miguel-negrao authored
395 if(APPLE)
396 if(EXISTS "${CMAKE_INSTALL_PREFIX}/${auxresourcesdir}/HelpSource")
397 if(IS_SYMLINK "${CMAKE_INSTALL_PREFIX}/${auxresourcesdir}/HelpSource")
398 message(STATUS "Unlinking ${CMAKE_INSTALL_PREFIX}/${auxresourcesdir}/HelpSource")
399 install( CODE "EXECUTE_PROCESS(COMMAND unlink ${CMAKE_INSTALL_PREFIX}/${auxresourcesdir}/HelpSource )" )
400 endif()
401 endif()
402 endif()
3ca0163 @lijon OSX: Bundle everything inside the .app, except examples/, README, Cha…
lijon authored
403 install(DIRECTORY HelpSource
4605df2 @miguel-negrao OSX: Fix cmake -DSC_SYMLINK_CLASSLIB=ON and add symlink for HelpSourc…
miguel-negrao authored
404 DESTINATION ${auxresourcesdir}
405 PATTERN "*~" EXCLUDE
406 PATTERN "*#" EXCLUDE
407 )
408 endif()
09f875d @danstowell cmake option INSTALL_HELP added
danstowell authored
409 endif()
85f080a @timblechmann cmake build system: compile scdoc html files from build system
timblechmann authored
410
411 #############################################
412 #
413 # build scdoc help files
414 #
1da40fe @lijon build entire BUILD_CLASSLIBRARYPATH in cmake instead of having one va…
lijon authored
415 list(APPEND BUILD_CLASSLIBRARIES "${CMAKE_CURRENT_SOURCE_DIR}/SCClassLibrary/Common")
416 list(APPEND BUILD_CLASSLIBRARIES "${CMAKE_CURRENT_SOURCE_DIR}/SCClassLibrary/Platform")
417 list(APPEND BUILD_CLASSLIBRARIES "${CMAKE_CURRENT_SOURCE_DIR}/SCClassLibrary/SCDoc")
418 list(APPEND BUILD_CLASSLIBRARIES "${CMAKE_CURRENT_SOURCE_DIR}/SCClassLibrary/DefaultLibrary")
419 list(APPEND BUILD_CLASSLIBRARIES "${CMAKE_CURRENT_SOURCE_DIR}/SCClassLibrary/JITLib")
420 list(APPEND BUILD_CLASSLIBRARIES "${CMAKE_CURRENT_SOURCE_DIR}/SCClassLibrary/backwards_compatibility")
421
86362b3 @lijon disable loading of startup files when building docs in make install
lijon authored
422 # this folder has an extension to Platform that disables the loadStartupFiles method
423 list(APPEND BUILD_CLASSLIBRARIES "${CMAKE_CURRENT_SOURCE_DIR}/platform/disable_startup_files")
424
1da40fe @lijon build entire BUILD_CLASSLIBRARYPATH in cmake instead of having one va…
lijon authored
425 foreach(arg ${BUILD_CLASSLIBRARIES})
426 set(BUILD_CLASSLIBRARYPATH "${BUILD_CLASSLIBRARYPATH}+${arg}\n")
427 endforeach()
85f080a @timblechmann cmake build system: compile scdoc html files from build system
timblechmann authored
428
429 configure_file(build_sclang.cfg.in ${CMAKE_CURRENT_BINARY_DIR}/build_sclang.cfg)
430
6fc0c39 @lijon Renamed HelpBase to RenderedHelp and other related tweaks in cmakelis…
lijon authored
431 if(SC_DOC_RENDER)
90cd7d9 @timblechmann cmake build system: make scdoc generation optional
timblechmann authored
432 file(GLOB_RECURSE SCDocSources RELATIVE HelpSource .*[^~])
433 file(GLOB_RECURSE SCDocClasses RELATIVE SCClassLibrary/SCDoc *.sc)
85f080a @timblechmann cmake build system: compile scdoc html files from build system
timblechmann authored
434
90cd7d9 @timblechmann cmake build system: make scdoc generation optional
timblechmann authored
435 add_custom_target(doc ALL
cc0d02d @timblechmann cmake build system: scdoc generation - fix sclang binary name
timblechmann authored
436 COMMAND ${CMAKE_CURRENT_BINARY_DIR}/lang/sclang${CMAKE_EXECUTABLE_SUFFIX}
90cd7d9 @timblechmann cmake build system: make scdoc generation optional
timblechmann authored
437 -l ${CMAKE_CURRENT_BINARY_DIR}/build_sclang.cfg
6fc0c39 @lijon Renamed HelpBase to RenderedHelp and other related tweaks in cmakelis…
lijon authored
438 platform/renderAllHelp.scd ${CMAKE_CURRENT_SOURCE_DIR}/HelpSource ${CMAKE_CURRENT_BINARY_DIR}/RenderedHelp
90cd7d9 @timblechmann cmake build system: make scdoc generation optional
timblechmann authored
439 WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
440 DEPENDS sclang ${SCDocSources} ${SCDocClasses})
85f080a @timblechmann cmake build system: compile scdoc html files from build system
timblechmann authored
441
90cd7d9 @timblechmann cmake build system: make scdoc generation optional
timblechmann authored
442 endif()
85f080a @timblechmann cmake build system: compile scdoc html files from build system
timblechmann authored
443
444 set_directory_properties(
445 PROPERTIES
6fc0c39 @lijon Renamed HelpBase to RenderedHelp and other related tweaks in cmakelis…
lijon authored
446 ADDITIONAL_MAKE_CLEAN_FILES "RenderedHelp")
85f080a @timblechmann cmake build system: compile scdoc html files from build system
timblechmann authored
447
f8d2ec0 @timblechmann initial cpack support
timblechmann authored
448 #############################################
c9e9f92 @timblechmann testsuite: basic testsuite support
timblechmann authored
449 #
450 # testsuite
451 #
452 add_subdirectory(testsuite)
453
454 #############################################
f8d2ec0 @timblechmann initial cpack support
timblechmann authored
455 # CPack support
456
8081c23 @lijon Improve setting of current SC version.
lijon authored
457 set(CPACK_PACKAGE_VERSION_MAJOR ${PROJECT_VERSION_MAJOR})
458 set(CPACK_PACKAGE_VERSION_MINOR ${PROJECT_VERSION_MINOR})
459 set(CPACK_PACKAGE_VERSION_PATCH ${PROJECT_VERSION_PATCH})
2b7b6be @lijon Fix DMG icon and background. CPACK variables need to be set before in…
lijon authored
460
461 if(APPLE)
462 set(CPACK_GENERATOR "DragNDrop")
463 set(CPACK_DMG_FORMAT "UDBZ")
464 set(CPACK_DMG_VOLUME_NAME "${scappbundlename}")
465 set(CPACK_SYSTEM_NAME "OSX")
466 # set(CPACK_PACKAGE_FILE_NAME "${scappbundlename}-${PROJECT_VERSION}")
467 set(CPACK_DMG_DS_STORE "${CMAKE_SOURCE_DIR}/package/ds_store")
468 set(CPACK_DMG_BACKGROUND_IMAGE "${CMAKE_SOURCE_DIR}/package/background.png")
469 set(CPACK_PACKAGE_ICON "${CMAKE_SOURCE_DIR}/platform/mac/Resources/SCcube.icns")
7fe9de9 @timblechmann cmake build system: initial cpack support for windows
timblechmann authored
470 endif()
3b61c59 @jleben NSIS windows installer
jleben authored
471
472 if(NOT WIN32) # We define a custom 'package' target in platform/windows/CMakeLists.txt
473 include(CPack)
474 endif()
703125e @timblechmann cmake build system: hide some advanced variables
timblechmann authored
475
476 #############################################
477 # hide advanced variables
478 mark_as_advanced(AVAHI_LIBRARIES AVAHI_INCLUDE_DIRS AVAHI_INCLUDE_DIR AVAHI_LIBRARY-COMMON AVAHI_LIBRARY-CLIENT)
479 mark_as_advanced(DL)
480 mark_as_advanced(EMACS_EXECUTABLE)
481 mark_as_advanced(FFTW3F_INCLUDE_DIR FFTW3F_LIBRARY)
482 mark_as_advanced(JACK JACK_INCLUDE_DIR JACK_LIBRARY)
483 mark_as_advanced(MATH_LIBRARY)
484 mark_as_advanced(QT_QMAKE_EXECUTABLE)
485 mark_as_advanced(SNDFILE)
486
Something went wrong with that request. Please try again.