11.08., 9:00 - 11:00: Due to updates GitLab will be unavailable for some minutes between 09:00 and 11:00.

CMakeLists.txt 5.79 KB
Newer Older
schultezub's avatar
schultezub committed
1
PROJECT(campvis-application)
2 3
INCLUDE(../cmake/commonconf.cmake)

4
MESSAGE(STATUS "Configuring CAMPVis-Application")
5

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

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

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

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

70

71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90
IF(CAMPVIS_ENABLE_SCRIPTING)
    LIST(APPEND CampvisApplicationToBeMocced
        ${CMAKE_CURRENT_SOURCE_DIR}/gui/completinglualineedit.h
        ${CMAKE_CURRENT_SOURCE_DIR}/gui/luatablewidget.h
        ${CMAKE_CURRENT_SOURCE_DIR}/gui/scriptingwidget.h
    )
ELSE(CAMPVIS_ENABLE_SCRIPTING)
    LIST(REMOVE_ITEM CampvisApplicationSources
        ${CMAKE_CURRENT_SOURCE_DIR}/gui/completinglualineedit.cpp
        ${CMAKE_CURRENT_SOURCE_DIR}/gui/luatablewidget.cpp
        ${CMAKE_CURRENT_SOURCE_DIR}/gui/scriptingwidget.cpp
    )
    LIST(REMOVE_ITEM CampvisApplicationHeaders
        ${CMAKE_CURRENT_SOURCE_DIR}/gui/completinglualineedit.h
        ${CMAKE_CURRENT_SOURCE_DIR}/gui/luatablewidget.h
        ${CMAKE_CURRENT_SOURCE_DIR}/gui/scriptingwidget.h
    )
ENDIF(CAMPVIS_ENABLE_SCRIPTING)


91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107
# 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()

108
QT5_WRAP_UI(CampvisApplicationFormsHeaders ${CampvisApplicationForms})
109
LIST(APPEND CampvisApplicationSources ${CampvisApplicationFormsHeaders})
110

111
LINK_DIRECTORIES(${CampvisGlobalLinkDirectories} ${CampvisModulesLinkDirectories})
112

113
SET(CampvisMainLibs campvis-core campvis-modules cgt sigslot)
114 115 116 117 118

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

119
ADD_LIBRARY(campvis-application-lib
120
    ${CampvisApplicationSources} ${CampvisApplicationHeaders}
schultezub's avatar
schultezub committed
121
    ${CampvisApplicationMoc}
122
)
123
ADD_DEFINITIONS(${CampvisGlobalDefinitions} ${CampvisModulesDefinitions} ${CampvisApplicationDefinitions})
124
INCLUDE_DIRECTORIES(${CampvisGlobalIncludeDirs} ${CampvisModulesIncludeDirs})
125
TARGET_LINK_LIBRARIES(campvis-application-lib ${CampvisMainLibs} ${CampvisGlobalExternalLibs} ${CampvisModulesExternalLibs} Qt5::Widgets Qt5::OpenGL)
126

127 128
# if campvis-core is built as a shared library, CMake will define the following flag to instruct
# the code to export DLL symbols
129
SET_TARGET_PROPERTIES(campvis-application-lib PROPERTIES DEFINE_SYMBOL "CAMPVIS_APPLICATION_BUILD_DLL")
130

131

132 133 134 135 136
IF(CAMPVIS_GROUP_SOURCE_FILES)
    DEFINE_SOURCE_GROUPS_FROM_SUBDIR(CampvisApplicationSources ${CampvisHome} "")
    DEFINE_SOURCE_GROUPS_FROM_SUBDIR(CampvisApplicationHeaders ${CampvisHome} "")
ENDIF()

137
INSTALL(TARGETS campvis-application-lib DESTINATION exports EXPORT campvis-targets)
138 139


140
ADD_EXECUTABLE(campvis-application "campvis.cpp")
141
TARGET_LINK_LIBRARIES(campvis-application campvis-application-lib ${CampvisMainLibs} ${CampvisGlobalExternalLibs} ${CampvisModulesExternalLibs} Qt5::Widgets Qt5::OpenGL)
142

143
IF(CAMPVIS_DEPLOY_SHADERS)
144
    LIST(APPEND CampvisShaderDirectories "application/data")
145 146 147 148 149 150 151 152 153 154
    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)
155 156 157 158 159 160 161


# 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"
)