<NME> SConscript
<BEF> # -*- Python -*-
#
# Copyright 2020 the Open GEE Contributors.
# Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#


import os
Import('env')
env = env.Clone()
env.UpdateCppflagsForSkia()

SConscript('site-icons/SConscript')
SConscript('images/SConscript')

# Qt (moc & uic) generates code with unused functions and unused values
# so add command line options to suppress those warnings
env = env.Clone()
env.Append( CXXFLAGS = ['-Wno-unused-function', '-Wno-unused-value', '-Wno-unused-result', '-Wno-unused-variable',
                        '-Wno-unused-but-set-variable', '-Wno-unused-parameter',
                        '-DQT3_SUPPORT', '-DQDOC'],
            CPPPATH = ['#fusion/fusionui',
                       Dir('.ui')],              # for generated files
            LINKFLAGS=['-L/usr/lib/x86_64-linux-gnu'],
            LIBS=['gdal',
                  'geautoingest',
                  'gecommon',
                  'gegst',
                  'gejs',
                  'gemiscconfig',
                  'geos',
                  'gepublish',
                  'gesearchtabs',
                  'geutil',
                  'gexml',
                  'gif',
                  'jpeg',
                  'freetype',
                  'QtCore', 'QtGui', 'Qt3Support', 'QtOpenGL',
                  'xerces-c',
                  'GL'])

idlfiles = [ 'layoutpersist', 'preferences', 'filehistory', 'thematicstyles' ]
env.idl(map(lambda n: n+'.idl', idlfiles))

uifiles = [
  'aboutfusionbase.ui',
  'advancedlabeloptionsbase.ui',
  'assetchooserbase.ui',
  'assetlogbase.ui',
  'assetmanagerbase.ui',
  'assetnotesbase.ui',
  'assetpropertiesbase.ui',
  'assetversionpropertiesbase.ui',
  'authdialogbase.ui',
  'balloonstyletextbase.ui',
  'databasewidgetbase.ui',
  'featureeditorbase.ui',
  'generictextbase.ui',
  'iconmanagerbase.ui',
  'labelformatbase.ui',
  'layerpropertiesbase.ui',
  'layergrouppropertiesbase.ui',
  'localemanagerbase.ui',
  'mainwindowbase.ui',
  'mapdatabasewidgetbase.ui',
  'mercatormapdatabasewidgetbase.ui',
  'maplayerwidgetbase.ui',
  'layerlegendbase.ui',
  'newassetbase.ui',
  'newfeaturebase.ui',
  'searchtabdetailsbase.ui',
  'objectdetailbase.ui',
  'placemarkeditbase.ui',
  'placemarkmanagerbase.ui',
  'preferencesbase.ui',
  'progressbase.ui',
  'projectwidgetbase.ui',
  'providereditbase.ui',
  'providermanagerbase.ui',
  'pushdatabasedialogbase.ui',
  'publishdatabasedialogbase.ui',
  'publisherbase.ui',
  'rasterassetwidgetbase.ui',
  'rasterlayerpropertiesbase.ui',
  'rasterpreviewpropertiesbase.ui',
  'scripteditorbase.ui',
  'searchfielddialogbase.ui',
  'selectionrulesbase.ui',
  'selectionviewbase.ui',
  'servercombinationeditbase.ui',
  'siteiconsbase.ui',
  'spatialreferencesystembase.ui',
  'srsdetailsbase.ui',
  'systemmanagerbase.ui',
  'tableviewbase.ui',
  'thematicfilterbase.ui',
  'vectorassetwidgetbase.ui',
  'vectorlayerwidgetbase.ui',
  'textstylebase.ui',
]

hmocfiles = [
  'AssetBase.h',
  'AssetManager.h',
  'ConfigWidgets.h',
  'FeatureEditor.h',
  'FileHistory.h',
  'GfxView.h',
  'LocaleDetails.h',
  'MainWindow.h',
  'MapProject.h',
  'ObjectDetail.h',
  'ProjectDocker.h',
  'ProjectManager.h',
  'ProjectLayerView.h',
  'QueryRules.h',
  'SelectionView.h',
  'SourceFileDialog.h',
  'StyleConfigurator.h',
  'SystemListener.h',
  'SystemManager.h',
  'VectorProject.h',
  'AssetVersionProperties.h',
  'AssetProperties.h',
  'AssetVersionActions.h',
  'WidgetControllers.h',
  'TextStyle.h',
  'StyleSave.h',
  'TextPreviewLabel.h',
  'FieldGeneratorController.h',
  'MapLayer.h',
  'ScriptFilterController.h',
  'RasterProjectWidget.h',
  'SearchTabWidget.h',
  'LayerLegendWidget.h',
  'VectorLayer.h'
]

