1 cmake_minimum_required( VERSION 2.8 )
3 find_package(Qt4 REQUIRED)
5 if(${CMAKE_COMPILER_IS_GNUCXX})
6 add_definitions(-Wreorder)
10 include (${CMAKE_SOURCE_DIR}/cmake_modules/MacAppFolder.cmake)
11 set(ide_name ${scappbundlename})
22 core/settings/manager.hpp
23 core/session_manager.hpp
26 widgets/documents_dialog.hpp
27 widgets/editor_box.hpp
28 widgets/find_replace_tool.hpp
29 widgets/goto_line_tool.hpp
30 widgets/lookup_dialog.hpp
31 widgets/main_window.hpp
32 widgets/multi_editor.hpp
33 widgets/popup_text_input.hpp
34 widgets/post_window.hpp
35 widgets/session_switch_dialog.hpp
36 widgets/sessions_dialog.hpp
38 widgets/code_editor/editor.hpp
39 widgets/code_editor/highlighter.hpp
40 widgets/code_editor/line_indicator.hpp
41 widgets/code_editor/overlay.hpp
42 widgets/code_editor/autocompleter.hpp
43 widgets/settings/dialog.hpp
44 widgets/settings/general_page.hpp
45 widgets/settings/sclang_page.hpp
46 widgets/settings/editor_page.hpp
47 widgets/settings/shortcuts_page.hpp
48 widgets/util/path_chooser_widget.hpp
49 widgets/util/text_format_list_widget.hpp
50 widgets/util/key_sequence_edit.hpp
51 widgets/util/popup_widget.hpp
52 widgets/util/color_widget.hpp
55 file (GLOB_RECURSE all_hdr *hpp)
63 core/sc_introspection.cpp
64 core/settings/serialization.cpp
65 core/settings/manager.cpp
66 core/session_manager.cpp
69 widgets/documents_dialog.cpp
70 widgets/editor_box.cpp
71 widgets/find_replace_tool.cpp
72 widgets/lookup_dialog.cpp
73 widgets/main_window.cpp
74 widgets/multi_editor.cpp
75 widgets/post_window.cpp
76 widgets/session_switch_dialog.cpp
77 widgets/code_editor/editor.cpp
78 widgets/code_editor/highlighter.cpp
79 widgets/code_editor/line_indicator.cpp
80 widgets/code_editor/overlay.cpp
81 widgets/code_editor/autocompleter.cpp
82 widgets/settings/dialog.cpp
83 widgets/settings/general_page.cpp
84 widgets/settings/sclang_page.cpp
85 widgets/settings/editor_page.cpp
86 widgets/settings/shortcuts_page.cpp
87 widgets/util/text_format_list_widget.cpp
88 widgets/util/popup_widget.cpp
90 ${CMAKE_SOURCE_DIR}/common/SC_TextUtils.cpp
94 forms/settings_dialog.ui
95 forms/settings_general.ui
96 forms/settings_sclang.ui
97 forms/settings_editor.ui
98 forms/settings_shortcuts.ui
103 translations/scide_de.ts
104 translations/scide_es.ts
105 translations/scide_fr.ts
106 translations/scide_ja.ts
107 translations/scide_pt.ts
108 translations/scide_ru.ts
109 translations/scide_sl.ts
110 translations/scide_sv.ts
111 translations/scide_zh.ts
114 # QtCollider shared sources:
115 list(APPEND ide_moc_hdr
116 ${CMAKE_SOURCE_DIR}/QtCollider/layouts/stack_layout.hpp
119 ${CMAKE_SOURCE_DIR}/QtCollider/layouts/stack_layout.cpp
122 QT4_ADD_TRANSLATION( translations_src ${translations} )
124 list(APPEND ide_src ${CMAKE_SOURCE_DIR}/common/SC_DirUtils.cpp)
127 list(APPEND ide_src ${CMAKE_SOURCE_DIR}/common/SC_StandAloneInfo_Darwin.cpp)
129 list(APPEND ide_src ${CMAKE_SOURCE_DIR}/common/SC_Win32Utils.cpp)
132 include_directories(${CMAKE_SOURCE_DIR}/include/common)
133 include_directories(${CMAKE_SOURCE_DIR}/include/plugin_interface)
134 include_directories(${CMAKE_SOURCE_DIR}/external_libraries/yaml-cpp-0.3.0/include)
135 include_directories(${CMAKE_SOURCE_DIR}/external_libraries/boost)
136 # For QtCollider headers:
137 include_directories(${CMAKE_SOURCE_DIR})
138 # Needed for auto-generated forms headers:
139 include_directories(${CMAKE_CURRENT_SOURCE_DIR}/widgets/util)
140 include_directories(${CMAKE_CURRENT_SOURCE_DIR}/widgets)
141 include_directories(${CMAKE_CURRENT_BINARY_DIR})
143 include( ${QT_USE_FILE} )
145 qt4_wrap_cpp( ide_moc_src ${ide_moc_hdr} )
146 qt4_wrap_ui( ide_forms_src ${ide_forms} )
147 qt4_add_resources( ide_rcc resources.qrc )
149 set(ide_sources ${ide_src} ${all_hdr} )
151 set(ide_rc_sources ${ide_moc_src} ${ide_forms_src} ${ide_rcc} ${translations_src})
154 CREATE_FINAL_FILE(scide_final.cpp ${ide_sources})
155 add_executable( ${ide_name} MACOSX_BUNDLE scide_final.cpp ${ide_rc_sources} )
157 add_executable( ${ide_name} MACOSX_BUNDLE ${ide_sources} ${ide_rc_sources} )
161 target_link_libraries( ${ide_name} ${QT_LIBRARIES} ${QT_QTNETWORK_LIBRARY} yaml)
164 target_link_libraries( ${ide_name} "-framework CoreServices")
166 target_link_libraries( ${ide_name} wsock32 )
167 # The following prevents a Windows console from showing up
168 # when the executable is started:
169 set_target_properties( ${ide_name} PROPERTIES WIN32_EXECUTABLE TRUE )
173 target_link_libraries(${ide_name} ${PTHREADS_LIBRARIES})
177 set_property(TARGET ${ide_name}
178 APPEND PROPERTY COMPILE_FLAGS "-flto -flto-report")
180 set_property(TARGET ${ide_name}
181 APPEND PROPERTY LINK_FLAGS "-flto -flto-report -fwhole-program")
188 if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
189 set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/Install" CACHE PATH "Install path prefix" FORCE)
192 # set how it shows up in the Info.plist file
193 SET(MACOSX_BUNDLE_ICON_FILE ../../platform/mac/SCcube.icns)
195 install(DIRECTORY ../../platform/mac/Resources/ DESTINATION ${scappauxresourcesdir})
197 install(TARGETS ${ide_name}
198 DESTINATION ${scappbundlename}
201 # for processing into the plist:
202 set_property(TARGET ${ide_name}
203 PROPERTY MACOSX_BUNDLE_BUNDLE_NAME ${scappbundlename})
205 set(MACOSX_BUNDLE_BUNDLE_NAME "${scappbundlename}")
207 include(InstallRequiredSystemLibraries)
210 install_qt4_executable("${scappbundlename}/${scappbundlename}.app" "" "" "${CMAKE_BINARY_DIR}/server/scsynth;${CMAKE_BINARY_DIR}/external_libraries")
213 install(TARGETS ${ide_name}
214 DESTINATION "SuperCollider"
215 PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
217 install(TARGETS ${ide_name}
218 RUNTIME DESTINATION "bin"
219 PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
223 install( PROGRAMS SuperColliderIDE.desktop DESTINATION "share/applications")