CMakeLists.txt 4.12 KB
Newer Older
1 2 3 4 5 6 7
# Package dependencies:
FIND_PACKAGE( Qt4 REQUIRED )

# Includes:
INCLUDE_DIRECTORIES( ${QT_INCLUDE_DIR} )

# Libraries for linking:
8 9 10
SET( QT_LIBS ${QT_QTCORE_LIBRARY}
             ${QT_QTGUI_LIBRARY}
             ${QT_QTOPENGL_LIBRARY} )
11

12
# add here all classes that inherit from QObject
13
SET(GUI_QT4_MOC_HDRS
14
    WMainWindow.h
15
    WQtConfigWidget.h
16
    WQtNavGLWidget.h
17
    WQtGLWidget.h
18
    WQtCombinerToolbar.h
19
    guiElements/WQtPushButton.h
20
    guiElements/WQtModuleOneToOneCombinerAction.h
21
    guiElements/WQtPropertyBoolAction.h
22 23 24 25 26 27 28 29 30 31
    controlPanel/WPropertyWidget.h
    controlPanel/WPropertyBoolWidget.h
    controlPanel/WPropertyIntWidget.h
    controlPanel/WPropertyDoubleWidget.h
    controlPanel/WPropertyStringWidget.h
    controlPanel/WPropertyColorWidget.h
    controlPanel/WPropertyFilenameWidget.h
    controlPanel/WPropertyTriggerWidget.h
    controlPanel/WPropertySelectionWidget.h
    controlPanel/WPropertyPositionWidget.h
32
    controlPanel/WPropertyMatrix4X4Widget.h
33
    controlPanel/WQtControlPanel.h
34
    controlPanel/WQtPropertyGroupWidget.h
35 36 37
    controlPanel/WQtTreeWidget.h
    controlPanel/WQtTreeItem.h
    controlPanel/WQtTextureSorter.h
38
)
39
IF( CMAKE_HOST_SYSTEM MATCHES Darwin )
Sebastian Eichelbaum's avatar
[STYLE]  
Sebastian Eichelbaum committed
40
  LIST( APPEND GUI_QT4_MOC_HDRS platformDependent/WQtGLWidgetMac.h )
41 42

ELSE()
ledig's avatar
ledig committed
43 44 45 46 47
  IF( CMAKE_GENERATOR MATCHES "Visual Studio" )
    LIST( APPEND GUI_QT4_MOC_HDRS platformDependent/WQtGLWidgetWin.h )
  ELSE( CMAKE_GENERATOR MATCHES "Visual Studio" )
    LIST( APPEND GUI_QT4_MOC_HDRS platformDependent/WQtGLWidgetAll.h )
  ENDIF( CMAKE_GENERATOR MATCHES "Visual Studio" )
48
ENDIF()
49 50 51

QT4_WRAP_CPP(GUI_QT4_MOC_SRCS ${GUI_QT4_MOC_HDRS} )

52
FILE(GLOB GUI_QT4_SRC "*.cpp" "guiElements/*.cpp" "controlPanel/*.cpp" "ribbonMenu/*.cpp" "events/*.cpp" "*.h" "guiElements/*.h" "controlPanel/*.h" "ribbonMenu/*.h" "events/*.h" "../icons/WIcons.h" )
53
IF( CMAKE_HOST_SYSTEM MATCHES Darwin )
Sebastian Eichelbaum's avatar
[STYLE]  
Sebastian Eichelbaum committed
54 55
  FILE( GLOB GUIQT4_PLATFORMDEPENDENT_SRC
    "platformDependent/WQtGLWidgetMac.cpp"
56 57
    "platformDependent/WQtGLWidgetMac.h" )
ELSE()
ledig's avatar
ledig committed
58
  IF( CMAKE_GENERATOR MATCHES "Visual Studio" )
Sebastian Eichelbaum's avatar
[STYLE]  
Sebastian Eichelbaum committed
59 60
    FILE( GLOB GUIQT4_PLATFORMDEPENDENT_SRC
      "platformDependent/WQtGLWidgetWin.cpp"
ledig's avatar
ledig committed
61 62
      "platformDependent/WQtGLWidgetWin.h" )
  ELSE( CMAKE_GENERATOR MATCHES "Visual Studio" )