cpps = [
  'AboutFusion.cpp',
  'AdvancedLabelOptions.cpp',
  'AssetBase.cpp',
  'AssetChooser.cpp',
  'AssetDisplayHelper.cpp',
  'AssetIconView.cpp',
  'AssetDrag.cpp',
  'AssetLog.cpp',
  'AssetTableView.cpp',
  'AssetManager.cpp',
  'AssetNotes.cpp',
  'AssetProperties.cpp',
  'AssetVersionProperties.cpp',
  'BalloonStyleText.cpp',
  'ConfigWidgets.cpp',
  'Database.cpp',
  'DatabaseWidget.cpp',
  'DataViewTable.cpp',
  'FeatureEditor.cpp',
  'FileHistory.cpp',
  'GfxView.cpp',
  'GlobalFusion.cpp',
  'IconManager.cpp',
  'ImageryProject.cpp',
  'MercatorImageryProject.cpp',
  'ImageryAsset.cpp',
  'MercatorImageryAsset.cpp',
  'KMLProject.cpp',
  'LabelFormat.cpp',
  'LayerItemBase.cpp',
  'LayerProperties.cpp',
  'LayerGroupProperties.cpp',
  'LocaleDetails.cpp',
  'LocaleManager.cpp',
  'main.cpp',
  'MainWindow.cpp',
  'MapLayer.cpp',
  'LayerLegendDialog.cpp',
  'MapDatabase.cpp',
  'MercatorMapDatabase.cpp',
  'MapDatabaseWidget.cpp',
  'MercatorMapDatabaseWidget.cpp',
  'MapProject.cpp',
  'NewAsset.cpp',
  'SearchTabDetails.cpp',
  'ObjectDetail.cpp',
  'PixmapManager.cpp',
  'PlacemarkEdit.cpp',
  'PlacemarkManager.cpp',
  'Preferences.cpp',
  'ProjectDocker.cpp',
  'ProjectLayerView.cpp',
  'ProjectManager.cpp',
  'ProjectWidget.cpp',
  'ProviderEdit.cpp',
  'ProviderManager.cpp',
  'PushDatabaseDialog.cpp',
  'PublishDatabaseDialog.cpp',
  'Publisher.cpp',
  'QDateWrapper.cpp',
  'QueryRules.cpp',
  'QValidatorExt.cpp',
  'RasterAssetWidget.cpp',
  'RasterLayerProperties.cpp',
  'RasterProjectWidget.cpp',
  'ResetConfigIdsExecutor.cpp',
  'SearchFieldDialog.cpp',
  'SelectionRules.cpp',
  'SelectionView.cpp',
  'ServerCombinationEdit.cpp',
  'SiteIcons.cpp',
  'SourceFileDialog.cpp',
  'StyleConfigurator.cpp',
  'SpatialReferenceSystem.cpp',
  'SRSDetails.cpp',
  'SystemManager.cpp',
  'TerrainProject.cpp',
  'VectorAsset.cpp',
  'VectorLayer.cpp',
  'VectorProject.cpp',
  'SystemListener.cpp',
  'AssetVersionActions.cpp',
  'SearchTabWidget.cpp',
  'ScriptEditor.cpp',
  'TerrainAsset.cpp',
  'ThematicFilter.cpp',
  'ValidLayerNames.cpp',
  'VectorAssetWidget.cpp',
  'TextStyle.cpp',
  'WidgetControllers.cpp',
  'FieldGeneratorController.cpp',
  'ScriptFilterController.cpp',
  'LayerLegendController.cpp',
  'LayerLegendWidget.cpp',
  'geGuiProgress.cpp',
  'geGuiAuth.cpp',
]

