File: CMakeLists.txt

package info (click to toggle)
magics%2B%2B 4.5.3-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 94,096 kB
  • sloc: cpp: 164,444; xml: 27,055; perl: 6,352; ansic: 4,097; python: 3,761; sh: 739; javascript: 703; f90: 278; makefile: 90
file content (204 lines) | stat: -rw-r--r-- 7,722 bytes parent folder | download
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
###############################################################################

configure_file( magics_config.h.in  magics_config.h  )

install ( FILES ${CMAKE_CURRENT_BINARY_DIR}/magics_config.h  DESTINATION ${INSTALL_INCLUDE_DIR})

###############################################################################


add_subdirectory( params )


foreach( file ${magics_xmls} )
      get_filename_component( path     ${file} PATH   )
      get_filename_component( basefile ${file} NAME_WE )

      set( ouputfiles ${CMAKE_CURRENT_SOURCE_DIR}/attributes/${basefile}Attributes.h ${CMAKE_CURRENT_SOURCE_DIR}/attributes/${basefile}Attributes.cc )
      list( APPEND magics_params_srcs ${ouputfiles} )
endforeach()


foreach( file ${metview_xmls} )
      get_filename_component( path     ${file} PATH   )
         get_filename_component( basefile ${file} NAME_WE )

      set( metviewfiles ${CMAKE_CURRENT_SOURCE_DIR}/attributes/${basefile}Wrapper.h ${CMAKE_CURRENT_SOURCE_DIR}/attributes/${basefile}Wrapper.cc )
      list( APPEND metview_wrappers_srcs ${metviewfiles} )
   endforeach()

   if(qt)
      SET(qt_drivers_HEADERS drivers/MgQ/MgQPlotScene.h)
      if( MAGICS_QT5 )
         QT5_WRAP_CPP(qt_drivers_HEADERS_MOC ${qt_drivers_HEADERS})
      else()
         QT4_WRAP_CPP(qt_drivers_HEADERS_MOC ${qt_drivers_HEADERS})
      endif()
      list( APPEND drivers_srcs  drivers/MgQ/MgQPlotScene.cc  ${qt_drivers_HEADERS_MOC})
   endif()



#add_custom_command( magics_params DEPENDS ${magics_params_srcs} ${metview_wrappers_srcs} )

###############################################################################

add_subdirectory( common )
add_subdirectory( basic )
add_subdirectory( web )
add_subdirectory( visualisers )
add_subdirectory( drivers )
add_subdirectory( decoders )
add_subdirectory( clipper )
add_subdirectory( eckit_readers )

if( metview )
	add_subdirectory( libMagWrapper )
endif()

if( HAVE_ODB )
	add_subdirectory( oda )
  # Adding path to the Oda directory
  list( APPEND MAGICS_PRIVATE_INCLUDE_DIRS $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/src/oda> )
endif()

ecbuild_add_library( TARGET    MagPlus
                     SOURCES
                        magics.h
                        ${magics_params_srcs}
                        ${common_srcs}
                        ${basic_srcs}
                        ${web_srcs}
                        ${visualisers_srcs}
                        ${eckit_srcs}
                        ${drivers_srcs}
                        ${qt_srcs}
                        ${decoders_srcs}
                        ${clipper_srcs}
                        ${odb_srcs}
                     TEMPLATES
                        ${common_templates}
                     PUBLIC_DEFINITIONS
                        ${MAGICS_EXTRA_DEFINITIONS}
                     PUBLIC_LIBS
                        ${MAGICS_EXTRA_LIBRARIES}
                        eccodes
		     VERSION
			3.0.0
		     SOVERSION
			3
                     PRIVATE_INCLUDES $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/src/clipper>
                                      ${MAGICS_PRIVATE_INCLUDE_DIRS}

                     PUBLIC_INCLUDES $<INSTALL_INTERFACE:${PROJ_INCLUDE_DIRS}>
                                     $<INSTALL_INTERFACE:${INSTALL_INCLUDE_DIR}>
                                     $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/src>
                                     $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/src/attributes>
                                     $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/src/basic>
                                     $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/src/common>
                                     $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/src/drivers>
                                     $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/src/decoders>
                                     $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/src/visualisers>
                                     $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/src/eckit_readers>
                                     $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/src/web>
                                     $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/src/drivers/MgQ>
                                     $<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/src>
                     TYPE SHARED )

