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

CMakeLists.txt 2.75 KB
Newer Older
schultezub's avatar
schultezub committed
1
#
schultezub's avatar
schultezub committed
2
# CAMPVis - Yet another visualization framework
schultezub's avatar
schultezub committed
3
4
5
# CMake file inspired by Voreen
#

schultezub's avatar
schultezub committed
6
PROJECT(CAMPVis)
schultezub's avatar
schultezub committed
7
8
9
10
11
12
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.0 FATAL_ERROR)

#
# Global Build Options
#

schultezub's avatar
schultezub committed
13
14
15
16
17
18
19
OPTION(CAMPVIS_SHARED_LIBS          "Build shared libraries?"                                       ON )
#OPTION(CAMPVIS_PRECOMPILED_HEADER   "Use pre-compiled headers?"                                     ON )
OPTION(CAMPVIS_DEBUG                "Activate debug code?"                                          ON )
OPTION(CAMPVIS_BUILD_APPLICATION    "Build CAMPVis Application"                                      ON )
OPTION(CAMPVIS_BUILD_CORE           "Build CAMPVis Core"                                             ON )
OPTION(CAMPVIS_BUILD_MODULES        "Build CAMPVis Modules"                                          ON )
OPTION(CAMPVIS_BUILD_LIB_TGT        "Build TGT Library"                                             ON )
20
21
22
OPTION(CAMPVIS_BUILD_LIB_KISSCL     "Build KissCL Library"                                          OFF)

OPTION(CAMPVIS_DEPLOY_SHADERS       "Deploy Shader files to binary directory"                       OFF)
schultezub's avatar
schultezub committed
23
24

IF(WIN32)
schultezub's avatar
schultezub committed
25
26
27
    OPTION(CAMPVIS_COPY_EXTERNAL_DLLS   "Copy external DLLs to bin directory?"                      ON )
    OPTION(CAMPVIS_INCREMENTAL_LINKING  "Enable incremental linking in Visual Studio debug builds?" ON )
    OPTION(CAMPVIS_GENERATE_MANIFEST    "Generate manifest in Visual Studio debug builds (switch on when encountering errors using incremental linking)?"          OFF)
schultezub's avatar
schultezub committed
28
29
30
31
32
33
ENDIF()

#
# Further Build Configurations
#
include(cmake/commonconf.cmake)
34
include(cmake/parseModulesDir.cmake)
schultezub's avatar
schultezub committed
35

36
37
SET_PROPERTY(GLOBAL PROPERTY USE_FOLDERS ON)

38
39
MESSAGE(STATUS "--------------------------------------------------------------------------------")

schultezub's avatar
schultezub committed
40
IF(CAMPVIS_BUILD_LIB_TGT)
schultezub's avatar
schultezub committed
41
42
43
    ADD_SUBDIRECTORY(ext/tgt)
ENDIF()

schultezub's avatar
schultezub committed
44
IF(CAMPVIS_BUILD_LIB_KISSCL)
schultezub's avatar
schultezub committed
45
    LIST(APPEND CampvisGlobalDefinitions "-DHAS_KISSCL")
schultezub's avatar
schultezub committed
46
    ADD_SUBDIRECTORY(ext/kisscl)
47
48
ENDIF()

schultezub's avatar
schultezub committed
49
IF(CAMPVIS_BUILD_CORE)
schultezub's avatar
schultezub committed
50
51
52
    ADD_SUBDIRECTORY(core)
ENDIF()

schultezub's avatar
schultezub committed
53
IF(CAMPVIS_BUILD_MODULES)
schultezub's avatar
   
schultezub committed
54
55
56
    ADD_SUBDIRECTORY(modules)
ENDIF()

57

schultezub's avatar
schultezub committed
58
IF(CAMPVIS_BUILD_APPLICATION)
schultezub's avatar
   
schultezub committed
59
60
61
    ADD_SUBDIRECTORY(application)
ENDIF()

62

schultezub's avatar
schultezub committed
63
64
65
66
#
# Copy External DLLs
#
IF(WIN32)
schultezub's avatar
schultezub committed
67
    # gather Qt4 DLLs - TODO: remove redundant naming of required components 
68
    FIND_PACKAGE(Qt4DLLs COMPONENTS QtCore QtGui QtOpenGL QtNetwork QtXmlPatterns)
schultezub's avatar
schultezub committed
69
70
71
    LIST(APPEND CampvisExternalDllsDebug ${QT_DEBUG_DLLS})
    LIST(APPEND CampvisExternalDllsRelease ${QT_RELEASE_DLLS})

schultezub's avatar
schultezub committed
72
73
    LIST(REMOVE_DUPLICATES CampvisExternalDllsDebug)
    LIST(REMOVE_DUPLICATES CampvisExternalDllsRelease)
schultezub's avatar
schultezub committed
74

schultezub's avatar
schultezub committed
75
    IF(CAMPVIS_COPY_EXTERNAL_DLLS)
schultezub's avatar
schultezub committed
76
        COPY_EXTERNAL_DLLS(CampvisExternalDllsDebug CampvisExternalDllsRelease false)
schultezub's avatar
schultezub committed
77
78
    ENDIF()
ENDIF()