images = [
  'images/filenew',
  'images/fileopen',
  'images/filesave.png',
  'images/filesaveas.png',
  'images/print',
  'images/undo',
  'images/redo',
  'images/editcut',
  'images/editcopy',
  'images/editpaste',
  'images/searchfind',
  'images/grids.xpm',
  'images/select.xpm',
  'images/zoombox.xpm',
  'images/zoomdrag.xpm',
  'images/hand.xpm',
  'images/project_open.png',
  'images/project_new.png',
  'images/lock.png',
  'images/unlock.png',
  'images/fileclose.png',
  'images/keyhole_logo.png',
  'images/google_earth_logo.png',
  'images/folder.xpm',
  'images/fileopen_1.png',
  'images/window_fullscreen.png',
  'images/window_nofullscreen.png',
  'images/exit.png',
  'images/folder_new.png',
  'images/hi22-action-make_kdevelop.png',
  'images/make_kdevelop.png',
  'images/project.png',
  'images/editdelete.png',
  'images/up.png',
  'images/down.png',
  'images/left.png',
  'images/right.png',
  'images/project_save.png',
  'images/stop.png',
  'images/type_image.xpm',
  'images/type_vector.xpm',
  'images/type_terrain.xpm',
  'images/preview_default.png',
  'images/imagery_project.png',
  'images/imagery_project_mercator.png',
  'images/terrain_project.png',
  'images/vector_project.png',
  'images/imagery_asset.png',
  'images/imagery_asset_mercator.png',
  'images/terrain_asset.png',
  'images/vector_asset.png',
  'images/failed_asset.png',
  'images/shield_type1.png',
  'images/shield_type2.png',
  'images/shield_type3.png',
  'images/history.png',
  'images/delete.png',
  'images/database.png',
  'images/folder_open.xpm',
  'images/folder_closed.xpm',
  'images/cdtoparent.xpm',
  'images/newfolder.xpm',
  'images/closed_folder.xpm',
  'images/open_folder.xpm',
  'images/zoombox_cursor.png',
  'images/zoombox_cursor_mask.png',
  'images/down_16x16.png',
  'images/up_16x16.png',
  'images/primtype_point.png',
  'images/primtype_line.png',
  'images/primtype_polygon.png',
  'images/edit_tool.png',
  'images/map_project.png',
  'images/map_layer.png',
  'images/map_database.png',
  'images/map_database_mercator.png',
  'images/kml_project.png',
  'images/notes.png',
  'images/vector_layer.png',
  'images/timemachine-on.png',
  'images/timemachine-off.png'
]

qtcpps = env.qtFiles(uifiles, hmocfiles, images, 'fusion')

objs = map(lambda f: env.SharedObject(f), cpps) + [
    env['BUILDDATE'],
    ]
qtobjs = map(lambda f: env.SharedObject(f), qtcpps)
idlobjs = map(lambda f: env.SharedObject(f),
              map(lambda n: '.idl/'+n+'.cpp', idlfiles))

fusion = env.executable('fusion', objs + qtobjs + idlobjs)
env.install('fusion_bin', fusion)

# Define a custom action function for building qt translations
#def buildtrans(env, target, source):
#    cmd = '%s %s -qm %s' % ( env['LRELEASE'], str(source[0].name),
#                             str(target.name) )
#    print cmd, '\n'
#    return os.system(cmd)

# jptrans = env.Command('fusion_jp.qm',
#                       ['fusion.pro', 'fusion_jp.ts'],
#                        buildtrans)
# estrans = env.Command('fusion_es.qm',
#                       ['fusion.pro', 'fusion_es.ts'],
#                        buildtrans)

env.install('common_share', ['fusion_splash.png'])  # Needed for server too.
env.install('fusion_share', ['fusion.desktop'])

<MSG> Fix for undefined reference (#1871)


<DFF> @@ -48,7 +48,7 @@ env.Append( CXXFLAGS = ['-Wno-unused-function', '-Wno-unused-value', '-Wno-unuse
                   'gif',
                   'jpeg',
                   'freetype',
-                  'QtCore', 'QtGui', 'Qt3Support', 'QtOpenGL',
+                  'QtCore', 'QtGui', 'Qt3Support', 'QtOpenGL', 'QtNetwork',
                   'xerces-c',
                   'GL'])
 

{'addition_count': 1, 'commit_subject': 'Fix for undefined reference (#1871)', 'deletion_count': 1, 'file_extension': '', 'lang': 'SConscript', 'license': 'apache-2.0', 'repo_name': 'google/earthenterprise'}