target_link_libraries(MagPlus PRIVATE ${EXPAT_LIBRARIES} ${PROJ_LIBRARIES})

if(APPLE)
  target_link_libraries(MagPlus PRIVATE ${ZLIB_LIBRARIES})
endif(APPLE)

if(HAVE_CAIRO)
    target_link_libraries(MagPlus PRIVATE ${PANGOCAIRO_LIBRARIES})
endif()

if(HAVE_NETCDF)
    target_link_libraries(MagPlus PRIVATE NetCDF::NetCDF_C)
endif()

ecbuild_add_library( TARGET         MagPlusSingle
                     SOURCES        MagicsSingle.cc
                     PRIVATE_LIBS   MagPlus
		     VERSION        3.0.0
		     SOVERSION      3
                     TYPE           SHARED )

ecbuild_add_library( TARGET         MagPlusDouble
                     SOURCES        MagicsDouble.cc
                     PRIVATE_LIBS   MagPlus
		     VERSION        3.0.0
		     SOVERSION      3
                     TYPE           SHARED )

if( metview )

   ecbuild_add_library(	TARGET			MagWrapper
                     	SOURCES			magics.h
                        			${metview_srcs}
                        			${metview_wrappers_srcs}
                     	PUBLIC_DEFINITIONS	${MAGICS_EXTRA_DEFINITIONS}
                     	PUBLIC_LIBS		MagPlus
                        PRIVATE_INCLUDES ${MAGICS_PRIVATE_INCLUDE_DIRS}
                        PUBLIC_INCLUDES $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/src/libMagWrapper>
                     	TYPE			STATIC
                    )
   if(HAVE_CAIRO)
    target_link_libraries(MagWrapper PRIVATE ${PANGOCAIRO_LIBRARIES})
   endif()

   if(HAVE_NETCDF)
    target_link_libraries(MagWrapper PRIVATE NetCDF::NetCDF_C)
   endif()

   list( APPEND attributes_include
            OutputHandlerAttributes.h
            FortranRootSceneNodeAttributes.h
            BinningObjectAttributes.h
            GribDecoderAttributes.h
            DateGribLoopStepAttributes.h
            GribLoopAttributes.h
            GeoRectangularProjectionAttributes.h
            LegendVisitorAttributes.h
            XmlRootNodeAttributes.h
            WrepRootNodeAttributes.h
            ContinuousLegendMethodAttributes.h
            HistogramLegendMethodAttributes.h
            XmlBasicNodeAttributes.h
            LookupTableModeAttributes.h
            FixedTableModeAttributes.h
   )
   if(qt)
     list(APPEND attributes_include QtDriverAttributes.h)
   endif()


   install( FILES AutoVector.h       DESTINATION ${INSTALL_INCLUDE_DIR})
   install( FILES Iterable.h         DESTINATION ${INSTALL_INCLUDE_DIR})
   install( FILES ReverseIterable.h  DESTINATION ${INSTALL_INCLUDE_DIR})

   foreach( file ${attributes_include} )
     install( FILES ${CMAKE_CURRENT_SOURCE_DIR}/attributes/${file}  DESTINATION ${INSTALL_INCLUDE_DIR})
   endforeach()
   install( FILES ${metview_include} DESTINATION ${INSTALL_INCLUDE_DIR})
endif()


install( FILES magics.h                DESTINATION ${INSTALL_INCLUDE_DIR})
install( FILES common/magics_export.h  DESTINATION ${INSTALL_INCLUDE_DIR})
install( FILES common/magics_windef.h  DESTINATION ${INSTALL_INCLUDE_DIR})

## Add install include dirs to install interface
foreach( target     MagPlus
                    MagPlusStatic
                    MagPlusSingle
                    MagPlusSingleStatic
                    MagPlusDouble
                    MagPlusDoubleStatic
                    MagWrapper )
    if( TARGET ${target} AND DEFINED ecbuild_VERSION)
        target_include_directories( ${target} INTERFACE $<INSTALL_INTERFACE:${INSTALL_INCLUDE_DIR}> )
    endif()
endforeach()