CMakeLists.txt 5.17 KB
Newer Older
schultezub's avatar
schultezub committed
1
PROJECT(campvis-application)
schultezub's avatar
   
schultezub committed
2
3
4
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.0 FATAL_ERROR)
INCLUDE(../cmake/commonconf.cmake)

5
MESSAGE(STATUS "Configuring CAMPVis-Application")
schultezub's avatar
   
schultezub committed
6

schultezub's avatar
schultezub committed
7
FILE(GLOB CampvisApplicationSources
8
    campvisapplication.cpp
9
    gui/*.cpp
10
    gui/adjusterwidgets/*.cpp
11
12
    gui/mdi/*.cpp
    gui/properties/*.cpp
13
    tools/*.cpp
schultezub's avatar
   
schultezub committed
14
15
)

schultezub's avatar
schultezub committed
16
FILE(GLOB CampvisApplicationHeaders
17
18
    applicationapi.h
    campvisapplication.h
19
20
    glsl/*.frag
    glsl/*.vert
21
    gui/*.h
schultezub's avatar
schultezub committed
22
    gui/properties/*.h
23
    gui/adjusterwidgets/*.h
24
    tools/*.h
schultezub's avatar
   
schultezub committed
25
26
)

27
28
29
30
FILE(GLOB CampvisApplicationForms
    ui/*.ui
)

schultezub's avatar
schultezub committed
31
SET(CampvisApplicationToBeMocced
32
    gui/completinglualineedit.h
33
    gui/mainwindow.h
34
    gui/datacontainerinspectorcanvas.h
35
    gui/datacontainerinspectorwidget.h
36
    gui/datacontainerfileloaderwidget.h
37
    gui/datacontainertreewidget.h
38
    gui/pipelinetreewidget.h
schultezub's avatar
schultezub committed
39
    gui/qtcolortools.h
40
    gui/qtdatahandle.h
41
    gui/logviewerwidget.h
42
    gui/loghighlighter.h
43
    gui/luatablewidget.h
44
    gui/scriptingwidget.h
45
    gui/workflowcontrollerwidget.h
46
    gui/mdi/mdidockarea.h
47
    gui/mdi/mdidockablewindow.h
48
    gui/mdi/mdidockedwindow.h
49
    gui/mdi/mdifloatingwindow.h
50
    gui/adjusterwidgets/doubleadjusterwidget.h
51
    gui/adjusterwidgets/intadjusterwidget.h
schultezub's avatar
schultezub committed
52
    gui/properties/abstractpropertywidget.h
schultezub's avatar
schultezub committed
53
    gui/properties/abstracttransferfunctioneditor.h
schultezub's avatar
schultezub committed
54
    gui/properties/boolpropertywidget.h
schultezub's avatar
schultezub committed
55
    gui/properties/buttonpropertywidget.h
56
    gui/properties/datanamepropertywidget.h
schultezub's avatar
schultezub committed
57
    gui/properties/intpropertywidget.h
schultezub's avatar
schultezub committed
58
    gui/properties/floatpropertywidget.h
Hossain Mahmud's avatar
Hossain Mahmud committed
59
    gui/properties/colorpropertywidget.h
schultezub's avatar
schultezub committed
60
    gui/properties/geometry1dtransferfunctioneditor.h
61
    gui/properties/geometry2dtransferfunctioneditor.h
62
    gui/properties/metapropertywidget.h
63
    gui/properties/optionpropertywidget.h
schultezub's avatar
schultezub committed
64
    gui/properties/propertycollectionwidget.h
schultezub's avatar
schultezub committed
65
    gui/properties/simpletransferfunctioneditor.h
schultezub's avatar
schultezub committed
66
    gui/properties/stringpropertywidget.h
67
    gui/properties/statuspropertywidget.h
68
    gui/properties/transferfunctionpropertywidget.h
69
    tools/bufferinglog.h
70
    tools/qtexteditlog.h
71
    tools/qtjobprocessor.h
72
)
schultezub's avatar
   
schultezub committed
73

74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91

# add additional sources from the activated modules
FOREACH(ModFile ${CampvisModulesApplicationSources})
    # adjust relative path
    SET(ModFileRelative ../modules/${ModFile})
    LIST(APPEND CampvisApplicationSources ${ModFileRelative})
ENDFOREACH()
FOREACH(ModFile ${CampvisModulesApplicationHeaders})
    # adjust relative path
    SET(ModFileRelative ../modules/${ModFile})
    LIST(APPEND CampvisApplicationHeaders ${ModFileRelative})
ENDFOREACH()
FOREACH(ModFile ${CampvisModulesApplicationToBeMocced})
    # adjust relative path
    SET(ModFileRelative ../modules/${ModFile})
    LIST(APPEND CampvisApplicationToBeMocced ${ModFileRelative})
ENDFOREACH()

schultezub's avatar
   
schultezub committed
92
93
94
#
# Qt related stuff:
#
schultezub's avatar
schultezub committed
95
96
QT4_WRAP_CPP(CampvisApplicationMoc ${CampvisApplicationToBeMocced})
LIST(APPEND CampvisApplicationSources ${CampvisApplicationMoc})
97

98
99
QT4_WRAP_UI(CampvisApplicationFormsHeaders ${CampvisApplicationForms})
LIST(APPEND CampvisApplicationSources ${CampvisApplicationFormsHeaders})
100

101
LINK_DIRECTORIES(${CampvisGlobalLinkDirectories} ${CampvisModulesLinkDirectories})
102

103
SET(CampvisMainLibs campvis-core campvis-modules cgt sigslot)
104
105
106
107
108

IF(CAMPVIS_ENABLE_SCRIPTING)
    LIST(APPEND CampvisMainLibs campvis-scripting)
ENDIF(CAMPVIS_ENABLE_SCRIPTING)

109
ADD_LIBRARY(campvis-application
110
    ${CampvisApplicationSources} ${CampvisApplicationHeaders}
schultezub's avatar
schultezub committed
111
    ${CampvisApplicationMoc}
112
)
113
ADD_DEFINITIONS(${CampvisGlobalDefinitions} ${CampvisModulesDefinitions} ${CampvisApplicationDefinitions} ${QT_DEFINITIONS})
114
INCLUDE_DIRECTORIES(${CampvisGlobalIncludeDirs} ${CampvisModulesIncludeDirs})
115
TARGET_LINK_LIBRARIES(campvis-application ${CampvisMainLibs} ${CampvisGlobalExternalLibs} ${CampvisModulesExternalLibs} ${QT_LIBRARIES})
116

117
118
119
120
# if campvis-core is built as a shared library, CMake will define the following flag to instruct
# the code to export DLL symbols
SET_TARGET_PROPERTIES(campvis-application PROPERTIES DEFINE_SYMBOL "CAMPVIS_APPLICATION_BUILD_DLL")

121
122
123
124
125
IF(CAMPVIS_GROUP_SOURCE_FILES)
    DEFINE_SOURCE_GROUPS_FROM_SUBDIR(CampvisApplicationSources ${CampvisHome} "")
    DEFINE_SOURCE_GROUPS_FROM_SUBDIR(CampvisApplicationHeaders ${CampvisHome} "")
ENDIF()

126
127


128
129
ADD_EXECUTABLE(campvis-gui "campvis.cpp")
TARGET_LINK_LIBRARIES(campvis-gui campvis-application ${CampvisMainLibs} ${CampvisGlobalExternalLibs} ${CampvisModulesExternalLibs} ${QT_LIBRARIES})
130
131
132



133
IF(CAMPVIS_DEPLOY_SHADERS)
134
    LIST(APPEND CampvisShaderDirectories "application/data")
135
136
137
138
139
140
141
142
143
144
    LIST(APPEND CampvisShaderDirectories "application/glsl")
    LIST(APPEND CampvisShaderDirectories "core/glsl")

    FOREACH(Directory ${CampvisShaderDirectories})
        ADD_CUSTOM_COMMAND(
            TARGET campvis-application
            COMMAND ${CMAKE_COMMAND} -E copy_directory "${CampvisHome}/${Directory}" "$<TARGET_FILE_DIR:campvis-application>/${Directory}"
        )
    ENDFOREACH()
ENDIF(CAMPVIS_DEPLOY_SHADERS)
145
146
147
148
149
150
151


# copy over Lua stuff
ADD_CUSTOM_COMMAND(
    TARGET campvis-application
    COMMAND ${CMAKE_COMMAND} -E copy "${CampvisHome}/application/lua/inspect.lua" "$<TARGET_FILE_DIR:campvis-application>/lua-mods/inspect.lua"
)