Permalink
Browse files

qtcollider: compile everything into libsclang and SC.app

  • Loading branch information...
1 parent c7fee4b commit 464056c0da2803b12313b9509fedc9a171910a6b @jleben jleben committed Nov 17, 2011
Showing with 88 additions and 135 deletions.
  1. +3 −5 CMakeLists.txt
  2. +67 −101 QtCollider/CMakeLists.txt
  3. +1 −0 QtCollider/LanguageClient.cpp
  4. +1 −1 include/QtCollider/QtCollider.h
  5. +9 −21 lang/CMakeLists.txt
  6. +7 −7 platform/mac/CMakeLists.txt
View
8 CMakeLists.txt
@@ -193,6 +193,9 @@ if(CMAKE_SYSTEM_NAME MATCHES "Linux")
endif()
option(SC_QT "Build SuperCollider with Qt GUI" ON)
+if (SC_QT)
+ message( STATUS "Compiling with Qt GUI" )
+endif (SC_QT)
if(WIN32)
option(SC_PSYCOLLIDER "Build PsyCollider" ON)
@@ -264,11 +267,6 @@ add_subdirectory(bindings)
add_subdirectory(platform)
add_subdirectory(editors)
-if (SC_QT)
- message( STATUS "Compiling with Qt GUI" )
- add_subdirectory(QtCollider)
-endif (SC_QT)
-
if(CMAKE_SYSTEM_NAME MATCHES "Linux" OR CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
install(DIRECTORY include/common include/plugin_interface include/server include/lang
DESTINATION ${CMAKE_INSTALL_PREFIX}/include/SuperCollider
View
168 QtCollider/CMakeLists.txt
@@ -7,137 +7,103 @@ if (NOT QT4_FOUND)
" (add -DSC_QT=OFF to the cmake command line).")
endif()
-find_package (Sndfile REQUIRED)
-
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DQC_DEBUG")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DQC_DEBUG")
+set(QT_COLLIDER_DIR ${CMAKE_SOURCE_DIR}/QtCollider)
+
set( QT_COLLIDER_HDRS
- QcApplication.h
- QObjectProxy.h
- QWidgetProxy.h
- widgets/BasicWidgets.h
- widgets/QcTreeWidget.h
- widgets/QcScrollArea.h
- widgets/QcNumberBox.h
- widgets/QcSlider.h
- widgets/QcSlider2D.h
- widgets/QcRangeSlider.h
- widgets/QcMultiSlider.h
- widgets/QcTextEdit.h
- widgets/QcScope.h
- widgets/QcGraph.h
- widgets/QcLevelIndicator.h
- widgets/QcCanvas.h
- widgets/QcSoundFileView.h
- widgets/QcFileDialog.h
- widgets/QcWebView.h
- widgets/QcWindow.h
- layouts/layouts.hpp
+ ${QT_COLLIDER_DIR}/QcApplication.h
+ ${QT_COLLIDER_DIR}/QObjectProxy.h
+ ${QT_COLLIDER_DIR}/QWidgetProxy.h
+ ${QT_COLLIDER_DIR}/widgets/BasicWidgets.h
+ ${QT_COLLIDER_DIR}/widgets/QcTreeWidget.h
+ ${QT_COLLIDER_DIR}/widgets/QcScrollArea.h
+ ${QT_COLLIDER_DIR}/widgets/QcNumberBox.h
+ ${QT_COLLIDER_DIR}/widgets/QcSlider.h
+ ${QT_COLLIDER_DIR}/widgets/QcSlider2D.h
+ ${QT_COLLIDER_DIR}/widgets/QcRangeSlider.h
+ ${QT_COLLIDER_DIR}/widgets/QcMultiSlider.h
+ ${QT_COLLIDER_DIR}/widgets/QcTextEdit.h
+ ${QT_COLLIDER_DIR}/widgets/QcScope.h
+ ${QT_COLLIDER_DIR}/widgets/QcGraph.h
+ ${QT_COLLIDER_DIR}/widgets/QcLevelIndicator.h
+ ${QT_COLLIDER_DIR}/widgets/QcCanvas.h
+ ${QT_COLLIDER_DIR}/widgets/QcSoundFileView.h
+ ${QT_COLLIDER_DIR}/widgets/QcFileDialog.h
+ ${QT_COLLIDER_DIR}/widgets/QcWebView.h
+ ${QT_COLLIDER_DIR}/widgets/QcWindow.h
+ ${QT_COLLIDER_DIR}/layouts/layouts.hpp
)
set( QT_COLLIDER_SRCS
- debug.cpp
- interface.cpp
- QcApplication.cpp
- Common.cpp
- QObjectProxy.cpp
- QWidgetProxy.cpp
- Slot.cpp
- QcObjectFactory.cpp
- hacks/hacks_x11.cpp
- primitives/primitives.cpp
- primitives/prim_QObject.cpp
- primitives/prim_QPen.cpp
- primitives/prim_misc.cpp
- primitives/prim_QWidget.cpp
- widgets/BasicWidgets.cpp
- widgets/QcTreeWidget.cpp
- widgets/QcScrollArea.cpp
- widgets/QcAbstractStepValue.cpp
- widgets/QcNumberBox.cpp
- widgets/QcSlider.cpp
- widgets/QcSlider2D.cpp
- widgets/QcRangeSlider.cpp
- widgets/QcMultiSlider.cpp
- widgets/QcTextEdit.cpp
- widgets/QcScope.cpp
- widgets/QcLevelIndicator.cpp
- widgets/QcWindow.cpp
- widgets/QcGraph.cpp
- widgets/QcCanvas.cpp
- widgets/QcSoundFileView.cpp
- widgets/QcFileDialog.cpp
- widgets/QcWebView.cpp
- layouts/classic_layouts.cpp
- layouts/layouts.cpp
- style/ProxyStyle.cpp
+ ${QT_COLLIDER_DIR}/debug.cpp
+ ${QT_COLLIDER_DIR}/interface.cpp
+ ${QT_COLLIDER_DIR}/QcApplication.cpp
+ ${QT_COLLIDER_DIR}/Common.cpp
+ ${QT_COLLIDER_DIR}/QObjectProxy.cpp
+ ${QT_COLLIDER_DIR}/QWidgetProxy.cpp
+ ${QT_COLLIDER_DIR}/Slot.cpp
+ ${QT_COLLIDER_DIR}/QcObjectFactory.cpp
+ ${QT_COLLIDER_DIR}/hacks/hacks_x11.cpp
+ ${QT_COLLIDER_DIR}/primitives/primitives.cpp
+ ${QT_COLLIDER_DIR}/primitives/prim_QObject.cpp
+ ${QT_COLLIDER_DIR}/primitives/prim_QPen.cpp
+ ${QT_COLLIDER_DIR}/primitives/prim_misc.cpp
+ ${QT_COLLIDER_DIR}/primitives/prim_QWidget.cpp
+ ${QT_COLLIDER_DIR}/widgets/BasicWidgets.cpp
+ ${QT_COLLIDER_DIR}/widgets/QcTreeWidget.cpp
+ ${QT_COLLIDER_DIR}/widgets/QcScrollArea.cpp
+ ${QT_COLLIDER_DIR}/widgets/QcAbstractStepValue.cpp
+ ${QT_COLLIDER_DIR}/widgets/QcNumberBox.cpp
+ ${QT_COLLIDER_DIR}/widgets/QcSlider.cpp
+ ${QT_COLLIDER_DIR}/widgets/QcSlider2D.cpp
+ ${QT_COLLIDER_DIR}/widgets/QcRangeSlider.cpp
+ ${QT_COLLIDER_DIR}/widgets/QcMultiSlider.cpp
+ ${QT_COLLIDER_DIR}/widgets/QcTextEdit.cpp
+ ${QT_COLLIDER_DIR}/widgets/QcScope.cpp
+ ${QT_COLLIDER_DIR}/widgets/QcLevelIndicator.cpp
+ ${QT_COLLIDER_DIR}/widgets/QcWindow.cpp
+ ${QT_COLLIDER_DIR}/widgets/QcGraph.cpp
+ ${QT_COLLIDER_DIR}/widgets/QcCanvas.cpp
+ ${QT_COLLIDER_DIR}/widgets/QcSoundFileView.cpp
+ ${QT_COLLIDER_DIR}/widgets/QcFileDialog.cpp
+ ${QT_COLLIDER_DIR}/widgets/QcWebView.cpp
+ ${QT_COLLIDER_DIR}/layouts/classic_layouts.cpp
+ ${QT_COLLIDER_DIR}/layouts/layouts.cpp
+ ${QT_COLLIDER_DIR}/style/ProxyStyle.cpp
)
+if(QT_COLLIDER_LANG_CLIENT)
+ list(APPEND QT_COLLIDER_HDRS ${QT_COLLIDER_DIR}/LanguageClient.h)
+ list(APPEND QT_COLLIDER_SRCS ${QT_COLLIDER_DIR}/LanguageClient.cpp)
+endif()
+
set( QT_USE_QTWEBKIT TRUE )
include(${QT_USE_FILE})
set( SC_HEADERS_DIR "${CMAKE_SOURCE_DIR}/include" )
include_directories(
- .
"${SC_HEADERS_DIR}/QtCollider"
- "${SC_HEADERS_DIR}/common"
- "${SC_HEADERS_DIR}/lang"
- "${SC_HEADERS_DIR}/server"
- "${SC_HEADERS_DIR}/plugin_interface"
- ${SNDFILE_INCLUDE_DIR}
)
qt4_wrap_cpp( QT_COLLIDER_MOC_SRCS ${QT_COLLIDER_HDRS} )
-add_library( QtCollider SHARED ${QT_COLLIDER_SRCS} ${QT_COLLIDER_MOC_SRCS} )
-
-add_definitions( -DQT_NO_KEYWORDS )
-if(NOT SCLANG_SERVER)
- add_definitions( -DNO_INTERNAL_SERVER )
-endif(NOT SCLANG_SERVER)
+list( APPEND QT_COLLIDER_SRCS ${QT_COLLIDER_MOC_SRCS} )
-if(APPLE)
- set_property(
- TARGET QtCollider
- APPEND PROPERTY LINK_FLAGS "-undefined dynamic_lookup"
- )
-endif(APPLE)
-
-set_property ( TARGET QtCollider
- APPEND PROPERTY COMPILE_DEFINITIONS QT_COLLIDER_EXPORTING )
-
-target_link_libraries( QtCollider ${QT_LIBRARIES} ${MATH_LIBRARY})
+add_definitions(-DSC_QT -DQT_COLLIDER_EXPORTING -DQT_NO_KEYWORDS)
+set (QT_COLLIDER_LIBS ${QT_LIBRARIES} ${MATH_LIBRARY})
if (CMAKE_SYSTEM_NAME MATCHES "Linux")
find_package(X11)
if(X11_FOUND)
include_directories(X11_INCLUDE_DIR)
- target_link_libraries( QtCollider ${X11_X11_LIB})
+ list(APPEND QT_COLLIDER_LIBS ${X11_X11_LIB})
elseif()
message(SEND_ERROR "Cannot find libx11")
endif()
endif()
-
-if(APPLE)
- # determines the app name and app install location (scappbundlename, scappdir):
- include (${CMAKE_SOURCE_DIR}/cmake_modules/MacAppFolder.cmake)
-
- install(TARGETS QtCollider
- DESTINATION ${scappauxresourcesdir}
- PERMISSIONS OWNER_READ OWNER_EXECUTE
- GROUP_READ GROUP_EXECUTE
- WORLD_READ WORLD_EXECUTE
- OWNER_WRITE
- COMPONENT app)
-else()
- install(TARGETS QtCollider
- DESTINATION "lib"
- PERMISSIONS OWNER_READ OWNER_EXECUTE OWNER_WRITE
- GROUP_READ GROUP_EXECUTE
- WORLD_READ WORLD_EXECUTE )
-endif()
View
1 QtCollider/LanguageClient.cpp
@@ -29,6 +29,7 @@ extern double elapsedTime();
using namespace QtCollider;
+QC_PUBLIC
int QtCollider::run(int argc, char** argv) {
QtCollider::LangClient app("sclang");
return app.run(argc, argv);
View
2 include/QtCollider/QtCollider.h
@@ -7,7 +7,7 @@ namespace QtCollider {
QC_PUBLIC void initPrimitives ();
QC_PUBLIC void init();
QC_PUBLIC int exec(int argc, char** argv);
- int run(int argc, char** argv);
+ QC_PUBLIC int run(int argc, char** argv);
}
#endif // QT_COLLIDER_H
View
30 lang/CMakeLists.txt
@@ -5,11 +5,6 @@ else()
find_package(FFTW3f)
endif()
-if(SC_QT)
- set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DQC_DEBUG")
- set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DQC_DEBUG")
-endif()
-
include_directories(${CMAKE_SOURCE_DIR}/include/common
${CMAKE_SOURCE_DIR}/include/lang
${CMAKE_SOURCE_DIR}/external_libraries/boost_lockfree
@@ -180,18 +175,11 @@ if (SC_WII OR APPLE)
endif()
endif()
-if (SC_QT)
- find_package (Qt4 4.5)
- include(${QT_USE_FILE})
-
- add_definitions(-DSC_QT -DQT_NO_KEYWORDS)
- include_directories(${CMAKE_SOURCE_DIR}/include/QtCollider)
-
- qt4_wrap_cpp( QC_LANG_CLIENT_MOC_SRCS ../QtCollider/LanguageClient.h )
-
- list(APPEND sclang_sources ../QtCollider/LanguageClient.cpp ${QC_LANG_CLIENT_MOC_SRCS})
-endif ()
-
+if(SC_QT)
+ set(QT_COLLIDER_LANG_CLIENT ON)
+ include(../QtCollider/CMakeLists.txt)
+ list(APPEND sclang_sources ${QT_COLLIDER_SRCS})
+endif()
if(0 AND FINAL_BUILD) # sclang final-builds are broken
CREATE_FINAL_FILE(libsclang_final.cpp ${sclang_sources})
@@ -222,10 +210,6 @@ else()
endif()
-if (SC_QT)
- target_link_libraries(libsclang QtCollider )
-endif()
-
set_property(TARGET libsclang
PROPERTY OUTPUT_NAME sclang)
@@ -286,6 +270,10 @@ endif()
target_link_libraries(libsclang ${PTHREADS_LIBRARY} supercollider_boost_thread)
+if(SC_QT)
+ target_link_libraries(libsclang ${QT_COLLIDER_LIBS})
+endif()
+
add_executable(sclang LangSource/cmdLineFuncs.cpp)
target_link_libraries(sclang libsclang boost_thread)
View
14 platform/mac/CMakeLists.txt
@@ -124,6 +124,11 @@ list(APPEND scapp_sources ${boost_fs_sources} ${boost_system_sources})
file(GLOB yaml_sources ${CMAKE_SOURCE_DIR}/external_libraries/yaml-cpp-0.2.6/src/*cpp)
list(APPEND scapp_sources ${yaml_sources})
+if(SC_QT)
+ include(${CMAKE_SOURCE_DIR}/QtCollider/CMakeLists.txt)
+ list(APPEND scapp_sources ${QT_COLLIDER_SRCS})
+endif()
+
set(objcpp_sources
${CMAKE_SOURCE_DIR}/lang/LangPrimSource/SC_Speech.M
${CMAKE_SOURCE_DIR}/editors/scapp/main.M
@@ -205,13 +210,8 @@ else()
)
endif()
-if (SC_QT)
- include_directories(${CMAKE_SOURCE_DIR}/include/QtCollider)
- target_link_libraries(${scappbundlename} QtCollider)
- set_property(TARGET ${scappbundlename}
- APPEND
- PROPERTY COMPILE_DEFINITIONS SC_QT
- )
+if(SC_QT)
+ target_link_libraries(${scappbundlename} ${QT_COLLIDER_LIBS})
endif()
# for processing into the plist:

0 comments on commit 464056c

Please sign in to comment.