Sebastian Eichelbaum's avatar
[STYLE]  
Sebastian Eichelbaum committed
63 64
    FILE( GLOB GUIQT4_PLATFORMDEPENDENT_SRC
      "platformDependent/WQtGLWidgetAll.cpp"
ledig's avatar
ledig committed
65 66
      "platformDependent/WQtGLWidgetAll.h" )
  ENDIF( CMAKE_GENERATOR MATCHES "Visual Studio" )
67
ENDIF()
Sebastian Eichelbaum's avatar
[STYLE]  
Sebastian Eichelbaum committed
68

69 70 71 72 73 74 75 76 77 78 79 80 81
SET( LIB_NAME "${OWguiqt4Name}" )

SET( ${LIB_NAME}_COMBINER_SRC ${GUI_QT4_SRC} ${GUIQT4_PLATFORMDEPENDENT_SRC} ${GUI_QT4_MOC_SRCS} )
SET( ${LIB_NAME}_ALL_CPP ${GUI_QT4_SRC} ${GUIQT4_PLATFORMDEPENDENT_SRC} ${GUI_QT4_MOC_SRCS} )
SET( ${LIB_NAME}_ALL_CPP_WITHOUT_MOC ${GUI_QT4_SRC} ${GUIQT4_PLATFORMDEPENDENT_SRC} )
FILE( GLOB_RECURSE ${LIB_NAME}_REMOVE_H "*.h"  "../icons/WIcons.h" )

LIST( REMOVE_ITEM ${LIB_NAME}_ALL_CPP ${${LIB_NAME}_REMOVE_H} )
LIST( REMOVE_ITEM ${LIB_NAME}_ALL_CPP_WITHOUT_MOC ${${LIB_NAME}_REMOVE_H} )

IF( OW_BUILD_AS_ONE_BIG_FILE )
	SET( UNITY_BUILD_FILE_NAME "${LIB_NAME}UnityBuildFile.cpp" )
	GENERATE_UNITY_BUILD_FILE( ${LIB_NAME}_ALL_CPP )
Sebastian Eichelbaum's avatar
[STYLE]  
Sebastian Eichelbaum committed
82

83 84 85 86 87 88
	ADD_LIBRARY( ${LIB_NAME} ${UNITY_BUILD_FILE_NAME} ${${LIB_NAME}_COMBINER_SRC} )
ENDIF( OW_BUILD_AS_ONE_BIG_FILE )

IF( NOT OW_BUILD_AS_ONE_BIG_FILE )
    ADD_LIBRARY( ${LIB_NAME} ${${LIB_NAME}_COMBINER_SRC} )
ENDIF( NOT OW_BUILD_AS_ONE_BIG_FILE )
Sebastian Eichelbaum's avatar
[STYLE]  
Sebastian Eichelbaum committed
89

90 91 92 93 94 95 96 97 98 99 100 101 102 103 104
#IF( OW_BUILD_AS_ONE_BIG_FILE )
#	SET( ALL_GUI_QT4_COMBINER_SRC ${GUI_QT4_SRC} ${GUIQT4_PLATFORMDEPENDENT_SRC} ${GUI_QT4_MOC_SRCS} )
#	SET( UNITY_BUILD_FILE_NAME "GuiQt4UnityBuildFile.cpp" )
#
	#only add cpp files to the big file
#	SET( ALL_GUI_QT4_COMBINER_CPP ${ALL_GUI_QT4_COMBINER_SRC} )
 #   LIST( REMOVE_ITEM ALL_GUI_QT4_COMBINER_CPP "*.h" )

#	GENERATE_UNITY_BUILD_FILE( ALL_GUI_QT4_COMBINER_CPP )
#	ADD_LIBRARY( OWguiqt4 SHARED ${UNITY_BUILD_FILE_NAME} ${ALL_GUI_QT4_COMBINER_SRC} )
#ELSE( OW_BUILD_AS_ONE_BIG_FILE )
#	ADD_LIBRARY( OWguiqt4 ${GUI_QT4_SRC} ${GUIQT4_PLATFORMDEPENDENT_SRC} ${GUI_QT4_MOC_SRCS} )
#ENDIF( OW_BUILD_AS_ONE_BIG_FILE )

TARGET_LINK_LIBRARIES( ${LIB_NAME} ${OWCommonName} ${OWguiName} ${OWgeName} ${OWKernelName} ${QT_LIBS} ${Boost_LIBRARIES} )
105 106

IF(MSVC_IDE)
107
    SET_TARGET_PROPERTIES( ${LIB_NAME} PROPERTIES PREFIX "../")
108
ENDIF(MSVC_IDE)