summaryrefslogtreecommitdiffstats
path: root/src/styles/CMakeLists.txt
blob: 784f29aeb7850b6b6834d6749634fa292dd7510c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
include_directories(
  ${CMAKE_BINARY_DIR}
  ${CMAKE_CURRENT_BINARY_DIR}
  ${CMAKE_CURRENT_SOURCE_DIR}
  ${CMAKE_BINARY_DIR}/include
  ${CMAKE_SOURCE_DIR}/src/kernel
)

link_directories()


##### styles (static)

set( target styles )
set( _SRC_ qcommonstyle.cpp
           qstyleplugin.cpp
           qstylefactory.cpp
)

set( _STYLE_MOTIF_SRC_     qmotifstyle.cpp     )
set( _STYLE_WINDOWS_SRC_   qwindowsstyle.cpp   )
set( _STYLE_CDE_SRC_       qcdestyle.cpp       )
set( _STYLE_MOTIFPLUS_SRC_ qmotifplusstyle.cpp )
set( _STYLE_SGI_SRC_       qsgistyle.cpp       )
set( _STYLE_COMPACT_SRC_   qcompactstyle.cpp   )
set( _STYLE_INTERLACE_SRC_ qinterlacestyle.cpp )
set( _STYLE_PLATINUM_SRC_  qplatinumstyle.cpp  )

# setup style dependencies
set( _STYLE_CDE_DEPEND_       MOTIF   )
set( _STYLE_MOTIFPLUS_DEPEND_ MOTIF   )
set( _STYLE_SGI_DEPEND_       MOTIF   )
set( _STYLE_INTERLACE_DEPEND_ WINDOWS )
set( _STYLE_PLATINUM_DEPEND_  WINDOWS )
set( _STYLE_COMPACT_DEPEND_   WINDOWS )

# styles unsupported on X11
set ( _disabled_styles
    TQT_NO_STYLE_WINDOWSXP
    TQT_NO_STYLE_AQUA
    TQT_NO_STYLE_POCKETPC
    TQT_NO_STYLE_MAC
)

# process the style options
foreach( _style MOTIF WINDOWS CDE MOTIFPLUS SGI COMPACT INTERLACE PLATINUM )

    if( WITH_STYLE_${_style} AND NOT BUILD_STYLE_PLUGIN_${_style} )
        if( DEFINED _STYLE_${_style}_DEPEND_ )
            set( _depend ${_STYLE_${_style}_DEPEND_} )
            if( NOT WITH_STYLE_${_depend} )
                tde_message_fatal( "style ${_style} requires ${_depend} to build" )
            endif( )
        endif( )
        list( APPEND _SRC_ ${_STYLE_${_style}_SRC_} )
     else( )
        list( APPEND _disabled_styles "TQT_NO_STYLE_${_style}" )
    endif( )

    if( BUILD_STYLE_PLUGIN_${_style} )

        unset( _style_depend_lib )

        if( DEFINED _STYLE_${_style}_DEPEND_ )
            set( _depend ${_STYLE_${_style}_DEPEND_} )
            if( BUILD_STYLE_PLUGIN_${_depend} )
                string( TOLOWER "q${_depend}style-shared" _style_depend_lib )
             elseif( NOT WITH_STYLE_${_depend} )
                tde_message_fatal( "style ${_style} requires ${_depend} to build" )
            endif( )
        endif( )

        string( TOLOWER "q${_style}style" _style_lib )
        tde_add_library( ${_style_lib} SHARED
          SOURCES ${_STYLE_${_style}_SRC_}
          LINK tqt-mt-shared ${_style_depend_lib}
          DESTINATION "${QT_INSTALL_PLUGINS}/styles"
        )
        tqt_automoc( ${_style_lib}-shared )

    endif( )

endforeach( )

tde_add_library( ${target} STATIC_PIC

  SOURCES
        ${_SRC_}

  DEPENDENCIES
    tqt-includes
)

tqt_automoc( ${target}-static )

list( APPEND tqtlib_embed ${target}-static )
set( tqtlib_embed ${tqtlib_embed} PARENT_SCOPE )

set_property(
    TARGET ${target}-static
    APPEND PROPERTY COMPILE_DEFINITIONS ${_disabled_styles}
)