diff --git a/CMakeLists.txt b/CMakeLists.txt index 8edcb46696e4c5fa509f1f411fe84ab299c7e7cf..c3d0c0a1b373e67cd65ab51c32fbcde45d5a6625 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,32 +20,37 @@ add_custom_target(fullcheck COMMAND ${CMAKE_CTEST_COMMAND}) # => 'make check' is include(VERSION.cmake) -# declare project-wide user flags, and set default values +## declare project-wide user flags, and set default values + +# options that can be switched off to simplify the build and reduce its scope option(BORNAGAIN_PYTHON "Build with python support" ON) +option(BORNAGAIN_GUI "Build a graphical user interface" ON) +option(BORNAGAIN_TIFF_SUPPORT "Tiff files read/write support" ON) +option(BORNAGAIN_OPENGL "Build additional modules for 3D in GUI" ON) +option(UNITTESTS "Don't skip unit tests" ON) + option(BORNAGAIN_USE_PYTHON2 "Build against python 2.7" OFF) +option(BORNAGAIN_MPI "Build with MPI support" OFF) + option(BORNAGAIN_GENERATE_BINDINGS "Generate python bindings during build (requires swig)" OFF) option(BORNAGAIN_GENERATE_PYTHON_DOCS "Generate python documentation from the doxygen comments" OFF) -option(BORNAGAIN_GUI "Build a graphical user interface" ON) -option(BORNAGAIN_USERMANUAL "Build the User Manual" OFF) option(BORNAGAIN_MANPAGE "Build Unix man page" OFF) +option(BORNAGAIN_CONFIGURE_DOXY "Configure Doxygen files" OFF) +option(AUTOGENERATE "Regenerate Py docs, Py wrappers, man page, Doxyfiles" OFF) + option(BUILD_DEBIAN "Build a debian package" OFF) option(BORNAGAIN_APPLE_BUNDLE "Create a Mac OS X bundle" OFF) -option(BORNAGAIN_MPI "Build with MPI support" OFF) -option(BORNAGAIN_CONFIGURE_DOXY "Configure Doxygen files" OFF) -option(BORNAGAIN_TIFF_SUPPORT "Tiff files read/write support" ON) -option(AUTOGENERATE "Regenerate directory auto (Py docs, Py wrappers, man page)" OFF) + option(ZERO_TOLERANCE "Terminate compilation on warnings" OFF) -option(UNITTESTS "Don't skip unit tests" ON) option(BORNAGAIN_COVERAGE "Build with test coverage information" OFF) option(BORNAGAIN_DEBUG_OPTIMIZATION "Build with debug optimization (gcc only)" OFF) -option(BORNAGAIN_OPENGL "Build additional modules for 3D in GUI" ON) -option(BORNAGAIN_BUILDBOT_SERVER "Special option for the buildbot server" OFF) option(BORNAGAIN_TIDY "Invokes clang-tidy" OFF) if(AUTOGENERATE) set(BORNAGAIN_MANPAGE ON) set(BORNAGAIN_GENERATE_PYTHON_DOCS ON) set(BORNAGAIN_GENERATE_BINDINGS ON) + set(BORNAGAIN_CONFIGURE_DOXY ON) endif() # include CMake macros and functions diff --git a/Core/InputOutput/TiffHandler.cpp b/Core/InputOutput/TiffHandler.cpp index 53eb08c9ecb1a29988090dad30fd734b4c14bdac..b255efd8b294d148ace40e85056781534567c47d 100644 --- a/Core/InputOutput/TiffHandler.cpp +++ b/Core/InputOutput/TiffHandler.cpp @@ -17,6 +17,7 @@ #include "TiffHandler.h" #include "BornAgainNamespace.h" #include "SysUtils.h" +#include <tiffio.hxx> TiffHandler::TiffHandler() : m_tiff(0), m_width(0), m_height(0), m_bitsPerSample(0), m_samplesPerPixel(0), diff --git a/Core/InputOutput/TiffHandler.h b/Core/InputOutput/TiffHandler.h index 8d52c0d9ab7acf5ba83bca5562060178a92766d6..25d9124ca96819739688e8cc49d48638a412209b 100644 --- a/Core/InputOutput/TiffHandler.h +++ b/Core/InputOutput/TiffHandler.h @@ -20,7 +20,6 @@ #include "OutputData.h" #include <memory> #include <tiffio.h> -#include <tiffio.hxx> //! Reads/write tiff files, should be used through TiffReadStrategy. //! @ingroup input_output_internal diff --git a/Core/Multilayer/ISpecularStrategy.cpp b/Core/Multilayer/ISpecularStrategy.cpp deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/Core/Multilayer/ISpecularStrategy.h b/Core/Multilayer/ISpecularStrategy.h index 3bd1fe156b09ccb614b67decdd5a8b181327d9ce..3df63acf9fd3cb523d20874cc36dda5c0e73756f 100644 --- a/Core/Multilayer/ISpecularStrategy.h +++ b/Core/Multilayer/ISpecularStrategy.h @@ -3,7 +3,7 @@ // BornAgain: simulate and fit scattering at grazing incidence // //! @file Core/Multilayer/ISpecularStrategy.h -//! @brief Defines class ISpecularStrategy. +//! @brief Defines and implements class ISpecularStrategy. //! //! @homepage http://www.bornagainproject.org //! @license GNU General Public License v3 or higher (see COPYING) diff --git a/Core/Multilayer/RoughnessModels.h b/Core/Multilayer/RoughnessModels.h index 53ac4811b00cc30b8e13c3973bc5b441e2f8516c..9fb45fdda81ad9a5079ad24372a7f04f9a841312 100644 --- a/Core/Multilayer/RoughnessModels.h +++ b/Core/Multilayer/RoughnessModels.h @@ -2,7 +2,7 @@ // // BornAgain: simulate and fit scattering at grazing incidence // -//! @file Core/Computation/RoughnessModels.h +//! @file Core/Multilayer/RoughnessModels.h //! @brief Define RoughnessModels enumerator and Python wrapper. //! //! @homepage http://www.bornagainproject.org diff --git a/Core/Multilayer/SpecularStrategyBuilder.h b/Core/Multilayer/SpecularStrategyBuilder.h index dbe421cce43cedbc40cca21f3a4170b78111a386..e19d2c5aec37dc10363f7fc04c63f49b20cb195d 100644 --- a/Core/Multilayer/SpecularStrategyBuilder.h +++ b/Core/Multilayer/SpecularStrategyBuilder.h @@ -2,7 +2,7 @@ // // BornAgain: simulate and fit scattering at grazing incidence // -//! @file Core/Multilayer/SpecularStrategyBuilder.cpp +//! @file Core/Multilayer/SpecularStrategyBuilder.h //! @brief Defines class SpecularStrategyBuilder. //! //! @homepage http://www.bornagainproject.org diff --git a/Core/Simulation/DepthProbeSimulation.cpp b/Core/Simulation/DepthProbeSimulation.cpp index ea947757b5b9f471ff01d7fce9ccb3519c411623..2613ecbbd27519bbde967e868dc2f2c4cb42425d 100644 --- a/Core/Simulation/DepthProbeSimulation.cpp +++ b/Core/Simulation/DepthProbeSimulation.cpp @@ -3,7 +3,7 @@ // BornAgain: simulate and fit scattering at grazing incidence // //! @file Core/Simulation/DepthProbeSimulation.cpp -//! @brief Implements class OffSpecSimulation. +//! @brief Implements class DepthProbeSimulation //! //! @homepage http://www.bornagainproject.org //! @license GNU General Public License v3 or higher (see COPYING) diff --git a/Core/Simulation/DepthProbeSimulation.h b/Core/Simulation/DepthProbeSimulation.h index b0b016edc37ef7a6e5cdb6fa72ec963ebd4cc9e7..5aba4e2b77ec9caf70512e25eb87a03a1dd4a7d5 100644 --- a/Core/Simulation/DepthProbeSimulation.h +++ b/Core/Simulation/DepthProbeSimulation.h @@ -1,3 +1,17 @@ +// ************************************************************************** // +// +// BornAgain: simulate and fit scattering at grazing incidence +// +//! @file Core/Simulation/DepthProbeSimulation.h +//! @brief Defines class DepthProbeSimulation +//! +//! @homepage http://www.bornagainproject.org +//! @license GNU General Public License v3 or higher (see COPYING) +//! @copyright Forschungszentrum Jülich GmbH 2018 +//! @authors Scientific Computing Group at MLZ (see CITATION, AUTHORS) +// +// ************************************************************************** // + #ifndef DEPTHPROBESIMULATION_H #define DEPTHPROBESIMULATION_H diff --git a/Core/StandardSamples/IFactory.h b/Core/StandardSamples/IFactory.h index f0a0396253c2eadd910ba9dbd902092d11fa6658..7e88f7049dce8110470320db868e1eb5b4e5e0ee 100644 --- a/Core/StandardSamples/IFactory.h +++ b/Core/StandardSamples/IFactory.h @@ -98,6 +98,12 @@ protected: DescriptionMap_t m_descriptions; //!< map of correspondence of objectsId and description }; +//! Returns new instance of class T. +//! +//! This templated function is used in catalogues in form of a function pointer +//! 'create_new<T>', with no function arguments supplied. Equivalently, we could +//! use a lambda function '[](){return new T;}'. + template <class T> T* create_new() { return new T(); diff --git a/Doc/PhysicsManual/CMakeLists.txt b/Doc/PhysicsManual/CMakeLists.txt deleted file mode 100644 index 16f1f59e7dfce7bf8d2ee3d41c6c42d1f3ba487a..0000000000000000000000000000000000000000 --- a/Doc/PhysicsManual/CMakeLists.txt +++ /dev/null @@ -1,31 +0,0 @@ -# This CMakeLists.txt is not actively maintained; -# we usually do not use CMake to build the manual. - -project(BornAgainManual NONE) - -if(POLICY CMP0046) -cmake_policy(SET CMP0046 NEW) -endif() - -set(PDFLATEX_COMPILER xelatex) - -set(LATEX_COMPILER_FLAGS "-interaction=errorstopmode" CACHE STRING "Flags passed to latex." ) - -if(BORNAGAIN_USERMANUAL) - include(UseLATEX) -else() - # to compile in standalone mode - include("../../cmake/modules/UseLATEX.cmake") -endif() - -file(GLOB tex_inputs RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.tex) -file(GLOB fig_inputs RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} fig/[a-z]*/*) - -ADD_LATEX_DOCUMENT( - BornAgainManual.tex - INPUTS ${tex_inputs} ${fig_inputs} - BIBFILES jw7.bib - USE_INDEX - USE_NOMENCL - DEFAULT_PDF -) diff --git a/GUI/coregui/Models/DataViewUtils.cpp b/GUI/coregui/Models/DataViewUtils.cpp index fbb4d8f26401c4169afc55bd96aa08cd259fc352..75b6f1492d9e1803dc9576467f851fec3d5b6188 100644 --- a/GUI/coregui/Models/DataViewUtils.cpp +++ b/GUI/coregui/Models/DataViewUtils.cpp @@ -1,3 +1,17 @@ +// ************************************************************************** // +// +// BornAgain: simulate and fit scattering at grazing incidence +// +//! @file GUI/coregui/Models/DataViewUtils.cpp +//! @brief Implements functions in namespace DataViewUtils +//! +//! @homepage http://www.bornagainproject.org +//! @license GNU General Public License v3 or higher (see COPYING) +//! @copyright Forschungszentrum Jülich GmbH 2018 +//! @authors Scientific Computing Group at MLZ (see CITATION, AUTHORS) +// +// ************************************************************************** // + #include "DataViewUtils.h" #include "Data1DViewItem.h" #include "DataItem.h" diff --git a/GUI/coregui/Models/GUIDomainSampleVisitor.cpp b/GUI/coregui/Models/GUIDomainSampleVisitor.cpp index f1fc35ff8559d19d1566c967c2700ed334c302ca..fa7abfeb2eea10a7a88bbe2c470eeebc97260501 100644 --- a/GUI/coregui/Models/GUIDomainSampleVisitor.cpp +++ b/GUI/coregui/Models/GUIDomainSampleVisitor.cpp @@ -48,7 +48,7 @@ using SessionItemUtils::SetVectorItem; namespace { -SessionItem* AddFormFactorItem(SessionItem* p_parent, Constants::ModelType model_type); +SessionItem* AddFormFactorItem(SessionItem* p_parent, const QString& model_type); } GUIDomainSampleVisitor::GUIDomainSampleVisitor() : m_sampleModel(nullptr), m_materialModel(nullptr) @@ -655,7 +655,7 @@ SessionItem* GUIDomainSampleVisitor::InsertIParticle(const IParticle* p_particle namespace { -SessionItem* AddFormFactorItem(SessionItem* p_parent, Constants::ModelType model_type) +SessionItem* AddFormFactorItem(SessionItem* p_parent, const QString& model_type) { auto parent_type = p_parent->modelType(); QString property_name; diff --git a/GUI/coregui/Models/GroupItemController.cpp b/GUI/coregui/Models/GroupItemController.cpp index a694387e8928f48a6e76b9a3db2bf3082a0cc33f..2642e06ac7c6f447b8bd9314dbf6afafceaebc15 100644 --- a/GUI/coregui/Models/GroupItemController.cpp +++ b/GUI/coregui/Models/GroupItemController.cpp @@ -15,6 +15,7 @@ #include "GroupItemController.h" #include "ComboProperty.h" #include "ItemFactory.h" +#include "SessionItem.h" GroupItemController::GroupItemController(SessionItem* groupItem, GroupInfo groupInfo) : m_groupItem(groupItem), m_groupInfo(groupInfo) diff --git a/GUI/coregui/Models/ItemFactory.cpp b/GUI/coregui/Models/ItemFactory.cpp index b06675bd1f8a99ae518677e1de8e8048409425c2..f1fdebd8202079edf5118640e0bcd6b069129c51 100644 --- a/GUI/coregui/Models/ItemFactory.cpp +++ b/GUI/coregui/Models/ItemFactory.cpp @@ -15,6 +15,7 @@ #include "ItemFactory.h" #include "GUIHelpers.h" #include "ItemCatalogue.h" +#include "SessionItem.h" namespace { diff --git a/GUI/coregui/Models/ItemFactory.h b/GUI/coregui/Models/ItemFactory.h index c0598c91dff8d07907e9d071a5173894f2d6550c..f18c20f0e0e543467fc55378b2f6c373318f3a4e 100644 --- a/GUI/coregui/Models/ItemFactory.h +++ b/GUI/coregui/Models/ItemFactory.h @@ -15,7 +15,9 @@ #ifndef ITEMFACTORY_H #define ITEMFACTORY_H -#include "SessionItem.h" +#include <QString> + +class SessionItem; namespace ItemFactory { diff --git a/GUI/coregui/Models/SessionItem.cpp b/GUI/coregui/Models/SessionItem.cpp index be09fffca368ce1da97f7ad8de2c0318cc290684..d1e9f7b1249b2e7b679ed50e74f30f4e5565a92e 100644 --- a/GUI/coregui/Models/SessionItem.cpp +++ b/GUI/coregui/Models/SessionItem.cpp @@ -289,10 +289,9 @@ SessionItem* SessionItem::addProperty(const QString& name, const QVariant& varia throw GUIHelpers::Error( "ParameterizedItem::registerProperty() -> Error. Already existing property " + name); - const QString property_type = Constants::PropertyType; - SessionItem* property = ItemFactory::CreateItem(property_type); + SessionItem* property = ItemFactory::CreateItem(Constants::PropertyType); property->setDisplayName(name); - registerTag(name, 1, 1, QStringList() << property_type); + registerTag(name, 1, 1, QStringList() << Constants::PropertyType); if (!insertItem(0, property, name)) throw GUIHelpers::Error("SessionItem::addProperty -> Error. Can't insert item"); diff --git a/GUI/coregui/Models/item_constants.h b/GUI/coregui/Models/item_constants.h index 837f360f33ebda239a92eae413027386b3683006..c4e16c9e06d9da803e7cd74072df59acb2dbbca1 100644 --- a/GUI/coregui/Models/item_constants.h +++ b/GUI/coregui/Models/item_constants.h @@ -22,273 +22,271 @@ namespace Constants // --- Items ------------------------------------------------------------------- -using ModelType = QString; - -const ModelType Yes = "Yes"; -const ModelType No = "No"; - -const ModelType RootItemType = "ROOT_ITEM"; - -const ModelType LayerType = "Layer"; -const ModelType MesoCrystalType = "MesoCrystal"; -const ModelType MultiLayerType = "MultiLayer"; -const ModelType ParticleType = "Particle"; -const ModelType ParticleLayoutType = "ParticleLayout"; -const ModelType ParticleCoreShellType = "ParticleCoreShell"; -const ModelType ParticleDistributionType = "ParticleDistribution"; -const ModelType ParticleCompositionType = "ParticleComposition"; -const ModelType RotationType = "Rotation"; -const ModelType InterferenceFunction1DLatticeType = "Interference1DLattice"; -const ModelType InterferenceFunction2DLatticeType = "Interference2DLattice"; -const ModelType InterferenceFunction2DParaCrystalType = "Interference2DParaCrystal"; -const ModelType InterferenceFunctionFinite2DLatticeType = "InterferenceFinite2DLattice"; -const ModelType InterferenceFunctionHardDiskType = "InterferenceHardDisk"; -const ModelType InterferenceFunctionRadialParaCrystalType = "InterferenceRadialParaCrystal"; -const ModelType GISASInstrumentType = "GISASInstrument"; -const ModelType OffSpecInstrumentType = "OffSpecInstrument"; -const ModelType SpecularInstrumentType = "SpecularInstrument"; -const ModelType DepthProbeInstrumentType = "DepthProbeInstrument"; -const ModelType GISASBeamType = "GISASBeam"; -const ModelType SpecularBeamType = "SpecularBeam"; - -const ModelType FormFactorType = "FormFactor"; -const ModelType AnisoPyramidType = "AnisoPyramid"; -const ModelType BarGaussType = "BarGauss"; -const ModelType BarLorentzType = "BarLorentz"; -const ModelType BoxType = "Box"; -const ModelType ConeType = "Cone"; -const ModelType Cone6Type = "Cone6"; -const ModelType CuboctahedronType = "Cuboctahedron"; -const ModelType CylinderType = "Cylinder"; -const ModelType DodecahedronType = "Dodecahedron"; -const ModelType DotType = "Dot"; -const ModelType EllipsoidalCylinderType = "EllipsoidalCylinder"; -const ModelType FullSphereType = "FullSphere"; -const ModelType FullSpheroidType = "FullSpheroid"; -const ModelType HemiEllipsoidType = "HemiEllipsoid"; -const ModelType IcosahedronType = "Icosahedron"; -const ModelType Prism3Type = "Prism3"; -const ModelType Prism6Type = "Prism6"; -const ModelType PyramidType = "Pyramid"; -const ModelType Ripple1BoxType = "Ripple1Box"; -const ModelType Ripple1GaussType = "Ripple1Gauss"; -const ModelType Ripple1LorentzType = "Ripple1Lorentz"; -const ModelType Ripple2BoxType = "Ripple2Box"; -const ModelType Ripple2GaussType = "Ripple2Gauss"; -const ModelType Ripple2LorentzType = "Ripple2Lorentz"; -const ModelType TetrahedronType = "Tetrahedron"; -const ModelType TruncatedCubeType = "TruncatedCube"; -const ModelType TruncatedSphereType = "TruncatedSphere"; -const ModelType TruncatedSpheroidType = "TruncatedSpheroid"; - -const ModelType XRotationType = "XRotation"; -const ModelType YRotationType = "YRotation"; -const ModelType ZRotationType = "ZRotation"; -const ModelType EulerRotationType = "EulerRotation"; - -const ModelType PropertyType = "Property"; -const ModelType VectorType = "Vector"; -const ModelType GroupItemType = "GroupProperty"; - -const ModelType LayerBasicRoughnessType = "LayerBasicRoughness"; -const ModelType LayerZeroRoughnessType = "LayerZeroRoughness"; - -const ModelType SphericalDetectorType = "SphericalDetector"; -const ModelType RectangularDetectorType = "RectangularDetector"; - -const ModelType DistributionNoneType = "DistributionNone"; -const ModelType DistributionGateType = "DistributionGate"; -const ModelType DistributionLorentzType = "DistributionLorentz"; -const ModelType DistributionGaussianType = "DistributionGaussian"; -const ModelType DistributionLogNormalType = "DistributionLogNormal"; -const ModelType DistributionCosineType = "DistributionCosine"; -const ModelType DistributionTrapezoidType = "DistributionTrapezoid"; - -const ModelType FTDistribution1DCauchyType = "FTDistribution1DCauchy"; -const ModelType FTDistribution1DGaussType = "FTDistribution1DGauss"; -const ModelType FTDistribution1DGateType = "FTDistribution1DGate"; -const ModelType FTDistribution1DTriangleType = "FTDistribution1DTriangle"; -const ModelType FTDistribution1DCosineType = "FTDistribution1DCosine"; -const ModelType FTDistribution1DVoigtType = "FTDistribution1DVoigt"; - -const ModelType FTDistribution2DCauchyType = "FTDistribution2DCauchy"; -const ModelType FTDistribution2DGaussType = "FTDistribution2DGauss"; -const ModelType FTDistribution2DGateType = "FTDistribution2DGate"; -const ModelType FTDistribution2DConeType = "FTDistribution2DCone"; -const ModelType FTDistribution2DVoigtType = "FTDistribution2DVoigt"; - -const ModelType FTDecayFunction1DCauchyType = "FTDecayFunction1DCauchy"; -const ModelType FTDecayFunction1DGaussType = "FTDecayFunction1DGauss"; -const ModelType FTDecayFunction1DTriangleType = "FTDecayFunction1DTriangle"; -const ModelType FTDecayFunction1DVoigtType = "FTDecayFunction1DVoigt"; - -const ModelType FTDecayFunction2DCauchyType = "FTDecayFunction2DCauchy"; -const ModelType FTDecayFunction2DGaussType = "FTDecayFunction2DGauss"; -const ModelType FTDecayFunction2DVoigtType = "FTDecayFunction2DVoigt"; - -const ModelType BasicLatticeType = "BasicLattice"; -const ModelType SquareLatticeType = "SquareLattice"; -const ModelType HexagonalLatticeType = "HexagonalLattice"; - -const ModelType MaterialType = "Material"; -const ModelType MaterialContainerType = "MaterialContainer"; - -const ModelType MaterialRefractiveDataType = "MaterialRefractiveData"; -const ModelType MaterialSLDDataType = "MaterialSLDData"; - -const ModelType MagneticFieldType = "MagneticField"; - -const ModelType ParameterContainerType = "Parameter Container"; -const ModelType ParameterType = "Parameter"; -const ModelType ParameterLabelType = "Parameter Label"; - -const ModelType FitParameterContainerType = "FitParameterContainer"; -const ModelType FitParameterType = "FitParameter"; -const ModelType FitParameterLinkType = "FitParameterLink"; -const ModelType FitSuiteType = "FitSuite"; - -const ModelType JobItemType = "JobItem"; -const ModelType IntensityDataType = "IntensityData"; -const ModelType SpecularDataType = "SpecularData"; -const ModelType Data1DViewItemType = "Data1DViewItem"; -const ModelType DataPropertyContainerType = "DataPropertyContainer"; -const ModelType DataItem1DPropertiesType = "DataItem1DProperties"; - -const ModelType BasicAxisType = "BasicAxis"; -const ModelType PointwiseAxisType = "PointwiseAxis"; -const ModelType AmplitudeAxisType = "AmplitudeAxis"; - -const ModelType BeamDistributionType = "BeamDistribution"; -const ModelType BeamWavelengthType = "BeamWavelength"; -const ModelType BeamAzimuthalAngleType = "BeamAzimuthalAngle"; -const ModelType BeamInclinationAngleType = "BeamInclinationAngle"; -const ModelType SpecularBeamInclinationType = "SpecularBeamInclinationAxis"; -const ModelType SpecularBeamWavelengthType = "SpecularBeamWavelength"; - -const ModelType ResolutionFunctionNoneType = "ResolutionFunctionNone"; -const ModelType ResolutionFunction2DGaussianType = "ResolutionFunction2DGaussian"; - -const ModelType MaskContainerType = "MaskContainer"; -const ModelType RectangleMaskType = "RectangleMask"; -const ModelType PolygonMaskType = "PolygonMask"; -const ModelType PolygonPointType = "PolygonPoint"; -const ModelType EllipseMaskType = "EllipseMask"; -const ModelType VerticalLineMaskType = "VerticalLineMask"; -const ModelType HorizontalLineMaskType = "HorizontalLineMask"; -const ModelType MaskAllType = "MaskAllMask"; - -const ModelType RegionOfInterestType = "RegionOfInterest"; - -const ModelType SimulationOptionsType = "SimulationOptions"; - -const ModelType RealDataType = "RealData"; - -const ModelType MinimizerContainerType = "MinimizerContainer"; -const ModelType MinuitMinimizerType = "Minuit2"; -const ModelType GSLMultiMinimizerType = "GSLMultiMin"; -const ModelType GSLLMAMinimizerType = "GSLLMA"; -const ModelType GSLSimAnMinimizerType = "GSLSimAn"; -const ModelType GeneticMinimizerType = "Genetic"; -const ModelType TestMinimizerType = "Test"; - -const ModelType RealLimitsLimitlessType = "RealLimitsLimitless"; -const ModelType RealLimitsPositiveType = "RealLimitsPositive"; -const ModelType RealLimitsNonnegativeType = "RealLimitsNonnegative"; -const ModelType RealLimitsLowerLimitedType = "RealLimitsLowerLimited"; -const ModelType RealLimitsUpperLimitedType = "RealLimitsUpperLimited"; -const ModelType RealLimitsLimitedType = "RealLimitsLimited"; - -const ModelType ProjectionContainerType = "ProjectionContainer"; - -const ModelType BackgroundNoneType = "NoBackground"; -const ModelType ConstantBackgroundType = "ConstantBackground"; -const ModelType PoissonNoiseBackgroundType = "PoissonNoiseBackground"; - -const ModelType FootprintNoneType = "NoFootprint"; -const ModelType FootprintGaussianType = "GaussianFootrpint"; -const ModelType FootprintSquareType = "SquareFootprint"; - -const ModelType VarianceConstantFunctionType = "VarianceConstantFunction"; -const ModelType VarianceSimFunctionType = "VarianceSimFunction"; +const QString Yes = "Yes"; +const QString No = "No"; + +const QString RootItemType = "ROOT_ITEM"; + +const QString LayerType = "Layer"; +const QString MesoCrystalType = "MesoCrystal"; +const QString MultiLayerType = "MultiLayer"; +const QString ParticleType = "Particle"; +const QString ParticleLayoutType = "ParticleLayout"; +const QString ParticleCoreShellType = "ParticleCoreShell"; +const QString ParticleDistributionType = "ParticleDistribution"; +const QString ParticleCompositionType = "ParticleComposition"; +const QString RotationType = "Rotation"; +const QString InterferenceFunction1DLatticeType = "Interference1DLattice"; +const QString InterferenceFunction2DLatticeType = "Interference2DLattice"; +const QString InterferenceFunction2DParaCrystalType = "Interference2DParaCrystal"; +const QString InterferenceFunctionFinite2DLatticeType = "InterferenceFinite2DLattice"; +const QString InterferenceFunctionHardDiskType = "InterferenceHardDisk"; +const QString InterferenceFunctionRadialParaCrystalType = "InterferenceRadialParaCrystal"; +const QString GISASInstrumentType = "GISASInstrument"; +const QString OffSpecInstrumentType = "OffSpecInstrument"; +const QString SpecularInstrumentType = "SpecularInstrument"; +const QString DepthProbeInstrumentType = "DepthProbeInstrument"; +const QString GISASBeamType = "GISASBeam"; +const QString SpecularBeamType = "SpecularBeam"; + +const QString FormFactorType = "FormFactor"; +const QString AnisoPyramidType = "AnisoPyramid"; +const QString BarGaussType = "BarGauss"; +const QString BarLorentzType = "BarLorentz"; +const QString BoxType = "Box"; +const QString ConeType = "Cone"; +const QString Cone6Type = "Cone6"; +const QString CuboctahedronType = "Cuboctahedron"; +const QString CylinderType = "Cylinder"; +const QString DodecahedronType = "Dodecahedron"; +const QString DotType = "Dot"; +const QString EllipsoidalCylinderType = "EllipsoidalCylinder"; +const QString FullSphereType = "FullSphere"; +const QString FullSpheroidType = "FullSpheroid"; +const QString HemiEllipsoidType = "HemiEllipsoid"; +const QString IcosahedronType = "Icosahedron"; +const QString Prism3Type = "Prism3"; +const QString Prism6Type = "Prism6"; +const QString PyramidType = "Pyramid"; +const QString Ripple1BoxType = "Ripple1Box"; +const QString Ripple1GaussType = "Ripple1Gauss"; +const QString Ripple1LorentzType = "Ripple1Lorentz"; +const QString Ripple2BoxType = "Ripple2Box"; +const QString Ripple2GaussType = "Ripple2Gauss"; +const QString Ripple2LorentzType = "Ripple2Lorentz"; +const QString TetrahedronType = "Tetrahedron"; +const QString TruncatedCubeType = "TruncatedCube"; +const QString TruncatedSphereType = "TruncatedSphere"; +const QString TruncatedSpheroidType = "TruncatedSpheroid"; + +const QString XRotationType = "XRotation"; +const QString YRotationType = "YRotation"; +const QString ZRotationType = "ZRotation"; +const QString EulerRotationType = "EulerRotation"; + +const QString PropertyType = "Property"; +const QString VectorType = "Vector"; +const QString GroupItemType = "GroupProperty"; + +const QString LayerBasicRoughnessType = "LayerBasicRoughness"; +const QString LayerZeroRoughnessType = "LayerZeroRoughness"; + +const QString SphericalDetectorType = "SphericalDetector"; +const QString RectangularDetectorType = "RectangularDetector"; + +const QString DistributionNoneType = "DistributionNone"; +const QString DistributionGateType = "DistributionGate"; +const QString DistributionLorentzType = "DistributionLorentz"; +const QString DistributionGaussianType = "DistributionGaussian"; +const QString DistributionLogNormalType = "DistributionLogNormal"; +const QString DistributionCosineType = "DistributionCosine"; +const QString DistributionTrapezoidType = "DistributionTrapezoid"; + +const QString FTDistribution1DCauchyType = "FTDistribution1DCauchy"; +const QString FTDistribution1DGaussType = "FTDistribution1DGauss"; +const QString FTDistribution1DGateType = "FTDistribution1DGate"; +const QString FTDistribution1DTriangleType = "FTDistribution1DTriangle"; +const QString FTDistribution1DCosineType = "FTDistribution1DCosine"; +const QString FTDistribution1DVoigtType = "FTDistribution1DVoigt"; + +const QString FTDistribution2DCauchyType = "FTDistribution2DCauchy"; +const QString FTDistribution2DGaussType = "FTDistribution2DGauss"; +const QString FTDistribution2DGateType = "FTDistribution2DGate"; +const QString FTDistribution2DConeType = "FTDistribution2DCone"; +const QString FTDistribution2DVoigtType = "FTDistribution2DVoigt"; + +const QString FTDecayFunction1DCauchyType = "FTDecayFunction1DCauchy"; +const QString FTDecayFunction1DGaussType = "FTDecayFunction1DGauss"; +const QString FTDecayFunction1DTriangleType = "FTDecayFunction1DTriangle"; +const QString FTDecayFunction1DVoigtType = "FTDecayFunction1DVoigt"; + +const QString FTDecayFunction2DCauchyType = "FTDecayFunction2DCauchy"; +const QString FTDecayFunction2DGaussType = "FTDecayFunction2DGauss"; +const QString FTDecayFunction2DVoigtType = "FTDecayFunction2DVoigt"; + +const QString BasicLatticeType = "BasicLattice"; +const QString SquareLatticeType = "SquareLattice"; +const QString HexagonalLatticeType = "HexagonalLattice"; + +const QString MaterialType = "Material"; +const QString MaterialContainerType = "MaterialContainer"; + +const QString MaterialRefractiveDataType = "MaterialRefractiveData"; +const QString MaterialSLDDataType = "MaterialSLDData"; + +const QString MagneticFieldType = "MagneticField"; + +const QString ParameterContainerType = "Parameter Container"; +const QString ParameterType = "Parameter"; +const QString ParameterLabelType = "Parameter Label"; + +const QString FitParameterContainerType = "FitParameterContainer"; +const QString FitParameterType = "FitParameter"; +const QString FitParameterLinkType = "FitParameterLink"; +const QString FitSuiteType = "FitSuite"; + +const QString JobItemType = "JobItem"; +const QString IntensityDataType = "IntensityData"; +const QString SpecularDataType = "SpecularData"; +const QString Data1DViewItemType = "Data1DViewItem"; +const QString DataPropertyContainerType = "DataPropertyContainer"; +const QString DataItem1DPropertiesType = "DataItem1DProperties"; + +const QString BasicAxisType = "BasicAxis"; +const QString PointwiseAxisType = "PointwiseAxis"; +const QString AmplitudeAxisType = "AmplitudeAxis"; + +const QString BeamDistributionType = "BeamDistribution"; +const QString BeamWavelengthType = "BeamWavelength"; +const QString BeamAzimuthalAngleType = "BeamAzimuthalAngle"; +const QString BeamInclinationAngleType = "BeamInclinationAngle"; +const QString SpecularBeamInclinationType = "SpecularBeamInclinationAxis"; +const QString SpecularBeamWavelengthType = "SpecularBeamWavelength"; + +const QString ResolutionFunctionNoneType = "ResolutionFunctionNone"; +const QString ResolutionFunction2DGaussianType = "ResolutionFunction2DGaussian"; + +const QString MaskContainerType = "MaskContainer"; +const QString RectangleMaskType = "RectangleMask"; +const QString PolygonMaskType = "PolygonMask"; +const QString PolygonPointType = "PolygonPoint"; +const QString EllipseMaskType = "EllipseMask"; +const QString VerticalLineMaskType = "VerticalLineMask"; +const QString HorizontalLineMaskType = "HorizontalLineMask"; +const QString MaskAllType = "MaskAllMask"; + +const QString RegionOfInterestType = "RegionOfInterest"; + +const QString SimulationOptionsType = "SimulationOptions"; + +const QString RealDataType = "RealData"; + +const QString MinimizerContainerType = "MinimizerContainer"; +const QString MinuitMinimizerType = "Minuit2"; +const QString GSLMultiMinimizerType = "GSLMultiMin"; +const QString GSLLMAMinimizerType = "GSLLMA"; +const QString GSLSimAnMinimizerType = "GSLSimAn"; +const QString GeneticMinimizerType = "Genetic"; +const QString TestMinimizerType = "Test"; + +const QString RealLimitsLimitlessType = "RealLimitsLimitless"; +const QString RealLimitsPositiveType = "RealLimitsPositive"; +const QString RealLimitsNonnegativeType = "RealLimitsNonnegative"; +const QString RealLimitsLowerLimitedType = "RealLimitsLowerLimited"; +const QString RealLimitsUpperLimitedType = "RealLimitsUpperLimited"; +const QString RealLimitsLimitedType = "RealLimitsLimited"; + +const QString ProjectionContainerType = "ProjectionContainer"; + +const QString BackgroundNoneType = "NoBackground"; +const QString ConstantBackgroundType = "ConstantBackground"; +const QString PoissonNoiseBackgroundType = "PoissonNoiseBackground"; + +const QString FootprintNoneType = "NoFootprint"; +const QString FootprintGaussianType = "GaussianFootrpint"; +const QString FootprintSquareType = "SquareFootprint"; + +const QString VarianceConstantFunctionType = "VarianceConstantFunction"; +const QString VarianceSimFunctionType = "VarianceSimFunction"; // --- Groups ------------------------------------------------------------------ -const ModelType FormFactorGroup = "Form Factor"; -const ModelType RotationGroup = "Rotation group"; -const ModelType LayerRoughnessGroup = "Roughness"; -const ModelType DetectorGroup = "Detector group"; -const ModelType DistributionGroup = "Distribution group"; -const ModelType DistributionExtendedGroup = "Distribution extended group"; -const ModelType SymmetricDistributionGroup = "Symmetric distribution group"; -const ModelType FTDistribution1DGroup = "PDF 1D"; -const ModelType FTDistribution2DGroup = "PDF 2D"; -const ModelType FTDecayFunction1DGroup = "Decay function 1D"; -const ModelType FTDecayFunction2DGroup = "Decay function 2D"; -const ModelType LatticeGroup = "Lattice group"; -const ModelType MaterialGroup = "Material group"; -const ModelType ResolutionFunctionGroup = "Resolution function group"; -const ModelType MinimizerLibraryGroup = "Minimizer library group"; -const ModelType RealLimitsGroup = "RealLimits group"; -const ModelType BackgroundGroup = "Background group"; -const ModelType MaterialDataGroup = "Material data group"; -const ModelType FootprintGroup = "Footprint group"; -const ModelType AxesGroup = "Axes group"; -const ModelType VarianceFunctionGroup = "Variance group"; +const QString FormFactorGroup = "Form Factor"; +const QString RotationGroup = "Rotation group"; +const QString LayerRoughnessGroup = "Roughness"; +const QString DetectorGroup = "Detector group"; +const QString DistributionGroup = "Distribution group"; +const QString DistributionExtendedGroup = "Distribution extended group"; +const QString SymmetricDistributionGroup = "Symmetric distribution group"; +const QString FTDistribution1DGroup = "PDF 1D"; +const QString FTDistribution2DGroup = "PDF 2D"; +const QString FTDecayFunction1DGroup = "Decay function 1D"; +const QString FTDecayFunction2DGroup = "Decay function 2D"; +const QString LatticeGroup = "Lattice group"; +const QString MaterialGroup = "Material group"; +const QString ResolutionFunctionGroup = "Resolution function group"; +const QString MinimizerLibraryGroup = "Minimizer library group"; +const QString RealLimitsGroup = "RealLimits group"; +const QString BackgroundGroup = "Background group"; +const QString MaterialDataGroup = "Material data group"; +const QString FootprintGroup = "Footprint group"; +const QString AxesGroup = "Axes group"; +const QString VarianceFunctionGroup = "Variance group"; // --- Units&Constants---------------------------------------------------------- -const ModelType UnitsNbins = "nbins"; -const ModelType UnitsRadians = "Radians"; -const ModelType UnitsDegrees = "Degrees"; -const ModelType UnitsMm = "mm"; -const ModelType UnitsQyQz = "q-space"; - -const ModelType STATUS_IDLE = "Idle"; -const ModelType STATUS_RUNNING = "Running"; -const ModelType STATUS_FITTING = "Fitting"; -const ModelType STATUS_COMPLETED = "Completed"; -const ModelType STATUS_CANCELED = "Canceled"; -const ModelType STATUS_FAILED = "Failed"; - -const ModelType GRADIENT_GRAYSCALE = "Grayscale"; -const ModelType GRADIENT_HOT = "Hot"; -const ModelType GRADIENT_COLD = "Cold"; -const ModelType GRADIENT_NIGHT = "Night"; -const ModelType GRADIENT_CANDY = "Candy"; -const ModelType GRADIENT_GEOGRAPHY = "Geography"; -const ModelType GRADIENT_ION = "Ion"; -const ModelType GRADIENT_THERMAL = "Thermal"; -const ModelType GRADIENT_POLAR = "Polar"; -const ModelType GRADIENT_SPECTRUM = "Spectrum"; -const ModelType GRADIENT_JET = "Jet"; -const ModelType GRADIENT_HUES = "Hues"; - -const ModelType JOB_RUN_IMMEDIATELY = "Immediately"; -const ModelType JOB_RUN_IN_BACKGROUND = "In background"; -const ModelType JOB_BACKUP = "_backup"; - -const ModelType SIMULATION_ANALYTICAL = "Analytical"; -const ModelType SIMULATION_MONTECARLO = "Monte-Carlo Integration"; - -const ModelType ALIGNMENT_GENERIC = "Generic"; -const ModelType ALIGNMENT_TO_SAMPLE = "Perpendicular to sample x-axis"; -const ModelType ALIGNMENT_TO_DIRECT_BEAM = "Perpendicular to direct beam"; -const ModelType ALIGNMENT_TO_REFLECTED_BEAM = "Perpendicular to reflected beam"; -const ModelType ALIGNMENT_TO_REFLECTED_BEAM_DPOS = "Perpendicular to reflected beam (dpos)"; - -const ModelType FITPAR_FIXED = "fixed"; -const ModelType FITPAR_LIMITED = "limited"; -const ModelType FITPAR_LOWERLIMITED = "lower limited"; -const ModelType FITPAR_UPPERLIMITED = "upper limited"; -const ModelType FITPAR_FREE = "free"; - -const ModelType DistributionSigmaFactor = "Sigma factor"; - -const ModelType LAYOUT_DA = "Decoupling Approximation"; -const ModelType LAYOUT_SSCA = "Size Space Coupling Approximation"; - -const ModelType AMBIENT_LAYER_MATERIAL = "Ambient Layer Material"; -const ModelType AVERAGE_LAYER_MATERIAL = "Average Layer Material"; +const QString UnitsNbins = "nbins"; +const QString UnitsRadians = "Radians"; +const QString UnitsDegrees = "Degrees"; +const QString UnitsMm = "mm"; +const QString UnitsQyQz = "q-space"; + +const QString STATUS_IDLE = "Idle"; +const QString STATUS_RUNNING = "Running"; +const QString STATUS_FITTING = "Fitting"; +const QString STATUS_COMPLETED = "Completed"; +const QString STATUS_CANCELED = "Canceled"; +const QString STATUS_FAILED = "Failed"; + +const QString GRADIENT_GRAYSCALE = "Grayscale"; +const QString GRADIENT_HOT = "Hot"; +const QString GRADIENT_COLD = "Cold"; +const QString GRADIENT_NIGHT = "Night"; +const QString GRADIENT_CANDY = "Candy"; +const QString GRADIENT_GEOGRAPHY = "Geography"; +const QString GRADIENT_ION = "Ion"; +const QString GRADIENT_THERMAL = "Thermal"; +const QString GRADIENT_POLAR = "Polar"; +const QString GRADIENT_SPECTRUM = "Spectrum"; +const QString GRADIENT_JET = "Jet"; +const QString GRADIENT_HUES = "Hues"; + +const QString JOB_RUN_IMMEDIATELY = "Immediately"; +const QString JOB_RUN_IN_BACKGROUND = "In background"; +const QString JOB_BACKUP = "_backup"; + +const QString SIMULATION_ANALYTICAL = "Analytical"; +const QString SIMULATION_MONTECARLO = "Monte-Carlo Integration"; + +const QString ALIGNMENT_GENERIC = "Generic"; +const QString ALIGNMENT_TO_SAMPLE = "Perpendicular to sample x-axis"; +const QString ALIGNMENT_TO_DIRECT_BEAM = "Perpendicular to direct beam"; +const QString ALIGNMENT_TO_REFLECTED_BEAM = "Perpendicular to reflected beam"; +const QString ALIGNMENT_TO_REFLECTED_BEAM_DPOS = "Perpendicular to reflected beam (dpos)"; + +const QString FITPAR_FIXED = "fixed"; +const QString FITPAR_LIMITED = "limited"; +const QString FITPAR_LOWERLIMITED = "lower limited"; +const QString FITPAR_UPPERLIMITED = "upper limited"; +const QString FITPAR_FREE = "free"; + +const QString DistributionSigmaFactor = "Sigma factor"; + +const QString LAYOUT_DA = "Decoupling Approximation"; +const QString LAYOUT_SSCA = "Size Space Coupling Approximation"; + +const QString AMBIENT_LAYER_MATERIAL = "Ambient Layer Material"; +const QString AVERAGE_LAYER_MATERIAL = "Average Layer Material"; // --- Presentation types ---------------------------------------------------------- @@ -301,16 +299,17 @@ const QString MaskEditorPresentation = "Mask Editor"; // --- Custom variants ---------------------------------------------------------- -const ModelType ExternalPropertyType = "ExternalProperty"; -const ModelType ComboPropertyType = "ComboProperty"; +const QString ExternalPropertyType = "ExternalProperty"; +const QString ComboPropertyType = "ComboProperty"; + +// --- Custom editors for variant properties --- +const QString DefaultEditorType = "Default"; +const QString ScientificEditorType = "SceintificDouble"; +const QString ScientificSpinBoxType = "ScientificSpinBox"; +const QString MaterialEditorExternalType = "ExtMaterialEditor"; +const QString ColorEditorExternalType = "ExtColorEditor"; +const QString MultiSelectionComboEditorType = "MultiSelectionComboEditor"; -// --- Custom editors for variant propertues --- -const ModelType DefaultEditorType = "Default"; -const ModelType ScientificEditorType = "SceintificDouble"; -const ModelType ScientificSpinBoxType = "ScientificSpinBox"; -const ModelType MaterialEditorExternalType = "ExtMaterialEditor"; -const ModelType ColorEditorExternalType = "ExtColorEditor"; -const ModelType MultiSelectionComboEditorType = "MultiSelectionComboEditor"; } // namespace Constants #endif // ITEM_CONSTANTS_H diff --git a/GUI/coregui/Views/FitWidgets/FitComparisonViewController.cpp b/GUI/coregui/Views/FitWidgets/FitComparisonViewController.cpp index bc6c850b0c4c1f077a280885fe361e04cd9041f2..ff02cbd260ec0bbc0a3e6136e89ae91e8c3272a0 100644 --- a/GUI/coregui/Views/FitWidgets/FitComparisonViewController.cpp +++ b/GUI/coregui/Views/FitWidgets/FitComparisonViewController.cpp @@ -1,3 +1,17 @@ +// ************************************************************************** // +// +// BornAgain: simulate and fit scattering at grazing incidence +// +//! @file GUI/coregui/Views/FitWidgets/FitComparisonViewController.cpp +//! @brief Implements classes DiffItemController, FitComparison1DViewController +//! +//! @homepage http://www.bornagainproject.org +//! @license GNU General Public License v3 or higher (see COPYING) +//! @copyright Forschungszentrum Jülich GmbH 2018 +//! @authors Scientific Computing Group at MLZ (see CITATION, AUTHORS) +// +// ************************************************************************** // + #include "FitComparisonViewController.h" #include "AxesItems.h" #include "Data1DViewItem.h" diff --git a/GUI/coregui/Views/FitWidgets/FitComparisonViewController.h b/GUI/coregui/Views/FitWidgets/FitComparisonViewController.h index 18876de4cd20a22742254ed1801997498d81f0ef..59c7872d13382ddca225688e4205d433e40b8694 100644 --- a/GUI/coregui/Views/FitWidgets/FitComparisonViewController.h +++ b/GUI/coregui/Views/FitWidgets/FitComparisonViewController.h @@ -1,3 +1,17 @@ +// ************************************************************************** // +// +// BornAgain: simulate and fit scattering at grazing incidence +// +//! @file GUI/coregui/Views/FitWidgets/FitComparisonViewController.h +//! @brief Defines classes DiffItemController, FitComparison1DViewController +//! +//! @homepage http://www.bornagainproject.org +//! @license GNU General Public License v3 or higher (see COPYING) +//! @copyright Forschungszentrum Jülich GmbH 2018 +//! @authors Scientific Computing Group at MLZ (see CITATION, AUTHORS) +// +// ************************************************************************** // + #ifndef FITCOMPARISONVIEWCONTROLLER_H #define FITCOMPARISONVIEWCONTROLLER_H diff --git a/GUI/coregui/Views/InstrumentWidgets/SpecularInstrumentEditor.cpp b/GUI/coregui/Views/InstrumentWidgets/SpecularInstrumentEditor.cpp index af3ca4cbe91bc68ced48e3a4625cdbedfcacde81..b83ca53dbfe412b4fa8e899dc5ee11ca0e77bd35 100644 --- a/GUI/coregui/Views/InstrumentWidgets/SpecularInstrumentEditor.cpp +++ b/GUI/coregui/Views/InstrumentWidgets/SpecularInstrumentEditor.cpp @@ -1,3 +1,17 @@ +// ************************************************************************** // +// +// BornAgain: simulate and fit scattering at grazing incidence +// +//! @file GUI/coregui/Views/InstrumentWidgets/SpecularInstrumentEditor.cpp +//! @brief Implements class SpecularInstrumentEditor +//! +//! @homepage http://www.bornagainproject.org +//! @license GNU General Public License v3 or higher (see COPYING) +//! @copyright Forschungszentrum Jülich GmbH 2018 +//! @authors Scientific Computing Group at MLZ (see CITATION, AUTHORS) +// +// ************************************************************************** // + #include "SpecularInstrumentEditor.h" #include "ColumnResizer.h" #include "EnvironmentEditor.h" diff --git a/GUI/coregui/Views/IntensityDataWidgets/ScientificPlot.cpp b/GUI/coregui/Views/IntensityDataWidgets/ScientificPlot.cpp index f1be45cfd06b7463e19af1c673d08af6a9fec9e9..1cb3a19011be921751cca874ad56c3afe40dce7c 100644 --- a/GUI/coregui/Views/IntensityDataWidgets/ScientificPlot.cpp +++ b/GUI/coregui/Views/IntensityDataWidgets/ScientificPlot.cpp @@ -1,3 +1,17 @@ +// ************************************************************************** // +// +// BornAgain: simulate and fit scattering at grazing incidence +// +//! @file GUI/coregui/Views/IntensityDataWidgets/ScientificPlot.cpp +//! @brief Implements class ScientificPlot +//! +//! @homepage http://www.bornagainproject.org +//! @license GNU General Public License v3 or higher (see COPYING) +//! @copyright Forschungszentrum Jülich GmbH 2018 +//! @authors Scientific Computing Group at MLZ (see CITATION, AUTHORS) +// +// ************************************************************************** // + #include "ScientificPlot.h" #include "ScientificPlotEvent.h" #include <qcustomplot.h> diff --git a/GUI/coregui/Views/SampleDesigner/ViewTypes.h b/GUI/coregui/Views/SampleDesigner/ViewTypes.h index 234b3d1c36c33810c65acfd68af2272c5fa4fdcc..8ea6c710a2ce68368b219f9ae5cced1fe9c54283 100644 --- a/GUI/coregui/Views/SampleDesigner/ViewTypes.h +++ b/GUI/coregui/Views/SampleDesigner/ViewTypes.h @@ -2,8 +2,8 @@ // // BornAgain: simulate and fit scattering at grazing incidence // -//! @file GUI/coregui/Views/SampleDesigner/IView.h -//! @brief Defines class IView +//! @file GUI/coregui/Views/SampleDesigner/ViewTypes.h +//! @brief Defines namespace ViewTypes with enum EWidgetTypes (nothing to implement) //! //! @homepage http://www.bornagainproject.org //! @license GNU General Public License v3 or higher (see COPYING) diff --git a/Wrap/swig/doxy2swig.py b/Wrap/swig/doxy2swig.py index 7fb59d4428012a3522831b57eb2e4890afad42f8..ed592fcd90d599dceb7fadc5dfb606a95bdbdabe 100755 --- a/Wrap/swig/doxy2swig.py +++ b/Wrap/swig/doxy2swig.py @@ -2,9 +2,7 @@ """Doxygen XML to SWIG docstring converter. Converts Doxygen generated XML files into a file containing docstrings -that can be used by SWIG-1.3.x. Note that you need to get SWIG -version > 1.3.23 or use Robin Dunn's docstring patch to be able to use -the resulting output. +that can be used by Swig. Usage: @@ -49,9 +47,8 @@ def my_open_write(dest, mode='w'): class Doxy2SWIG: """Converts Doxygen generated XML files into a file containing - docstrings that can be used by SWIG-1.3.x that have support for - feature("docstring"). Once the data is parsed it is stored in - self.pieces. + docstrings that can be used by Swig. Once the data is parsed it + is stored in self.pieces. """ diff --git a/auto/Wrap/doxygen_core.i b/auto/Wrap/doxygen_core.i index e8b51ca7a1eb4662116e8c8886c56d545b73d8f0..a88839728280a0506ffb375e5fae725f6a775171 100644 --- a/auto/Wrap/doxygen_core.i +++ b/auto/Wrap/doxygen_core.i @@ -8314,7 +8314,7 @@ Sets depth of the visitor in the composite hierarchy. // File: classInstrument.xml %feature("docstring") Instrument " -Assembles beam, detector and their relative positions wrt the sample. +Assembles beam, detector and their relative positions with respect to the sample. C++ includes: Instrument.h "; @@ -17211,76 +17211,76 @@ C++ includes: ZLimits.h // File: namespace_0d374.xml -// File: namespace_0d387.xml +// File: namespace_0d386.xml -// File: namespace_0d391.xml +// File: namespace_0d390.xml // File: namespace_0d40.xml -// File: namespace_0d403.xml +// File: namespace_0d402.xml -// File: namespace_0d409.xml +// File: namespace_0d408.xml -// File: namespace_0d414.xml +// File: namespace_0d413.xml -// File: namespace_0d416.xml +// File: namespace_0d415.xml -// File: namespace_0d42.xml +// File: namespace_0d419.xml -// File: namespace_0d420.xml +// File: namespace_0d42.xml -// File: namespace_0d422.xml +// File: namespace_0d421.xml -// File: namespace_0d432.xml +// File: namespace_0d431.xml -// File: namespace_0d445.xml +// File: namespace_0d444.xml -// File: namespace_0d454.xml +// File: namespace_0d453.xml -// File: namespace_0d456.xml +// File: namespace_0d455.xml -// File: namespace_0d490.xml +// File: namespace_0d489.xml -// File: namespace_0d497.xml +// File: namespace_0d496.xml -// File: namespace_0d535.xml +// File: namespace_0d534.xml -// File: namespace_0d543.xml +// File: namespace_0d542.xml -// File: namespace_0d545.xml +// File: namespace_0d544.xml -// File: namespace_0d547.xml +// File: namespace_0d546.xml // File: namespace_0d6.xml -// File: namespace_0d631.xml +// File: namespace_0d630.xml -// File: namespace_0d635.xml +// File: namespace_0d634.xml -// File: namespace_0d659.xml +// File: namespace_0d658.xml // File: namespace_0d97.xml @@ -19616,9 +19616,6 @@ Creates averaged material. Square refractive index of returned material is arith // File: InterferenceFunctionUtils_8h.xml -// File: ISpecularStrategy_8cpp.xml - - // File: ISpecularStrategy_8h.xml @@ -20332,6 +20329,10 @@ Generate vertices of centered ellipse with given semi-axes at height z. // File: IFactory_8h.xml %feature("docstring") create_new "T* create_new() + +Returns new instance of class T. + +This templated function is used in catalogues in form of a function pointer 'create_new<T>', with no function arguments supplied. Equivalently, we could use a lambda function '[](){return new T;}'. "; diff --git a/auto/Wrap/libBornAgainCore.py b/auto/Wrap/libBornAgainCore.py index a3543403f18801234fb543009d97ef7e9cda0981..dfc4e8df16c5e4bb0df0ffd05e7eaf0f0b704ea6 100644 --- a/auto/Wrap/libBornAgainCore.py +++ b/auto/Wrap/libBornAgainCore.py @@ -16641,7 +16641,7 @@ class Instrument(INode): r""" - Assembles beam, detector and their relative positions wrt the sample. + Assembles beam, detector and their relative positions with respect to the sample. C++ includes: Instrument.h diff --git a/cmake/bornagain/modules/BornAgainCPack.cmake b/cmake/bornagain/modules/BornAgainCPack.cmake index 0977d0f07919124fdf4b8ac7616c6932a63786df..4bd2056e4e2c75dc57ebf62b537e20858703367c 100644 --- a/cmake/bornagain/modules/BornAgainCPack.cmake +++ b/cmake/bornagain/modules/BornAgainCPack.cmake @@ -48,7 +48,8 @@ message(STATUS "Source package name: ${CPACK_SOURCE_PACKAGE_FILE_NAME}") # Specify which files not to include into the source package generated by make package_source set(CPACK_SOURCE_IGNORE_FILES ${CPACK_SOURCE_IGNORE_FILES} # first take the default parameters - "/Doc/UserManual/" + "/Doc/FFCatalog/" + "/Doc/PhysicsManual/" "/dev-tools/edit-scripts/" "/dev-tools/packaging/" "/dev-tools/tmp-examples/" @@ -71,7 +72,6 @@ set(CPACK_SOURCE_IGNORE_FILES "\\\\.obj" "CMakeLists.txt.user" "/bin/release.sh.in" # user will not need it - "/cmake/modules/UseLATEX.cmake" # user will not need it "/dev-tools/git-utils/cl_lines_of_code.py" "/dev-tools/git-utils/qqq.png" # remove this line when unneeded ".pro$" diff --git a/cmake/bornagain/modules/BornAgainConfiguration.cmake b/cmake/bornagain/modules/BornAgainConfiguration.cmake index f219f16cd63b37d7d7d6ce151489a3e4eb6cc08d..7423b73057415f530a4f053c9d6ae358737caa48 100644 --- a/cmake/bornagain/modules/BornAgainConfiguration.cmake +++ b/cmake/bornagain/modules/BornAgainConfiguration.cmake @@ -107,9 +107,7 @@ message(STATUS "Destination directories: # configure files # ----------------------------------------------------------------------------- -if(NOT BORNAGAIN_BUILDBOT_SERVER) configure_file(${TEMPLATE_DIR}/CTestCustom.cmake.in ${CMAKE_BINARY_DIR}/CTestCustom.cmake) -endif() if (WIN32) # Necessary to provide correct slashes in BABuild.h diff --git a/cmake/generic/modules/UseLATEX.cmake b/cmake/generic/modules/UseLATEX.cmake deleted file mode 100644 index 8905a8b5c2935fddbe8f92f42dee9b2696d87ba0..0000000000000000000000000000000000000000 --- a/cmake/generic/modules/UseLATEX.cmake +++ /dev/null @@ -1,1393 +0,0 @@ -# File: UseLATEX.cmake -# CMAKE commands to actually use the LaTeX compiler -# Version: 1.10.5 -# Author: Kenneth Moreland <kmorel@sandia.gov> -# -# Copyright 2004 Sandia Corporation. -# Under the terms of Contract DE-AC04-94AL85000, there is a non-exclusive -# license for use of this work by or on behalf of the -# U.S. Government. Redistribution and use in source and binary forms, with -# or without modification, are permitted provided that this Notice and any -# statement of authorship are reproduced on all copies. -# -# The following function is defined: -# -# ADD_LATEX_DOCUMENT(<tex_file> -# [BIBFILES <bib_files>] -# [INPUTS <input_tex_files>] -# [IMAGE_DIRS] <image_directories> -# [IMAGES] <image_files> -# [CONFIGURE] <tex_files> -# [DEPENDS] <tex_files> -# [MULTIBIB_NEWCITES] <suffix_list> -# [USE_INDEX] [USE_GLOSSARY] [USE_NOMENCL] -# [DEFAULT_PDF] [DEFAULT_SAFEPDF] [DEFAULT_PS] [NO_DEFAULT] -# [MANGLE_TARGET_NAMES]) -# Adds targets that compile <tex_file>. The latex output is placed -# in LATEX_OUTPUT_PATH or CMAKE_CURRENT_BINARY_DIR if the former is -# not set. The latex program is picky about where files are located, -# so all input files are copied from the source directory to the -# output directory. This includes the target tex file, any tex file -# listed with the INPUTS option, the bibliography files listed with -# the BIBFILES option, and any .cls, .bst, and .clo files found in -# the current source directory. Images found in the IMAGE_DIRS -# directories or listed by IMAGES are also copied to the output -# directory and coverted to an appropriate format if necessary. Any -# tex files also listed with the CONFIGURE option are also processed -# with the CMake CONFIGURE_FILE command (with the @ONLY flag). Any -# file listed in CONFIGURE but not the target tex file or listed with -# INPUTS has no effect. DEPENDS can be used to specify generated files -# that are needed to compile the latex target. -# -# The following targets are made: -# dvi: Makes <name>.dvi -# pdf: Makes <name>.pdf using pdflatex. -# safepdf: Makes <name>.pdf using ps2pdf. If using the default -# program arguments, this will ensure all fonts are -# embedded and no lossy compression has been performed -# on images. -# ps: Makes <name>.ps -# html: Makes <name>.html -# auxclean: Deletes <name>.aux and other auxiliary files. -# This is sometimes necessary if a LaTeX error occurs -# and writes a bad aux file. Unlike the regular clean -# target, it does not delete other input files, such as -# converted images, to save time on the rebuild. -# -# The dvi target is added to the ALL. That is, it will be the target -# built by default. If the DEFAULT_PDF argument is given, then the -# pdf target will be the default instead of dvi. Likewise, -# DEFAULT_SAFEPDF sets the default target to safepdf. If NO_DEFAULT -# is specified, then no target will be added to ALL, which is -# convenient when including LaTeX documentation with something else. -# -# If the argument MANGLE_TARGET_NAMES is given, then each of the -# target names above will be mangled with the <tex_file> name. This -# is to make the targets unique if ADD_LATEX_DOCUMENT is called for -# multiple documents. If the argument USE_INDEX is given, then -# commands to build an index are made. If the argument USE_GLOSSARY -# is given, then commands to build a glossary are made. If the -# argument MULTIBIB_NEWCITES is given, then additional bibtex calls -# are added to the build to support the extra auxiliary files created -# with the \newcite command in the multibib package. -# -# History: -# -# 1.10.5 Fix for Window's convert check (thanks to Martin Baute). -# -# 1.10.4 Copy font files to binary directory for packages that come with -# their own fonts. -# -# 1.10.3 Check for Windows version of convert being used instead of -# ImageMagick's version (thanks to Martin Baute). -# -# 1.10.2 Use htlatex as a fallback when latex2html is not available (thanks -# to Tomasz Grzegurzko). -# -# 1.10.1 Make convert program mandatory only if actually used (thanks to -# Julien Schueller). -# -# 1.10.0 Added NO_DEFAULT and DEFAULT_PS options. -# Fixed issue with cleaning files for LaTeX documents originating in -# a subdirectory. -# -# 1.9.6 Fixed problem with LATEX_SMALL_IMAGES. -# Strengthened check to make sure the output directory does not contain -# the source files. -# -# 1.9.5 Add support for image types not directly supported by either latex -# or pdflatex. (Thanks to Jorge Gerardo Pena Pastor for SVG support.) -# -# 1.9.4 Fix issues with filenames containing multiple periods. -# -# 1.9.3 Hide some variables that are now cached but should not show up in -# the ccmake list of variables. -# -# 1.9.2 Changed MACRO declarations to FUNCTION declarations. The better -# FUNCTION scoping will hopefully avoid some common but subtle bugs. -# This implicitly increases the minimum CMake version to 4.6 (although -# I honestly only test it with the latest 4.8 version). -# -# Since we are updating the minimum CMake version, I'm going to start -# using the builtin LIST commands that are now available. -# -# Favor using pdftops from the Poppler package to convert from pdf to -# eps. It does a much better job than ImageMagick or ghostscript. -# -# 1.9.1 Fixed typo that caused the LATEX_SMALL_IMAGES option to fail to -# activate. -# -# 1.9.0 Add support for the multibib package (thanks to Antonio LaTorre). -# -# 1.8.2 Fix corner case when an argument name was also a variable containing -# the text of an argument. In this case, the CMake IF was matching -# the argument text with the contents of the variable with the same -# argument name. -# -# 1.8.1 Fix problem where ps2pdf was not getting the appropriate arguments. -# -# 1.8.0 Add support for synctex. -# -# 1.7.7 Support calling xindy when making glossaries. -# -# Improved make clean support. -# -# 1.7.6 Add support for the nomencl package (thanks to Myles English). -# -# 1.7.5 Fix issue with bibfiles being copied two different ways, which causes -# Problems with dependencies (thanks to Edwin van Leeuwen). -# -# 1.7.4 Added the DEFAULT_SAFEPDF option (thanks to Raymond Wan). -# -# Added warnings when image directories are not found (and were -# probably not given relative to the source directory). -# -# 1.7.3 Fix some issues with interactions between makeglossaries and bibtex -# (thanks to Mark de Wever). -# -# 1.7.2 Use ps2pdf to convert eps to pdf to get around the problem with -# ImageMagick dropping the bounding box (thanks to Lukasz Lis). -# -# 1.7.1 Fixed some dependency issues. -# -# 1.7.0 Added DEPENDS options (thanks to Theodore Papadopoulo). -# -# 1.6.1 Ported the makeglossaries command to CMake and embedded the port -# into UseLATEX.cmake. -# -# 1.6.0 Allow the use of the makeglossaries command. Thanks to Oystein -# S. Haaland for the patch. -# -# 1.5.0 Allow any type of file in the INPUTS lists, not just tex file -# (suggested by Eric Noulard). As a consequence, the ability to -# specify tex files without the .tex extension is removed. The removed -# function is of dubious value anyway. -# -# When copying input files, skip over any file that exists in the -# binary directory but does not exist in the source directory with the -# assumption that these files were added by some other mechanism. I -# find this useful when creating large documents with multiple -# chapters that I want to build separately (for speed) as I work on -# them. I use the same boilerplate as the starting point for all -# and just copy it with different configurations. This was what the -# separate ADD_LATEX_DOCUMENT method was supposed to originally be for. -# Since its external use is pretty much deprecated, I removed that -# documentation. -# -# 1.4.1 Copy .sty files along with the other class and package files. -# -# 1.4.0 Added a MANGLE_TARGET_NAMES option that will mangle the target names. -# -# Fixed problem with copying bib files that became apparent with -# CMake 2.4. -# -# 1.3.0 Added a LATEX_OUTPUT_PATH variable that allows you or the user to -# specify where the built latex documents to go. This is especially -# handy if you want to do in-source builds. -# -# Removed the ADD_LATEX_IMAGES macro and absorbed the functionality -# into ADD_LATEX_DOCUMENT. The old interface was always kind of -# clunky anyway since you had to specify the image directory in both -# places. It also made supporting LATEX_OUTPUT_PATH problematic. -# -# Added support for jpeg files. -# -# 1.2.0 Changed the configuration options yet again. Removed the NO_CONFIGURE -# Replaced it with a CONFIGURE option that lists input files for which -# configure should be run. -# -# The pdf target no longer depends on the dvi target. This allows you -# to build latex documents that require pdflatex. Also added an option -# to make the pdf target the default one. -# -# 1.1.1 Added the NO_CONFIGURE option. The @ character can be used when -# specifying table column separators. If two or more are used, then -# will incorrectly substitute them. -# -# 1.1.0 Added ability include multiple bib files. Added ability to do copy -# sub-tex files for multipart tex files. -# -# 1.0.0 If both ps and pdf type images exist, just copy the one that -# matches the current render mode. Replaced a bunch of STRING -# commands with GET_FILENAME_COMPONENT commands that were made to do -# the desired function. -# -# 0.4.0 First version posted to CMake Wiki. -# - -############################################################################# -# Find the location of myself while originally executing. If you do this -# inside of a macro, it will recode where the macro was invoked. -############################################################################# -SET(LATEX_USE_LATEX_LOCATION ${CMAKE_CURRENT_LIST_FILE} - CACHE INTERNAL "Location of UseLATEX.cmake file." FORCE - ) - -############################################################################# -# Generic helper functions -############################################################################# - -FUNCTION(LATEX_LIST_CONTAINS var value) - SET(input_list ${ARGN}) - LIST(FIND input_list "${value}" index) - IF (index GREATER -1) - SET(${var} TRUE PARENT_SCOPE) - ELSE (index GREATER -1) - SET(${var} PARENT_SCOPE) - ENDIF (index GREATER -1) -ENDFUNCTION(LATEX_LIST_CONTAINS) - -# Parse function arguments. Variables containing the results are placed -# in the global scope for historical reasons. -FUNCTION(LATEX_PARSE_ARGUMENTS prefix arg_names option_names) - SET(DEFAULT_ARGS) - FOREACH(arg_name ${arg_names}) - SET(${prefix}_${arg_name} CACHE INTERNAL "${prefix} argument" FORCE) - ENDFOREACH(arg_name) - FOREACH(option ${option_names}) - SET(${prefix}_${option} CACHE INTERNAL "${prefix} option" FORCE) - ENDFOREACH(option) - - SET(current_arg_name DEFAULT_ARGS) - SET(current_arg_list) - FOREACH(arg ${ARGN}) - LATEX_LIST_CONTAINS(is_arg_name ${arg} ${arg_names}) - LATEX_LIST_CONTAINS(is_option ${arg} ${option_names}) - IF (is_arg_name) - SET(${prefix}_${current_arg_name} ${current_arg_list} - CACHE INTERNAL "${prefix} argument" FORCE) - SET(current_arg_name ${arg}) - SET(current_arg_list) - ELSEIF (is_option) - SET(${prefix}_${arg} TRUE CACHE INTERNAL "${prefix} option" FORCE) - ELSE (is_arg_name) - SET(current_arg_list ${current_arg_list} ${arg}) - ENDIF (is_arg_name) - ENDFOREACH(arg) - SET(${prefix}_${current_arg_name} ${current_arg_list} - CACHE INTERNAL "${prefix} argument" FORCE) -ENDFUNCTION(LATEX_PARSE_ARGUMENTS) - -# Match the contents of a file to a regular expression. -FUNCTION(LATEX_FILE_MATCH variable filename regexp default) - # The FILE STRINGS command would be a bit better, but I'm not totally sure - # the match will always be to a whole line, and I don't want to break things. - FILE(READ ${filename} file_contents) - STRING(REGEX MATCHALL "${regexp}" - match_result ${file_contents} - ) - IF (match_result) - SET(${variable} "${match_result}" PARENT_SCOPE) - ELSE (match_result) - SET(${variable} "${default}" PARENT_SCOPE) - ENDIF (match_result) -ENDFUNCTION(LATEX_FILE_MATCH) - -# A version of GET_FILENAME_COMPONENT that treats extensions after the last -# period rather than the first. To the best of my knowledge, all filenames -# typically used by LaTeX, including image files, have small extensions -# after the last dot. -FUNCTION(LATEX_GET_FILENAME_COMPONENT varname filename type) - SET(result) - IF ("${type}" STREQUAL "NAME_WE") - GET_FILENAME_COMPONENT(name ${filename} NAME) - STRING(REGEX REPLACE "\\.[^.]*\$" "" result "${name}") - ELSEIF ("${type}" STREQUAL "EXT") - GET_FILENAME_COMPONENT(name ${filename} NAME) - STRING(REGEX MATCH "\\.[^.]*\$" result "${name}") - ELSE ("${type}" STREQUAL "NAME_WE") - GET_FILENAME_COMPONENT(result ${filename} ${type}) - ENDIF ("${type}" STREQUAL "NAME_WE") - SET(${varname} "${result}" PARENT_SCOPE) -ENDFUNCTION(LATEX_GET_FILENAME_COMPONENT) - -############################################################################# -# Functions that perform processing during a LaTeX build. -############################################################################# -FUNCTION(LATEX_MAKEGLOSSARIES) - # This is really a bare bones port of the makeglossaries perl script into - # CMake scripting. - MESSAGE("**************************** In makeglossaries") - IF (NOT LATEX_TARGET) - MESSAGE(SEND_ERROR "Need to define LATEX_TARGET") - ENDIF (NOT LATEX_TARGET) - - SET(aux_file ${LATEX_TARGET}.aux) - - IF (NOT EXISTS ${aux_file}) - MESSAGE(SEND_ERROR "${aux_file} does not exist. Run latex on your target file.") - ENDIF (NOT EXISTS ${aux_file}) - - LATEX_FILE_MATCH(newglossary_lines ${aux_file} - "@newglossary[ \t]*{([^}]*)}{([^}]*)}{([^}]*)}{([^}]*)}" - "@newglossary{main}{glg}{gls}{glo}" - ) - - LATEX_FILE_MATCH(istfile_line ${aux_file} - "@istfilename[ \t]*{([^}]*)}" - "@istfilename{${LATEX_TARGET}.ist}" - ) - STRING(REGEX REPLACE "@istfilename[ \t]*{([^}]*)}" "\\1" - istfile ${istfile_line} - ) - - STRING(REGEX MATCH ".*\\.xdy" use_xindy "${istfile}") - IF (use_xindy) - MESSAGE("*************** Using xindy") - IF (NOT XINDY_COMPILER) - MESSAGE(SEND_ERROR "Need to define XINDY_COMPILER") - ENDIF (NOT XINDY_COMPILER) - ELSE (use_xindy) - MESSAGE("*************** Using makeindex") - IF (NOT MAKEINDEX_COMPILER) - MESSAGE(SEND_ERROR "Need to define MAKEINDEX_COMPILER") - ENDIF (NOT MAKEINDEX_COMPILER) - ENDIF (use_xindy) - - FOREACH(newglossary ${newglossary_lines}) - STRING(REGEX REPLACE - "@newglossary[ \t]*{([^}]*)}{([^}]*)}{([^}]*)}{([^}]*)}" - "\\1" glossary_name ${newglossary} - ) - STRING(REGEX REPLACE - "@newglossary[ \t]*{([^}]*)}{([^}]*)}{([^}]*)}{([^}]*)}" - "${LATEX_TARGET}.\\2" glossary_log ${newglossary} - ) - STRING(REGEX REPLACE - "@newglossary[ \t]*{([^}]*)}{([^}]*)}{([^}]*)}{([^}]*)}" - "${LATEX_TARGET}.\\3" glossary_out ${newglossary} - ) - STRING(REGEX REPLACE - "@newglossary[ \t]*{([^}]*)}{([^}]*)}{([^}]*)}{([^}]*)}" - "${LATEX_TARGET}.\\4" glossary_in ${newglossary} - ) - - IF (use_xindy) - LATEX_FILE_MATCH(xdylanguage_line ${aux_file} - "@xdylanguage[ \t]*{${glossary_name}}{([^}]*)}" - "@xdylanguage{${glossary_name}}{english}" - ) - STRING(REGEX REPLACE - "@xdylanguage[ \t]*{${glossary_name}}{([^}]*)}" - "\\1" - language - ${xdylanguage_line} - ) - # What crazy person makes a LaTeX index generater that uses different - # identifiers for language than babel (or at least does not support - # the old ones)? - IF (${language} STREQUAL "frenchb") - SET(language "french") - ELSEIF (${language} MATCHES "^n?germanb?$") - SET(language "german") - ELSEIF (${language} STREQUAL "magyar") - SET(language "hungarian") - ELSEIF (${language} STREQUAL "lsorbian") - SET(language "lower-sorbian") - ELSEIF (${language} STREQUAL "norsk") - SET(language "norwegian") - ELSEIF (${language} STREQUAL "portuges") - SET(language "portuguese") - ELSEIF (${language} STREQUAL "russianb") - SET(language "russian") - ELSEIF (${language} STREQUAL "slovene") - SET(language "slovenian") - ELSEIF (${language} STREQUAL "ukraineb") - SET(language "ukrainian") - ELSEIF (${language} STREQUAL "usorbian") - SET(language "upper-sorbian") - ENDIF (${language} STREQUAL "frenchb") - IF (language) - SET(language_flags "-L ${language}") - ELSE (language) - SET(language_flags "") - ENDIF (language) - - LATEX_FILE_MATCH(codepage_line ${aux_file} - "@gls@codepage[ \t]*{${glossary_name}}{([^}]*)}" - "@gls@codepage{${glossary_name}}{utf}" - ) - STRING(REGEX REPLACE - "@gls@codepage[ \t]*{${glossary_name}}{([^}]*)}" - "\\1" - codepage - ${codepage_line} - ) - IF (codepage) - SET(codepage_flags "-C ${codepage}") - ELSE (codepage) - # Ideally, we would check that the language is compatible with the - # default codepage, but I'm hoping that distributions will be smart - # enough to specify their own codepage. I know, it's asking a lot. - SET(codepage_flags "") - ENDIF (codepage) - - MESSAGE("${XINDY_COMPILER} ${MAKEGLOSSARIES_COMPILER_FLAGS} ${language_flags} ${codepage_flags} -I xindy -M ${glossary_name} -t ${glossary_log} -o ${glossary_out} ${glossary_in}" - ) - EXEC_PROGRAM(${XINDY_COMPILER} - ARGS ${MAKEGLOSSARIES_COMPILER_FLAGS} - ${language_flags} - ${codepage_flags} - -I xindy - -M ${glossary_name} - -t ${glossary_log} - -o ${glossary_out} - ${glossary_in} - OUTPUT_VARIABLE xindy_output - ) - MESSAGE("${xindy_output}") - - # So, it is possible (perhaps common?) for aux files to specify a - # language and codepage that are incompatible with each other. Check - # for that condition, and if it happens run again with the default - # codepage. - IF ("${xindy_output}" MATCHES "^Cannot locate xindy module for language (.+) in codepage (.+)\\.$") - MESSAGE("*************** Retrying xindy with default codepage.") - EXEC_PROGRAM(${XINDY_COMPILER} - ARGS ${MAKEGLOSSARIES_COMPILER_FLAGS} - ${language_flags} - -I xindy - -M ${glossary_name} - -t ${glossary_log} - -o ${glossary_out} - ${glossary_in} - ) - ENDIF ("${xindy_output}" MATCHES "^Cannot locate xindy module for language (.+) in codepage (.+)\\.$") - - ELSE (use_xindy) - MESSAGE("${MAKEINDEX_COMPILER} ${MAKEGLOSSARIES_COMPILER_FLAGS} -s ${istfile} -t ${glossary_log} -o ${glossary_out} ${glossary_in}") - EXEC_PROGRAM(${MAKEINDEX_COMPILER} ARGS ${MAKEGLOSSARIES_COMPILER_FLAGS} - -s ${istfile} -t ${glossary_log} -o ${glossary_out} ${glossary_in} - ) - ENDIF (use_xindy) - - ENDFOREACH(newglossary) -ENDFUNCTION(LATEX_MAKEGLOSSARIES) - -FUNCTION(LATEX_MAKENOMENCLATURE) - MESSAGE("**************************** In makenomenclature") - IF (NOT LATEX_TARGET) - MESSAGE(SEND_ERROR "Need to define LATEX_TARGET") - ENDIF (NOT LATEX_TARGET) - - IF (NOT MAKEINDEX_COMPILER) - MESSAGE(SEND_ERROR "Need to define MAKEINDEX_COMPILER") - ENDIF (NOT MAKEINDEX_COMPILER) - - SET(nomencl_out ${LATEX_TARGET}.nls) - SET(nomencl_in ${LATEX_TARGET}.nlo) - - EXEC_PROGRAM(${MAKEINDEX_COMPILER} ARGS ${MAKENOMENCLATURE_COMPILER_FLAGS} - ${nomencl_in} -s "nomencl.ist" -o ${nomencl_out} - ) -ENDFUNCTION(LATEX_MAKENOMENCLATURE) - -FUNCTION(LATEX_CORRECT_SYNCTEX) - MESSAGE("**************************** In correct SyncTeX") - IF (NOT LATEX_TARGET) - MESSAGE(SEND_ERROR "Need to define LATEX_TARGET") - ENDIF (NOT LATEX_TARGET) - - IF (NOT GZIP) - MESSAGE(SEND_ERROR "Need to define GZIP") - ENDIF (NOT GZIP) - - IF (NOT LATEX_SOURCE_DIRECTORY) - MESSAGE(SEND_ERROR "Need to define LATEX_SOURCE_DIRECTORY") - ENDIF (NOT LATEX_SOURCE_DIRECTORY) - - IF (NOT LATEX_BINARY_DIRECTORY) - MESSAGE(SEND_ERROR "Need to define LATEX_BINARY_DIRECTORY") - ENDIF (NOT LATEX_BINARY_DIRECTORY) - - SET(synctex_file ${LATEX_BINARY_DIRECTORY}/${LATEX_TARGET}.synctex) - SET(synctex_file_gz ${synctex_file}.gz) - - IF (EXISTS ${synctex_file_gz}) - - MESSAGE("Making backup of synctex file.") - CONFIGURE_FILE(${synctex_file_gz} ${synctex_file}.bak.gz COPYONLY) - - MESSAGE("Uncompressing synctex file.") - EXEC_PROGRAM(${GZIP} - ARGS --decompress ${synctex_file_gz} - ) - - MESSAGE("Reading synctex file.") - FILE(READ ${synctex_file} synctex_data) - - MESSAGE("Replacing relative with absolute paths.") - STRING(REGEX REPLACE - "(Input:[0-9]+:)([^/\n][^\n]*)" - "\\1${LATEX_SOURCE_DIRECTORY}/\\2" - synctex_data - "${synctex_data}" - ) - - MESSAGE("Writing synctex file.") - FILE(WRITE ${synctex_file} "${synctex_data}") - - MESSAGE("Compressing synctex file.") - EXEC_PROGRAM(${GZIP} - ARGS ${synctex_file} - ) - - ELSE (EXISTS ${synctex_file_gz}) - - MESSAGE(SEND_ERROR "File ${synctex_file_gz} not found. Perhaps synctex is not supported by your LaTeX compiler.") - - ENDIF (EXISTS ${synctex_file_gz}) - -ENDFUNCTION(LATEX_CORRECT_SYNCTEX) - -############################################################################# -# Helper functions for establishing LaTeX build. -############################################################################# - -FUNCTION(LATEX_NEEDIT VAR NAME) - IF (NOT ${VAR}) - MESSAGE(SEND_ERROR "I need the ${NAME} command.") - ENDIF(NOT ${VAR}) -ENDFUNCTION(LATEX_NEEDIT) - -FUNCTION(LATEX_WANTIT VAR NAME) - IF (NOT ${VAR}) - MESSAGE(STATUS "I could not find the ${NAME} command.") - ENDIF(NOT ${VAR}) -ENDFUNCTION(LATEX_WANTIT) - -FUNCTION(LATEX_SETUP_VARIABLES) - SET(LATEX_OUTPUT_PATH "${LATEX_OUTPUT_PATH}" - CACHE PATH "If non empty, specifies the location to place LaTeX output." - ) - - FIND_PACKAGE(LATEX) - - FIND_PROGRAM(XINDY_COMPILER - NAME xindy - PATHS ${MIKTEX_BINARY_PATH} /usr/bin - ) - - FIND_PACKAGE(UnixCommands) - - FIND_PROGRAM(PDFTOPS_CONVERTER - NAMES pdftops - DOC "The pdf to ps converter program from the Poppler package." - ) - - MARK_AS_ADVANCED(CLEAR - LATEX_COMPILER - PDFLATEX_COMPILER - BIBTEX_COMPILER - MAKEINDEX_COMPILER - XINDY_COMPILER - DVIPS_CONVERTER - PS2PDF_CONVERTER - PDFTOPS_CONVERTER - LATEX2HTML_CONVERTER - ) - - LATEX_NEEDIT(LATEX_COMPILER latex) - LATEX_WANTIT(PDFLATEX_COMPILER pdflatex) - LATEX_NEEDIT(BIBTEX_COMPILER bibtex) - LATEX_NEEDIT(MAKEINDEX_COMPILER makeindex) - LATEX_WANTIT(DVIPS_CONVERTER dvips) - LATEX_WANTIT(PS2PDF_CONVERTER ps2pdf) - LATEX_WANTIT(PDFTOPS_CONVERTER pdftops) - # MiKTeX calls latex2html htlatex - IF (NOT ${LATEX2HTML_CONVERTER}) - FIND_PROGRAM(HTLATEX_CONVERTER - NAMES htlatex - PATHS ${MIKTEX_BINARY_PATH} - /usr/bin - ) - IF (HTLATEX_CONVERTER) - SET(USING_HTLATEX TRUE CACHE INTERNAL "True when using MiKTeX htlatex instead of latex2html" FORCE) - SET(LATEX2HTML_CONVERTER ${HTLATEX_CONVERTER} - CACHE FILEPATH "htlatex taking the place of latex2html" FORCE) - ELSE (HTLATEX_CONVERTER) - SET(USING_HTLATEX FALSE CACHE INTERNAL "True when using MiKTeX htlatex instead of latex2html" FORCE) - ENDIF (HTLATEX_CONVERTER) - ENDIF (NOT ${LATEX2HTML_CONVERTER}) - LATEX_WANTIT(LATEX2HTML_CONVERTER latex2html) - - SET(LATEX_COMPILER_FLAGS "-interaction=nonstopmode" - CACHE STRING "Flags passed to latex.") - SET(PDFLATEX_COMPILER_FLAGS ${LATEX_COMPILER_FLAGS} - CACHE STRING "Flags passed to pdflatex.") - SET(LATEX_SYNCTEX_FLAGS "-synctex=1" - CACHE STRING "latex/pdflatex flags used to create synctex file.") - SET(BIBTEX_COMPILER_FLAGS "" - CACHE STRING "Flags passed to bibtex.") - SET(MAKEINDEX_COMPILER_FLAGS "" - CACHE STRING "Flags passed to makeindex.") - SET(MAKEGLOSSARIES_COMPILER_FLAGS "" - CACHE STRING "Flags passed to makeglossaries.") - SET(MAKENOMENCLATURE_COMPILER_FLAGS "" - CACHE STRING "Flags passed to makenomenclature.") - SET(DVIPS_CONVERTER_FLAGS "-Ppdf -G0 -t letter" - CACHE STRING "Flags passed to dvips.") - SET(PS2PDF_CONVERTER_FLAGS "-dMaxSubsetPct=100 -dCompatibilityLevel=1.3 -dSubsetFonts=true -dEmbedAllFonts=true -dAutoFilterColorImages=false -dAutoFilterGrayImages=false -dColorImageFilter=/FlateEncode -dGrayImageFilter=/FlateEncode -dMonoImageFilter=/FlateEncode" - CACHE STRING "Flags passed to ps2pdf.") - SET(PDFTOPS_CONVERTER_FLAGS -r 600 - CACHE STRING "Flags passed to pdftops.") - SET(LATEX2HTML_CONVERTER_FLAGS "" - CACHE STRING "Flags passed to latex2html.") - MARK_AS_ADVANCED( - LATEX_COMPILER_FLAGS - PDFLATEX_COMPILER_FLAGS - LATEX_SYNCTEX_FLAGS - BIBTEX_COMPILER_FLAGS - MAKEINDEX_COMPILER_FLAGS - MAKEGLOSSARIES_COMPILER_FLAGS - MAKENOMENCLATURE_COMPILER_FLAGS - DVIPS_CONVERTER_FLAGS - PS2PDF_CONVERTER_FLAGS - PDFTOPS_CONVERTER_FLAGS - LATEX2HTML_CONVERTER_FLAGS - ) - SEPARATE_ARGUMENTS(LATEX_COMPILER_FLAGS) - SEPARATE_ARGUMENTS(PDFLATEX_COMPILER_FLAGS) - SEPARATE_ARGUMENTS(LATEX_SYNCTEX_FLAGS) - SEPARATE_ARGUMENTS(BIBTEX_COMPILER_FLAGS) - SEPARATE_ARGUMENTS(MAKEINDEX_COMPILER_FLAGS) - SEPARATE_ARGUMENTS(MAKEGLOSSARIES_COMPILER_FLAGS) - SEPARATE_ARGUMENTS(MAKENOMENCLATURE_COMPILER_FLAGS) - SEPARATE_ARGUMENTS(DVIPS_CONVERTER_FLAGS) - SEPARATE_ARGUMENTS(PS2PDF_CONVERTER_FLAGS) - SEPARATE_ARGUMENTS(PDFTOPS_CONVERTER_FLAGS) - SEPARATE_ARGUMENTS(LATEX2HTML_CONVERTER_FLAGS) - - FIND_PROGRAM(IMAGEMAGICK_CONVERT convert - DOC "The convert program that comes with ImageMagick (available at http://www.imagemagick.org)." - ) - - OPTION(LATEX_USE_SYNCTEX - "If on, have LaTeX generate a synctex file, which WYSIWYG editors can use to correlate output files like dvi and pdf with the lines of LaTeX source that generates them. In addition to adding the LATEX_SYNCTEX_FLAGS to the command line, this option also adds build commands that \"corrects\" the resulting synctex file to point to the original LaTeX files rather than those generated by UseLATEX.cmake." - OFF - ) - - OPTION(LATEX_SMALL_IMAGES - "If on, the raster images will be converted to 1/6 the original size. This is because papers usually require 600 dpi images whereas most monitors only require at most 96 dpi. Thus, smaller images make smaller files for web distributation and can make it faster to read dvi files." - OFF) - IF (LATEX_SMALL_IMAGES) - SET(LATEX_RASTER_SCALE 16 PARENT_SCOPE) - SET(LATEX_OPPOSITE_RASTER_SCALE 100 PARENT_SCOPE) - ELSE (LATEX_SMALL_IMAGES) - SET(LATEX_RASTER_SCALE 100 PARENT_SCOPE) - SET(LATEX_OPPOSITE_RASTER_SCALE 16 PARENT_SCOPE) - ENDIF (LATEX_SMALL_IMAGES) - - # Just holds extensions for known image types. They should all be lower case. - # For historical reasons, these are all declared in the global scope. - SET(LATEX_DVI_VECTOR_IMAGE_EXTENSIONS .eps CACHE INTERNAL "") - SET(LATEX_DVI_RASTER_IMAGE_EXTENSIONS CACHE INTERNAL "") - SET(LATEX_DVI_IMAGE_EXTENSIONS - ${LATEX_DVI_VECTOR_IMAGE_EXTENSIONS} - ${LATEX_DVI_RASTER_IMAGE_EXTENSIONS} - CACHE INTERNAL "" - ) - - SET(LATEX_PDF_VECTOR_IMAGE_EXTENSIONS .pdf CACHE INTERNAL "") - SET(LATEX_PDF_RASTER_IMAGE_EXTENSIONS .png .jpeg .jpg CACHE INTERNAL "") - SET(LATEX_PDF_IMAGE_EXTENSIONS - ${LATEX_PDF_VECTOR_IMAGE_EXTENSIONS} - ${LATEX_PDF_RASTER_IMAGE_EXTENSIONS} - CACHE INTERNAL "" - ) - - SET(LATEX_OTHER_VECTOR_IMAGE_EXTENSIONS .svg CACHE INTERNAL "") - SET(LATEX_OTHER_RASTER_IMAGE_EXTENSIONS .tif .tiff .gif CACHE INTERNAL "") - SET(LATEX_OTHER_IMAGE_EXTENSIONS - ${LATEX_OTHER_VECTOR_IMAGE_EXTENSIONS} - ${LATEX_OTHER_RASTER_IMAGE_EXTENSIONS} - CACHE INTERNAL "" - ) - - SET(LATEX_VECTOR_IMAGE_EXTENSIONS - ${LATEX_DVI_VECTOR_IMAGE_EXTENSIONS} - ${LATEX_PDF_VECTOR_IMAGE_EXTENSIONS} - ${LATEX_OTHER_VECTOR_IMAGE_EXTENSIONS} - CACHE INTERNAL "" - ) - SET(LATEX_RASTER_IMAGE_EXTENSIONS - ${LATEX_DVI_RASTER_IMAGE_EXTENSIONS} - ${LATEX_PDF_RASTER_IMAGE_EXTENSIONS} - ${LATEX_OTHER_RASTER_IMAGE_EXTENSIONS} - CACHE INTERNAL "" - ) - SET(LATEX_IMAGE_EXTENSIONS - ${LATEX_DVI_IMAGE_EXTENSIONS} - ${LATEX_PDF_IMAGE_EXTENSIONS} - ${LATEX_OTHER_IMAGE_EXTENSIONS} - CACHE INTERNAL "" - ) -ENDFUNCTION(LATEX_SETUP_VARIABLES) - -FUNCTION(LATEX_GET_OUTPUT_PATH var) - SET(latex_output_path) - IF (LATEX_OUTPUT_PATH) - GET_FILENAME_COMPONENT( - LATEX_OUTPUT_PATH_FULL "${LATEX_OUTPUT_PATH}" ABSOLUTE - ) - IF ("${LATEX_OUTPUT_PATH_FULL}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}") - MESSAGE(SEND_ERROR "You cannot set LATEX_OUTPUT_PATH to the same directory that contains LaTeX input files.") - ELSE ("${LATEX_OUTPUT_PATH_FULL}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}") - SET(latex_output_path "${LATEX_OUTPUT_PATH_FULL}") - ENDIF ("${LATEX_OUTPUT_PATH_FULL}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}") - ELSE (LATEX_OUTPUT_PATH) - IF ("${CMAKE_CURRENT_BINARY_DIR}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}") - MESSAGE(SEND_ERROR "LaTeX files must be built out of source or you must set LATEX_OUTPUT_PATH.") - ELSE ("${CMAKE_CURRENT_BINARY_DIR}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}") - SET(latex_output_path "${CMAKE_CURRENT_BINARY_DIR}") - ENDIF ("${CMAKE_CURRENT_BINARY_DIR}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}") - ENDIF (LATEX_OUTPUT_PATH) - SET(${var} ${latex_output_path} PARENT_SCOPE) -ENDFUNCTION(LATEX_GET_OUTPUT_PATH) - -FUNCTION(LATEX_ADD_CONVERT_COMMAND - output_path - input_path - output_extension - input_extension - flags - ) - SET (require_imagemagick_convert TRUE) - SET (convert_flags "") - IF (${input_extension} STREQUAL ".eps" AND ${output_extension} STREQUAL ".pdf") - # ImageMagick has broken eps to pdf conversion - # use ps2pdf instead - IF (PS2PDF_CONVERTER) - SET (require_imagemagick_convert FALSE) - SET (converter ${PS2PDF_CONVERTER}) - SET (convert_flags -dEPSCrop ${PS2PDF_CONVERTER_FLAGS}) - ELSE (PS2PDF_CONVERTER) - MESSAGE(SEND_ERROR "Using postscript files with pdflatex requires ps2pdf for conversion.") - ENDIF (PS2PDF_CONVERTER) - ELSEIF (${input_extension} STREQUAL ".pdf" AND ${output_extension} STREQUAL ".eps") - # ImageMagick can also be sketchy on pdf to eps conversion. Not good with - # color spaces and tends to unnecessarily rasterize. - # use pdftops instead - IF (PDFTOPS_CONVERTER) - SET (require_imagemagick_convert FALSE) - SET(converter ${PDFTOPS_CONVERTER}) - SET(convert_flags -eps ${PDFTOPS_CONVERTER_FLAGS}) - ELSE (PDFTOPS_CONVERTER) - MESSAGE(STATUS "Consider getting pdftops from Poppler to convert PDF images to EPS images.") - SET (convert_flags ${flags}) - ENDIF (PDFTOPS_CONVERTER) - ELSE (${input_extension} STREQUAL ".eps" AND ${output_extension} STREQUAL ".pdf") - SET (convert_flags ${flags}) - ENDIF (${input_extension} STREQUAL ".eps" AND ${output_extension} STREQUAL ".pdf") - - IF (require_imagemagick_convert) - IF (IMAGEMAGICK_CONVERT) - STRING(TOLOWER ${IMAGEMAGICK_CONVERT} IMAGEMAGICK_CONVERT_LOWERCASE) - IF (${IMAGEMAGICK_CONVERT_LOWERCASE} MATCHES "system32[/\\\\]convert\\.exe") - MESSAGE(SEND_ERROR "IMAGEMAGICK_CONVERT set to Window's convert.exe for changing file systems rather than ImageMagick's convert for changing image formats. Please make sure ImageMagick is installed (available at http://www.imagemagick.org) and its convert program is used for IMAGEMAGICK_CONVERT. (It is helpful if ImageMagick's path is before the Windows system paths.)") - ELSE (${IMAGEMAGICK_CONVERT_LOWERCASE} MATCHES "system32[/\\\\]convert\\.exe") - SET (converter ${IMAGEMAGICK_CONVERT}) - ENDIF (${IMAGEMAGICK_CONVERT_LOWERCASE} MATCHES "system32[/\\\\]convert\\.exe") - ELSE (IMAGEMAGICK_CONVERT) - MESSAGE(SEND_ERROR "Could not find convert program. Please download ImageMagick from http://www.imagemagick.org and install.") - ENDIF (IMAGEMAGICK_CONVERT) - ENDIF (require_imagemagick_convert) - - ADD_CUSTOM_COMMAND(OUTPUT ${output_path} - COMMAND ${converter} - ARGS ${convert_flags} ${input_path} ${output_path} - DEPENDS ${input_path} - ) -ENDFUNCTION(LATEX_ADD_CONVERT_COMMAND) - -# Makes custom commands to convert a file to a particular type. -FUNCTION(LATEX_CONVERT_IMAGE - output_files_var - input_file - output_extension - convert_flags - output_extensions - other_files - ) - SET(output_file_list) - SET(input_dir ${CMAKE_CURRENT_SOURCE_DIR}) - LATEX_GET_OUTPUT_PATH(output_dir) - - LATEX_GET_FILENAME_COMPONENT(extension "${input_file}" EXT) - - # Check input filename for potential problems with LaTeX. - LATEX_GET_FILENAME_COMPONENT(name "${input_file}" NAME_WE) - IF (name MATCHES ".*\\..*") - STRING(REPLACE "." "-" suggested_name "${name}") - SET(suggested_name "${suggested_name}${extension}") - MESSAGE(WARNING "Some LaTeX distributions have problems with image file names with multiple extensions. Consider changing ${name}${extension} to something like ${suggested_name}.") - ENDIF (name MATCHES ".*\\..*") - - STRING(REGEX REPLACE "\\.[^.]*\$" ${output_extension} output_file - "${input_file}") - - LATEX_LIST_CONTAINS(is_type ${extension} ${output_extensions}) - IF (is_type) - IF (convert_flags) - LATEX_ADD_CONVERT_COMMAND(${output_dir}/${output_file} - ${input_dir}/${input_file} ${output_extension} ${extension} - "${convert_flags}") - SET(output_file_list ${output_file_list} ${output_dir}/${output_file}) - ELSE (convert_flags) - # As a shortcut, we can just copy the file. - ADD_CUSTOM_COMMAND(OUTPUT ${output_dir}/${input_file} - COMMAND ${CMAKE_COMMAND} - ARGS -E copy ${input_dir}/${input_file} ${output_dir}/${input_file} - DEPENDS ${input_dir}/${input_file} - ) - SET(output_file_list ${output_file_list} ${output_dir}/${input_file}) - ENDIF (convert_flags) - ELSE (is_type) - SET(do_convert TRUE) - # Check to see if there is another input file of the appropriate type. - FOREACH(valid_extension ${output_extensions}) - STRING(REGEX REPLACE "\\.[^.]*\$" ${output_extension} try_file - "${input_file}") - LATEX_LIST_CONTAINS(has_native_file "${try_file}" ${other_files}) - IF (has_native_file) - SET(do_convert FALSE) - ENDIF (has_native_file) - ENDFOREACH(valid_extension) - - # If we still need to convert, do it. - IF (do_convert) - LATEX_ADD_CONVERT_COMMAND(${output_dir}/${output_file} - ${input_dir}/${input_file} ${output_extension} ${extension} - "${convert_flags}") - SET(output_file_list ${output_file_list} ${output_dir}/${output_file}) - ENDIF (do_convert) - ENDIF (is_type) - - SET(${output_files_var} ${output_file_list} PARENT_SCOPE) -ENDFUNCTION(LATEX_CONVERT_IMAGE) - -# Adds custom commands to process the given files for dvi and pdf builds. -# Adds the output files to the given variables (does not replace). -FUNCTION(LATEX_PROCESS_IMAGES dvi_outputs_var pdf_outputs_var) - LATEX_GET_OUTPUT_PATH(output_dir) - SET(dvi_outputs) - SET(pdf_outputs) - FOREACH(file ${ARGN}) - IF (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${file}") - LATEX_GET_FILENAME_COMPONENT(extension "${file}" EXT) - SET(convert_flags) - - # Check to see if we need to downsample the image. - LATEX_LIST_CONTAINS(is_raster "${extension}" - ${LATEX_RASTER_IMAGE_EXTENSIONS}) - IF (LATEX_SMALL_IMAGES) - IF (is_raster) - SET(convert_flags -resize ${LATEX_RASTER_SCALE}%) - ENDIF (is_raster) - ENDIF (LATEX_SMALL_IMAGES) - - # Make sure the output directory exists. - LATEX_GET_FILENAME_COMPONENT(path "${output_dir}/${file}" PATH) - MAKE_DIRECTORY("${path}") - - # Do conversions for dvi. - LATEX_CONVERT_IMAGE(output_files "${file}" .eps "${convert_flags}" - "${LATEX_DVI_IMAGE_EXTENSIONS}" "${ARGN}") - SET(dvi_outputs ${dvi_outputs} ${output_files}) - - # Do conversions for pdf. - IF (is_raster) - LATEX_CONVERT_IMAGE(output_files "${file}" .png "${convert_flags}" - "${LATEX_PDF_IMAGE_EXTENSIONS}" "${ARGN}") - SET(pdf_outputs ${pdf_outputs} ${output_files}) - ELSE (is_raster) - LATEX_CONVERT_IMAGE(output_files "${file}" .pdf "${convert_flags}" - "${LATEX_PDF_IMAGE_EXTENSIONS}" "${ARGN}") - SET(pdf_outputs ${pdf_outputs} ${output_files}) - ENDIF (is_raster) - ELSE (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${file}") - MESSAGE(WARNING "Could not find file ${CMAKE_CURRENT_SOURCE_DIR}/${file}. Are you sure you gave relative paths to IMAGES?") - ENDIF (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${file}") - ENDFOREACH(file) - - SET(${dvi_outputs_var} ${dvi_outputs} PARENT_SCOPE) - SET(${pdf_outputs_var} ${pdf_outputs} PARENT_SCOPE) -ENDFUNCTION(LATEX_PROCESS_IMAGES) - -FUNCTION(ADD_LATEX_IMAGES) - MESSAGE(SEND_ERROR "The ADD_LATEX_IMAGES function is deprecated. Image directories are specified with LATEX_ADD_DOCUMENT.") -ENDFUNCTION(ADD_LATEX_IMAGES) - -FUNCTION(LATEX_COPY_GLOBBED_FILES pattern dest) - FILE(GLOB file_list ${pattern}) - FOREACH(in_file ${file_list}) - LATEX_GET_FILENAME_COMPONENT(out_file ${in_file} NAME) - CONFIGURE_FILE(${in_file} ${dest}/${out_file} COPYONLY) - ENDFOREACH(in_file) -ENDFUNCTION(LATEX_COPY_GLOBBED_FILES) - -FUNCTION(LATEX_COPY_INPUT_FILE file) - LATEX_GET_OUTPUT_PATH(output_dir) - - IF (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${file}) - LATEX_GET_FILENAME_COMPONENT(path ${file} PATH) - FILE(MAKE_DIRECTORY ${output_dir}/${path}) - - LATEX_LIST_CONTAINS(use_config ${file} ${LATEX_CONFIGURE}) - IF (use_config) - CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/${file} - ${output_dir}/${file} - @ONLY - ) - ADD_CUSTOM_COMMAND(OUTPUT ${output_dir}/${file} - COMMAND ${CMAKE_COMMAND} - ARGS ${CMAKE_BINARY_DIR} - DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${file} - ) - ELSE (use_config) - ADD_CUSTOM_COMMAND(OUTPUT ${output_dir}/${file} - COMMAND ${CMAKE_COMMAND} - ARGS -E copy ${CMAKE_CURRENT_SOURCE_DIR}/${file} ${output_dir}/${file} - DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${file} - ) - ENDIF (use_config) - ELSE (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${file}) - IF (EXISTS ${output_dir}/${file}) - # Special case: output exists but input does not. Assume that it was - # created elsewhere and skip the input file copy. - ELSE (EXISTS ${output_dir}/${file}) - MESSAGE("Could not find input file ${CMAKE_CURRENT_SOURCE_DIR}/${file}") - ENDIF (EXISTS ${output_dir}/${file}) - ENDIF (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${file}) -ENDFUNCTION(LATEX_COPY_INPUT_FILE) - -############################################################################# -# Commands provided by the UseLATEX.cmake "package" -############################################################################# - -FUNCTION(LATEX_USAGE command message) - MESSAGE(SEND_ERROR - "${message}\nUsage: ${command}(<tex_file>\n [BIBFILES <bib_file> <bib_file> ...]\n [INPUTS <tex_file> <tex_file> ...]\n [IMAGE_DIRS <directory1> <directory2> ...]\n [IMAGES <image_file1> <image_file2>\n [CONFIGURE <tex_file> <tex_file> ...]\n [DEPENDS <tex_file> <tex_file> ...]\n [MULTIBIB_NEWCITES] <suffix_list>\n [USE_INDEX] [USE_GLOSSARY] [USE_NOMENCL]\n [DEFAULT_PDF] [DEFAULT_SAFEPDF] [DEFAULT_PS] [NO_DEFAULT]\n [MANGLE_TARGET_NAMES])" - ) -ENDFUNCTION(LATEX_USAGE command message) - -# Parses arguments to ADD_LATEX_DOCUMENT and ADD_LATEX_TARGETS and sets the -# variables LATEX_TARGET, LATEX_IMAGE_DIR, LATEX_BIBFILES, LATEX_DEPENDS, and -# LATEX_INPUTS. -FUNCTION(PARSE_ADD_LATEX_ARGUMENTS command) - LATEX_PARSE_ARGUMENTS( - LATEX - "BIBFILES;MULTIBIB_NEWCITES;INPUTS;IMAGE_DIRS;IMAGES;CONFIGURE;DEPENDS" - "USE_INDEX;USE_GLOSSARY;USE_GLOSSARIES;USE_NOMENCL;DEFAULT_PDF;DEFAULT_SAFEPDF;DEFAULT_PS;NO_DEFAULT;MANGLE_TARGET_NAMES" - ${ARGN} - ) - - # The first argument is the target latex file. - IF (LATEX_DEFAULT_ARGS) - LIST(GET LATEX_DEFAULT_ARGS 0 latex_main_input) - LIST(REMOVE_AT LATEX_DEFAULT_ARGS 0) - LATEX_GET_FILENAME_COMPONENT(latex_target ${latex_main_input} NAME_WE) - SET(LATEX_MAIN_INPUT ${latex_main_input} CACHE INTERNAL "" FORCE) - SET(LATEX_TARGET ${latex_target} CACHE INTERNAL "" FORCE) - ELSE (LATEX_DEFAULT_ARGS) - LATEX_USAGE(${command} "No tex file target given to ${command}.") - ENDIF (LATEX_DEFAULT_ARGS) - - IF (LATEX_DEFAULT_ARGS) - LATEX_USAGE(${command} "Invalid or depricated arguments: ${LATEX_DEFAULT_ARGS}") - ENDIF (LATEX_DEFAULT_ARGS) - - # Backward compatibility between 1.6.0 and 1.6.1. - IF (LATEX_USE_GLOSSARIES) - SET(LATEX_USE_GLOSSARY TRUE CACHE INTERNAL "" FORCE) - ENDIF (LATEX_USE_GLOSSARIES) -ENDFUNCTION(PARSE_ADD_LATEX_ARGUMENTS) - -FUNCTION(ADD_LATEX_TARGETS_INTERNAL) - IF (LATEX_USE_SYNCTEX) - SET(synctex_flags ${LATEX_SYNCTEX_FLAGS}) - ELSE (LATEX_USE_SYNCTEX) - SET(synctex_flags) - ENDIF (LATEX_USE_SYNCTEX) - - # The commands to run LaTeX. They are repeated multiple times. - SET(latex_build_command - ${LATEX_COMPILER} ${LATEX_COMPILER_FLAGS} ${synctex_flags} ${LATEX_MAIN_INPUT} - ) - SET(pdflatex_build_command - ${PDFLATEX_COMPILER} ${PDFLATEX_COMPILER_FLAGS} ${synctex_flags} ${LATEX_MAIN_INPUT} - ) - - # Set up target names. - IF (LATEX_MANGLE_TARGET_NAMES) - SET(dvi_target ${LATEX_TARGET}_dvi) - SET(pdf_target ${LATEX_TARGET}_pdf) - SET(ps_target ${LATEX_TARGET}_ps) - SET(safepdf_target ${LATEX_TARGET}_safepdf) - SET(html_target ${LATEX_TARGET}_html) - SET(auxclean_target ${LATEX_TARGET}_auxclean) - ELSE (LATEX_MANGLE_TARGET_NAMES) - SET(dvi_target dvi) - SET(pdf_target pdf) - SET(ps_target ps) - SET(safepdf_target safepdf) - SET(html_target html) - SET(auxclean_target auxclean) - ENDIF (LATEX_MANGLE_TARGET_NAMES) - - # Probably not all of these will be generated, but they could be. - # Note that the aux file is added later. - SET(auxiliary_clean_files - ${output_dir}/${LATEX_TARGET}.aux - ${output_dir}/${LATEX_TARGET}.bbl - ${output_dir}/${LATEX_TARGET}.blg - ${output_dir}/${LATEX_TARGET}-blx.bib - ${output_dir}/${LATEX_TARGET}.glg - ${output_dir}/${LATEX_TARGET}.glo - ${output_dir}/${LATEX_TARGET}.gls - ${output_dir}/${LATEX_TARGET}.idx - ${output_dir}/${LATEX_TARGET}.ilg - ${output_dir}/${LATEX_TARGET}.ind - ${output_dir}/${LATEX_TARGET}.ist - ${output_dir}/${LATEX_TARGET}.log - ${output_dir}/${LATEX_TARGET}.out - ${output_dir}/${LATEX_TARGET}.toc - ${output_dir}/${LATEX_TARGET}.lof - ${output_dir}/${LATEX_TARGET}.xdy - ${output_dir}/${LATEX_TARGET}.synctex.gz - ${output_dir}/${LATEX_TARGET}.synctex.bak.gz - ${output_dir}/${LATEX_TARGET}.dvi - ${output_dir}/${LATEX_TARGET}.ps - ${output_dir}/${LATEX_TARGET}.pdf - ) - - SET(image_list ${LATEX_IMAGES}) - - # For each directory in LATEX_IMAGE_DIRS, glob all the image files and - # place them in LATEX_IMAGES. - FOREACH(dir ${LATEX_IMAGE_DIRS}) - IF (NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${dir}) - MESSAGE(WARNING "Image directory ${CMAKE_CURRENT_SOURCE_DIR}/${dir} does not exist. Are you sure you gave relative directories to IMAGE_DIRS?") - ENDIF (NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${dir}) - FOREACH(extension ${LATEX_IMAGE_EXTENSIONS}) - FILE(GLOB files ${CMAKE_CURRENT_SOURCE_DIR}/${dir}/*${extension}) - FOREACH(file ${files}) - LATEX_GET_FILENAME_COMPONENT(filename ${file} NAME) - SET(image_list ${image_list} ${dir}/${filename}) - ENDFOREACH(file) - ENDFOREACH(extension) - ENDFOREACH(dir) - - LATEX_PROCESS_IMAGES(dvi_images pdf_images ${image_list}) - - SET(make_dvi_command - ${CMAKE_COMMAND} -E chdir ${output_dir} - ${latex_build_command}) - SET(make_pdf_command - ${CMAKE_COMMAND} -E chdir ${output_dir} - ${pdflatex_build_command} - ) - - SET(make_dvi_depends ${LATEX_DEPENDS} ${dvi_images}) - SET(make_pdf_depends ${LATEX_DEPENDS} ${pdf_images}) - FOREACH(input ${LATEX_MAIN_INPUT} ${LATEX_INPUTS}) - SET(make_dvi_depends ${make_dvi_depends} ${output_dir}/${input}) - SET(make_pdf_depends ${make_pdf_depends} ${output_dir}/${input}) - IF (${input} MATCHES "\\.tex$") - # Dependent .tex files might have their own .aux files created. Make - # sure these get cleaned as well. This might replicate the cleaning - # of the main .aux file, which is OK. - STRING(REGEX REPLACE "\\.tex$" "" input_we ${input}) - SET(auxiliary_clean_files ${auxiliary_clean_files} - ${output_dir}/${input_we}.aux - ${output_dir}/${input}.aux - ) - ENDIF (${input} MATCHES "\\.tex$") - ENDFOREACH(input) - - IF (LATEX_USE_GLOSSARY) - FOREACH(dummy 0 1) # Repeat these commands twice. - SET(make_dvi_command ${make_dvi_command} - COMMAND ${CMAKE_COMMAND} -E chdir ${output_dir} - ${CMAKE_COMMAND} - -D LATEX_BUILD_COMMAND=makeglossaries - -D LATEX_TARGET=${LATEX_TARGET} - -D MAKEINDEX_COMPILER=${MAKEINDEX_COMPILER} - -D XINDY_COMPILER=${XINDY_COMPILER} - -D MAKEGLOSSARIES_COMPILER_FLAGS=${MAKEGLOSSARIES_COMPILER_FLAGS} - -P ${LATEX_USE_LATEX_LOCATION} - COMMAND ${CMAKE_COMMAND} -E chdir ${output_dir} - ${latex_build_command} - ) - SET(make_pdf_command ${make_pdf_command} - COMMAND ${CMAKE_COMMAND} -E chdir ${output_dir} - ${CMAKE_COMMAND} - -D LATEX_BUILD_COMMAND=makeglossaries - -D LATEX_TARGET=${LATEX_TARGET} - -D MAKEINDEX_COMPILER=${MAKEINDEX_COMPILER} - -D XINDY_COMPILER=${XINDY_COMPILER} - -D MAKEGLOSSARIES_COMPILER_FLAGS=${MAKEGLOSSARIES_COMPILER_FLAGS} - -P ${LATEX_USE_LATEX_LOCATION} - COMMAND ${CMAKE_COMMAND} -E chdir ${output_dir} - ${pdflatex_build_command} - ) - ENDFOREACH(dummy) - ENDIF (LATEX_USE_GLOSSARY) - - IF (LATEX_USE_NOMENCL) - FOREACH(dummy 0 1) # Repeat these commands twice. - SET(make_dvi_command ${make_dvi_command} - COMMAND ${CMAKE_COMMAND} -E chdir ${output_dir} - ${CMAKE_COMMAND} - -D LATEX_BUILD_COMMAND=makenomenclature - -D LATEX_TARGET=${LATEX_TARGET} - -D MAKEINDEX_COMPILER=${MAKEINDEX_COMPILER} - -D MAKENOMENCLATURE_COMPILER_FLAGS=${MAKENOMENCLATURE_COMPILER_FLAGS} - -P ${LATEX_USE_LATEX_LOCATION} - COMMAND ${CMAKE_COMMAND} -E chdir ${output_dir} - ${latex_build_command} - ) - SET(make_pdf_command ${make_pdf_command} - COMMAND ${CMAKE_COMMAND} -E chdir ${output_dir} - ${CMAKE_COMMAND} - -D LATEX_BUILD_COMMAND=makenomenclature - -D LATEX_TARGET=${LATEX_TARGET} - -D MAKEINDEX_COMPILER=${MAKEINDEX_COMPILER} - -D MAKENOMENCLATURE_COMPILER_FLAGS=${MAKENOMENCLATURE_COMPILER_FLAGS} - -P ${LATEX_USE_LATEX_LOCATION} - COMMAND ${CMAKE_COMMAND} -E chdir ${output_dir} - ${pdflatex_build_command} - ) - ENDFOREACH(dummy) - ENDIF (LATEX_USE_NOMENCL) - - IF (LATEX_BIBFILES) - IF (LATEX_MULTIBIB_NEWCITES) - FOREACH (multibib_auxfile ${LATEX_MULTIBIB_NEWCITES}) - LATEX_GET_FILENAME_COMPONENT(multibib_target ${multibib_auxfile} NAME_WE) - SET(make_dvi_command ${make_dvi_command} - COMMAND ${CMAKE_COMMAND} -E chdir ${output_dir} - ${BIBTEX_COMPILER} ${BIBTEX_COMPILER_FLAGS} ${multibib_target}) - SET(make_pdf_command ${make_pdf_command} - COMMAND ${CMAKE_COMMAND} -E chdir ${output_dir} - ${BIBTEX_COMPILER} ${BIBTEX_COMPILER_FLAGS} ${multibib_target}) - SET(auxiliary_clean_files ${auxiliary_clean_files} - ${output_dir}/${multibib_target}.aux) - ENDFOREACH (multibib_auxfile ${LATEX_MULTIBIB_NEWCITES}) - ELSE (LATEX_MULTIBIB_NEWCITES) - SET(make_dvi_command ${make_dvi_command} - COMMAND ${CMAKE_COMMAND} -E chdir ${output_dir} - ${BIBTEX_COMPILER} ${BIBTEX_COMPILER_FLAGS} ${LATEX_TARGET}) - SET(make_pdf_command ${make_pdf_command} - COMMAND ${CMAKE_COMMAND} -E chdir ${output_dir} - ${BIBTEX_COMPILER} ${BIBTEX_COMPILER_FLAGS} ${LATEX_TARGET}) - ENDIF (LATEX_MULTIBIB_NEWCITES) - - FOREACH (bibfile ${LATEX_BIBFILES}) - SET(make_dvi_depends ${make_dvi_depends} ${output_dir}/${bibfile}) - SET(make_pdf_depends ${make_pdf_depends} ${output_dir}/${bibfile}) - ENDFOREACH (bibfile ${LATEX_BIBFILES}) - ELSE (LATEX_BIBFILES) - IF (LATEX_MULTIBIB_NEWCITES) - MESSAGE(WARNING "MULTIBIB_NEWCITES has no effect without BIBFILES option.") - ENDIF (LATEX_MULTIBIB_NEWCITES) - ENDIF (LATEX_BIBFILES) - - IF (LATEX_USE_INDEX) - SET(make_dvi_command ${make_dvi_command} - COMMAND ${CMAKE_COMMAND} -E chdir ${output_dir} - ${latex_build_command} - COMMAND ${CMAKE_COMMAND} -E chdir ${output_dir} - ${MAKEINDEX_COMPILER} ${MAKEINDEX_COMPILER_FLAGS} ${LATEX_TARGET}.idx) - SET(make_pdf_command ${make_pdf_command} - COMMAND ${CMAKE_COMMAND} -E chdir ${output_dir} - ${pdflatex_build_command} - COMMAND ${CMAKE_COMMAND} -E chdir ${output_dir} - ${MAKEINDEX_COMPILER} ${MAKEINDEX_COMPILER_FLAGS} ${LATEX_TARGET}.idx) - ENDIF (LATEX_USE_INDEX) - - SET(make_dvi_command ${make_dvi_command} - COMMAND ${CMAKE_COMMAND} -E chdir ${output_dir} - ${latex_build_command} - COMMAND ${CMAKE_COMMAND} -E chdir ${output_dir} - ${latex_build_command}) - SET(make_pdf_command ${make_pdf_command} - COMMAND ${CMAKE_COMMAND} -E chdir ${output_dir} - ${pdflatex_build_command} - COMMAND ${CMAKE_COMMAND} -E chdir ${output_dir} - ${pdflatex_build_command}) - - IF (LATEX_USE_SYNCTEX) - IF (NOT GZIP) - MESSAGE(SEND_ERROR "UseLATEX.cmake: USE_SYNTEX option requires gzip program. Set GZIP variable.") - ENDIF (NOT GZIP) - SET(make_dvi_command ${make_dvi_command} - COMMAND ${CMAKE_COMMAND} - -D LATEX_BUILD_COMMAND=correct_synctex - -D LATEX_TARGET=${LATEX_TARGET} - -D GZIP=${GZIP} - -D "LATEX_SOURCE_DIRECTORY=${CMAKE_CURRENT_SOURCE_DIR}" - -D "LATEX_BINARY_DIRECTORY=${output_dir}" - -P ${LATEX_USE_LATEX_LOCATION} - ) - SET(make_pdf_command ${make_pdf_command} - COMMAND ${CMAKE_COMMAND} - -D LATEX_BUILD_COMMAND=correct_synctex - -D LATEX_TARGET=${LATEX_TARGET} - -D GZIP=${GZIP} - -D "LATEX_SOURCE_DIRECTORY=${CMAKE_CURRENT_SOURCE_DIR}" - -D "LATEX_BINARY_DIRECTORY=${output_dir}" - -P ${LATEX_USE_LATEX_LOCATION} - ) - ENDIF (LATEX_USE_SYNCTEX) - - # Add commands and targets for building dvi outputs. - ADD_CUSTOM_COMMAND(OUTPUT ${output_dir}/${LATEX_TARGET}.dvi - COMMAND ${make_dvi_command} - DEPENDS ${make_dvi_depends} - ) - IF (LATEX_NO_DEFAULT OR LATEX_DEFAULT_PDF OR LATEX_DEFAULT_SAFEPDF OR DEFAULT_PS) - ADD_CUSTOM_TARGET(${dvi_target} - DEPENDS ${output_dir}/${LATEX_TARGET}.dvi) - ELSE (LATEX_NO_DEFAULT OR LATEX_DEFAULT_PDF OR LATEX_DEFAULT_SAFEPDF OR DEFAULT_PS) - ADD_CUSTOM_TARGET(${dvi_target} ALL - DEPENDS ${output_dir}/${LATEX_TARGET}.dvi) - ENDIF (LATEX_NO_DEFAULT OR LATEX_DEFAULT_PDF OR LATEX_DEFAULT_SAFEPDF OR DEFAULT_PS) - - # Add commands and targets for building pdf outputs (with pdflatex). - IF (PDFLATEX_COMPILER) - ADD_CUSTOM_COMMAND(OUTPUT ${output_dir}/${LATEX_TARGET}.pdf - COMMAND ${make_pdf_command} - DEPENDS ${make_pdf_depends} - ) - IF (LATEX_DEFAULT_PDF) - ADD_CUSTOM_TARGET(${pdf_target} ALL - DEPENDS ${output_dir}/${LATEX_TARGET}.pdf) - ELSE (LATEX_DEFAULT_PDF) - ADD_CUSTOM_TARGET(${pdf_target} - DEPENDS ${output_dir}/${LATEX_TARGET}.pdf) - ENDIF (LATEX_DEFAULT_PDF) - ENDIF (PDFLATEX_COMPILER) - - IF (DVIPS_CONVERTER) - ADD_CUSTOM_COMMAND(OUTPUT ${output_dir}/${LATEX_TARGET}.ps - COMMAND ${CMAKE_COMMAND} -E chdir ${output_dir} - ${DVIPS_CONVERTER} ${DVIPS_CONVERTER_FLAGS} -o ${LATEX_TARGET}.ps ${LATEX_TARGET}.dvi - DEPENDS ${output_dir}/${LATEX_TARGET}.dvi) - IF (LATEX_DEFAULT_PS) - ADD_CUSTOM_TARGET(${ps_target} ALL - DEPENDS ${output_dir}/${LATEX_TARGET}.ps) - ELSE (LATEX_DEFAULT_PS) - ADD_CUSTOM_TARGET(${ps_target} - DEPENDS ${output_dir}/${LATEX_TARGET}.ps) - ENDIF (LATEX_DEFAULT_PS) - IF (PS2PDF_CONVERTER) - # Since both the pdf and safepdf targets have the same output, we - # cannot properly do the dependencies for both. When selecting safepdf, - # simply force a recompile every time. - IF (LATEX_DEFAULT_SAFEPDF) - ADD_CUSTOM_TARGET(${safepdf_target} ALL - ${CMAKE_COMMAND} -E chdir ${output_dir} - ${PS2PDF_CONVERTER} ${PS2PDF_CONVERTER_FLAGS} ${LATEX_TARGET}.ps ${LATEX_TARGET}.pdf - ) - ELSE (LATEX_DEFAULT_SAFEPDF) - ADD_CUSTOM_TARGET(${safepdf_target} - ${CMAKE_COMMAND} -E chdir ${output_dir} - ${PS2PDF_CONVERTER} ${PS2PDF_CONVERTER_FLAGS} ${LATEX_TARGET}.ps ${LATEX_TARGET}.pdf - ) - ENDIF (LATEX_DEFAULT_SAFEPDF) - ADD_DEPENDENCIES(${safepdf_target} ${ps_target}) - ENDIF (PS2PDF_CONVERTER) - ENDIF (DVIPS_CONVERTER) - - IF (LATEX2HTML_CONVERTER) - IF (USING_HTLATEX) - # htlatex places the output in a different location - SET (HTML_OUTPUT "${output_dir}/${LATEX_TARGET}.html") - ELSE (USING_HTLATEX) - SET (HTML_OUTPUT "${output_dir}/${LATEX_TARGET}/${LATEX_TARGET}.html") - ENDIF (USING_HTLATEX) - ADD_CUSTOM_COMMAND(OUTPUT ${HTML_OUTPUT} - COMMAND ${CMAKE_COMMAND} -E chdir ${output_dir} - ${LATEX2HTML_CONVERTER} ${LATEX2HTML_CONVERTER_FLAGS} ${LATEX_MAIN_INPUT} - DEPENDS ${output_dir}/${LATEX_TARGET}.tex - ) - ADD_CUSTOM_TARGET(${html_target} - DEPENDS ${HTML_OUTPUT} - ) - ADD_DEPENDENCIES(${html_target} ${dvi_target}) - ENDIF (LATEX2HTML_CONVERTER) - - SET_DIRECTORY_PROPERTIES(. - ADDITIONAL_MAKE_CLEAN_FILES "${auxiliary_clean_files}" - ) - - ADD_CUSTOM_TARGET(${auxclean_target} - COMMENT "Cleaning auxiliary LaTeX files." - COMMAND ${CMAKE_COMMAND} -E remove ${auxiliary_clean_files} - ) -ENDFUNCTION(ADD_LATEX_TARGETS_INTERNAL) - -FUNCTION(ADD_LATEX_TARGETS) - LATEX_GET_OUTPUT_PATH(output_dir) - PARSE_ADD_LATEX_ARGUMENTS(ADD_LATEX_TARGETS ${ARGV}) - - ADD_LATEX_TARGETS_INTERNAL() -ENDFUNCTION(ADD_LATEX_TARGETS) - -FUNCTION(ADD_LATEX_DOCUMENT) - LATEX_GET_OUTPUT_PATH(output_dir) - IF (output_dir) - PARSE_ADD_LATEX_ARGUMENTS(ADD_LATEX_DOCUMENT ${ARGV}) - - LATEX_COPY_INPUT_FILE(${LATEX_MAIN_INPUT}) - - FOREACH (bib_file ${LATEX_BIBFILES}) - LATEX_COPY_INPUT_FILE(${bib_file}) - ENDFOREACH (bib_file) - - FOREACH (input ${LATEX_INPUTS}) - LATEX_COPY_INPUT_FILE(${input}) - ENDFOREACH(input) - - LATEX_COPY_GLOBBED_FILES(${CMAKE_CURRENT_SOURCE_DIR}/*.cls ${output_dir}) - LATEX_COPY_GLOBBED_FILES(${CMAKE_CURRENT_SOURCE_DIR}/*.bst ${output_dir}) - LATEX_COPY_GLOBBED_FILES(${CMAKE_CURRENT_SOURCE_DIR}/*.clo ${output_dir}) - LATEX_COPY_GLOBBED_FILES(${CMAKE_CURRENT_SOURCE_DIR}/*.sty ${output_dir}) - LATEX_COPY_GLOBBED_FILES(${CMAKE_CURRENT_SOURCE_DIR}/*.ist ${output_dir}) - LATEX_COPY_GLOBBED_FILES(${CMAKE_CURRENT_SOURCE_DIR}/*.fd ${output_dir}) - - ADD_LATEX_TARGETS_INTERNAL() - ENDIF (output_dir) -ENDFUNCTION(ADD_LATEX_DOCUMENT) - -############################################################################# -# Actually do stuff -############################################################################# - -IF (LATEX_BUILD_COMMAND) - SET(command_handled) - - IF ("${LATEX_BUILD_COMMAND}" STREQUAL makeglossaries) - LATEX_MAKEGLOSSARIES() - SET(command_handled TRUE) - ENDIF ("${LATEX_BUILD_COMMAND}" STREQUAL makeglossaries) - - IF ("${LATEX_BUILD_COMMAND}" STREQUAL makenomenclature) - LATEX_MAKENOMENCLATURE() - SET(command_handled TRUE) - ENDIF ("${LATEX_BUILD_COMMAND}" STREQUAL makenomenclature) - - IF ("${LATEX_BUILD_COMMAND}" STREQUAL correct_synctex) - LATEX_CORRECT_SYNCTEX() - SET(command_handled TRUE) - ENDIF ("${LATEX_BUILD_COMMAND}" STREQUAL correct_synctex) - - IF (NOT command_handled) - MESSAGE(SEND_ERROR "Unknown command: ${LATEX_BUILD_COMMAND}") - ENDIF (NOT command_handled) - -ELSE (LATEX_BUILD_COMMAND) - # Must be part of the actual configure (included from CMakeLists.txt). - LATEX_SETUP_VARIABLES() -ENDIF (LATEX_BUILD_COMMAND)