From 5a9f4309336fc392bc98c438cf350c8ef11f6f15 Mon Sep 17 00:00:00 2001 From: Morgan Hardwood Date: Thu, 27 Feb 2020 10:43:21 +0100 Subject: [PATCH 01/13] Update rtexif using ExifTool 11.89 --- rtexif/canonattribs.cc | 2 +- rtexif/olympusattribs.cc | 1 + rtexif/pentaxattribs.cc | 2 ++ rtexif/sonyminoltaattribs.cc | 2 ++ 4 files changed, 6 insertions(+), 1 deletion(-) diff --git a/rtexif/canonattribs.cc b/rtexif/canonattribs.cc index 636bf4328..a91b7266c 100644 --- a/rtexif/canonattribs.cc +++ b/rtexif/canonattribs.cc @@ -845,7 +845,7 @@ public: {195, "Canon EF 35-105mm f/4.5-5.6 USM"}, {196, "Canon EF 75-300mm f/4-5.6 USM"}, {197, "Canon EF 75-300mm f/4-5.6 IS USM or Sigma Lens"}, - {197, "Sigma 18-300mm f/3.5-6.3 DC Macro OS HS"}, + {197, "Sigma 18-300mm f/3.5-6.3 DC Macro OS HSM"}, {198, "Canon EF 50mm f/1.4 USM or Other Lens"}, {198, "Zeiss Otus 55mm f/1.4 ZE"}, {198, "Zeiss Otus 85mm f/1.4 ZE"}, diff --git a/rtexif/olympusattribs.cc b/rtexif/olympusattribs.cc index ec7ab98c7..52fbec55d 100644 --- a/rtexif/olympusattribs.cc +++ b/rtexif/olympusattribs.cc @@ -131,6 +131,7 @@ public: lenses["00 32 10"] = "Olympus M.Zuiko Digital ED 12-200mm f/3.5-6.3"; lenses["00 33 00"] = "Olympus Zuiko Digital 25mm f/2.8"; lenses["00 34 00"] = "Olympus Zuiko Digital ED 9-18mm f/4.0-5.6"; + lenses["00 34 10"] = "Olympus M.Zuiko Digital ED 12-45mm f/4.0 Pro"; lenses["00 35 00"] = "Olympus Zuiko Digital 14-54mm f/2.8-3.5 II"; lenses["01 01 00"] = "Sigma 18-50mm f/3.5-5.6 DC"; lenses["01 01 10"] = "Sigma 30mm f/2.8 EX DN"; diff --git a/rtexif/pentaxattribs.cc b/rtexif/pentaxattribs.cc index da940f5cb..d6b9a9c84 100644 --- a/rtexif/pentaxattribs.cc +++ b/rtexif/pentaxattribs.cc @@ -782,6 +782,7 @@ public: choices.insert (p_t (256 * 4 + 2, "smc PENTAX-FA 80-320mm f/4.5-5.6")); choices.insert (p_t (256 * 4 + 3, "smc PENTAX-FA 43mm f/1.9 Limited")); choices.insert (p_t (256 * 4 + 6, "smc PENTAX-FA 35-80mm f/4-5.6")); + choices.insert (p_t (256 * 4 + 8, "Irix 150mm f/2.8 Macro")); choices.insert (p_t (256 * 4 + 9, "Irix 11mm f/4 Firefly")); choices.insert (p_t (256 * 4 + 10, "Irix 15mm f/2.4")); choices.insert (p_t (256 * 4 + 12, "smc PENTAX-FA 50mm f/1.4")); @@ -938,6 +939,7 @@ public: choices.insert (p_t (256 * 8 + 62, "HD PENTAX-D FA 24-70mm f/2.8 ED SDM WR")); choices.insert (p_t (256 * 8 + 63, "HD PENTAX-D FA 15-30mm f/2.8 ED SDM WR")); choices.insert (p_t (256 * 8 + 64, "HD PENTAX-D FA* 50mm f/1.4 SDM AW")); + choices.insert (p_t (256 * 8 + 65, "HD PENTAX-D FA 70-210mm f/4 ED SDM WR")); choices.insert (p_t (256 * 8 + 196, "HD PENTAX-DA* 11-18mm f/2.8 ED DC AW")); choices.insert (p_t (256 * 8 + 197, "HD PENTAX-DA 55-300mm f/4.5-6.3 ED PLM WR RE")); choices.insert (p_t (256 * 8 + 198, "smc PENTAX-DA L 18-50mm f/4-5.6 DC WR RE")); diff --git a/rtexif/sonyminoltaattribs.cc b/rtexif/sonyminoltaattribs.cc index 88251b131..4c901b8c0 100644 --- a/rtexif/sonyminoltaattribs.cc +++ b/rtexif/sonyminoltaattribs.cc @@ -1126,6 +1126,7 @@ public: choices.insert (p_t (49458, "Tamron 17-28mm f/2.8 Di III RXD")); choices.insert (p_t (49459, "Tamron 35mm f/2.8 Di III OSD M1:2")); choices.insert (p_t (49460, "Tamron 24mm f/2.8 Di III OSD M1:2")); + choices.insert (p_t (49461, "Tamron 20mm f/2.8 Di III OSD M1:2")); choices.insert (p_t (49712, "Tokina FiRIN 20mm f/2 FE AF")); choices.insert (p_t (49713, "Tokina FiRIN 100mm f/2.8 FE MACRO")); choices.insert (p_t (50480, "Sigma 30mm f/1.4 DC DN | C")); @@ -1152,6 +1153,7 @@ public: choices.insert (p_t (50514, "Sigma 45mm f/2.8 DG DN | C")); choices.insert (p_t (50515, "Sigma 35mm f/1.2 DG DN | A")); choices.insert (p_t (50516, "Sigma 14-24mm f/2.8 DG DN | A")); + choices.insert (p_t (50517, "Sigma 24-70mm f/2.8 DG DN | A")); choices.insert (p_t (50992, "Voigtlander SUPER WIDE-HELIAR 15mm f/4.5 III")); choices.insert (p_t (50993, "Voigtlander HELIAR-HYPER WIDE 10mm f/5.6")); choices.insert (p_t (50994, "Voigtlander ULTRA WIDE-HELIAR 12mm f/5.6 III")); From 2bc9396569c574f1e5c41768dea947b8775ee9e5 Mon Sep 17 00:00:00 2001 From: Desmis Date: Thu, 27 Feb 2020 13:33:51 +0100 Subject: [PATCH 02/13] Fixed show wavelet levels --- rtengine/dcrop.cc | 4 ++-- rtengine/improccoordinator.cc | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/rtengine/dcrop.cc b/rtengine/dcrop.cc index b9594a709..3e9e2a6a8 100644 --- a/rtengine/dcrop.cc +++ b/rtengine/dcrop.cc @@ -1008,12 +1008,12 @@ void Crop::update(int todo) params.wavelet.CLmethod = provis; } - +/* if (!WaveParams.expclari && WaveParams.CLmethod != "all") { params.wavelet.CLmethod = "all"; params.wavelet.Backmethod = "grey"; } - +*/ if ((WaveParams.ushamethod == "sharp" || WaveParams.ushamethod == "clari") && WaveParams.expclari && WaveParams.CLmethod != "all") { WaveParams.expcontrast = false; WaveParams.expchroma = false; diff --git a/rtengine/improccoordinator.cc b/rtengine/improccoordinator.cc index 1115fa4fc..35834a976 100644 --- a/rtengine/improccoordinator.cc +++ b/rtengine/improccoordinator.cc @@ -906,12 +906,12 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange) params->wavelet.CLmethod = provis; } - +/* if (!WaveParams.expclari && WaveParams.CLmethod != "all") { params->wavelet.CLmethod = "all"; params->wavelet.Backmethod = "grey"; } - +*/ if ((WaveParams.ushamethod == "sharp" || WaveParams.ushamethod == "clari") && WaveParams.expclari && WaveParams.CLmethod != "all") { WaveParams.expcontrast = false; WaveParams.expchroma = false; From d2f78efd3266ba32a9c516a32ca1043392d53702 Mon Sep 17 00:00:00 2001 From: Ingo Weyrich Date: Thu, 27 Feb 2020 14:20:28 +0100 Subject: [PATCH 03/13] improccoordinator.cc : be cppcheck clean --- rtengine/improccoordinator.cc | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/rtengine/improccoordinator.cc b/rtengine/improccoordinator.cc index 35834a976..6c9105036 100644 --- a/rtengine/improccoordinator.cc +++ b/rtengine/improccoordinator.cc @@ -351,7 +351,7 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange) bayerAutoContrastListener->autoContrastChanged(contrastThreshold); } else if (imgsrc->getSensorType() == ST_FUJI_XTRANS && xtransAutoContrastListener && autoContrast) { - xtransAutoContrastListener->autoContrastChanged(autoContrast ? contrastThreshold : -1.0); + xtransAutoContrastListener->autoContrastChanged(contrastThreshold); } // if a demosaic happened we should also call getimage later, so we need to set the M_INIT flag todo |= (M_INIT | M_CSHARP); @@ -905,14 +905,6 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange) params->wavelet.CLmethod = provis; - } -/* - if (!WaveParams.expclari && WaveParams.CLmethod != "all") { - params->wavelet.CLmethod = "all"; - params->wavelet.Backmethod = "grey"; - } -*/ - if ((WaveParams.ushamethod == "sharp" || WaveParams.ushamethod == "clari") && WaveParams.expclari && WaveParams.CLmethod != "all") { WaveParams.expcontrast = false; WaveParams.expchroma = false; WaveParams.expedge = false; From 19b6e4ca68c440874411989e0a0a6f942d56827b Mon Sep 17 00:00:00 2001 From: Ingo Weyrich Date: Thu, 27 Feb 2020 14:30:59 +0100 Subject: [PATCH 04/13] dcrop.cc : be cppcheck clean --- rtengine/dcrop.cc | 8 -------- 1 file changed, 8 deletions(-) diff --git a/rtengine/dcrop.cc b/rtengine/dcrop.cc index 3e9e2a6a8..243ea1b62 100644 --- a/rtengine/dcrop.cc +++ b/rtengine/dcrop.cc @@ -1007,14 +1007,6 @@ void Crop::update(int todo) params.wavelet.CLmethod = provis; - } -/* - if (!WaveParams.expclari && WaveParams.CLmethod != "all") { - params.wavelet.CLmethod = "all"; - params.wavelet.Backmethod = "grey"; - } -*/ - if ((WaveParams.ushamethod == "sharp" || WaveParams.ushamethod == "clari") && WaveParams.expclari && WaveParams.CLmethod != "all") { WaveParams.expcontrast = false; WaveParams.expchroma = false; WaveParams.expedge = false; From 4590607ea58013b5c20f40c0a2c4702ddc23ed7e Mon Sep 17 00:00:00 2001 From: Ingo Weyrich Date: Thu, 27 Feb 2020 14:54:17 +0100 Subject: [PATCH 05/13] simpleprocess.cc : be cppcheck clean --- rtengine/simpleprocess.cc | 77 ++++++++++++++++----------------------- 1 file changed, 32 insertions(+), 45 deletions(-) diff --git a/rtengine/simpleprocess.cc b/rtengine/simpleprocess.cc index 28188b0f6..779f2b33d 100644 --- a/rtengine/simpleprocess.cc +++ b/rtengine/simpleprocess.cc @@ -68,7 +68,7 @@ public: pl(pl), flush(flush), // internal state - ii(nullptr), + initialImage(nullptr), imgsrc(nullptr), fw(0), fh(0), @@ -97,6 +97,7 @@ public: hlcomprthresh(0), baseImg(nullptr), labView(nullptr), + ctColorCurve(), autili(false), butili(false) { @@ -150,10 +151,10 @@ private: pl->setProgress(0.0); } - ii = job->initialImage; + initialImage = job->initialImage; - if (!ii) { - ii = InitialImage::load(job->fname, job->isRaw, &errorCode); + if (!initialImage) { + initialImage = InitialImage::load(job->fname, job->isRaw, &errorCode); if (errorCode) { delete job; @@ -164,7 +165,7 @@ private: procparams::ProcParams& params = job->pparams; // acquire image from imagesource - imgsrc = ii->getImageSource(); + imgsrc = initialImage->getImageSource(); tr = getCoarseBitMask(params.coarse); @@ -245,7 +246,6 @@ private: if (params.retinex.enabled) { //enabled Retinex LUTf cdcurve(65536, 0); LUTf mapcurve(65536, 0); - LUTu dummy; RetinextransmissionCurve dehatransmissionCurve; RetinexgaintransmissionCurve dehagaintransmissionCurve; bool dehacontlutili = false; @@ -921,11 +921,11 @@ private: if (profile == "sRGB" || profile == "Adobe RGB" || profile == "ProPhoto" || profile == "WideGamut" || profile == "BruceRGB" || profile == "Beta RGB" || profile == "BestRGB" || profile == "Rec2020" || profile == "ACESp0" || profile == "ACESp1") { const int cw = baseImg->getWidth(); const int ch = baseImg->getHeight(); - cmsHTRANSFORM dummy = nullptr; + cmsHTRANSFORM dummyTransForm = nullptr; // put gamma TRC to 1 - ipf.workingtrc(baseImg, baseImg, cw, ch, -5, params.icm.workingProfile, 2.4, 12.92310, dummy, true, false, false); + ipf.workingtrc(baseImg, baseImg, cw, ch, -5, params.icm.workingProfile, 2.4, 12.92310, dummyTransForm, true, false, false); //adjust TRC - ipf.workingtrc(baseImg, baseImg, cw, ch, 5, params.icm.workingProfile, params.icm.workingTRCGamma, params.icm.workingTRCSlope, dummy, false, true, false); + ipf.workingtrc(baseImg, baseImg, cw, ch, 5, params.icm.workingProfile, params.icm.workingTRCGamma, params.icm.workingTRCSlope, dummyTransForm, false, true, false); } } @@ -1155,9 +1155,7 @@ private: ipf.ip_wavelet(labView, labView, 2, WaveParams, wavCLVCurve, waOpacityCurveRG, waOpacityCurveBY, waOpacityCurveW, waOpacityCurveWL, wavclCurve, 1); unshar->CopyFrom(labView); params.wavelet.CLmethod = provis; - } - if ((WaveParams.ushamethod == "sharp" || WaveParams.ushamethod == "clari") && WaveParams.expclari && WaveParams.CLmethod != "all") { WaveParams.expcontrast = false; WaveParams.expchroma = false; WaveParams.expedge = false; @@ -1402,9 +1400,6 @@ private: } } - cmsHPROFILE jprof = nullptr; - constexpr bool customGamma = false; - constexpr bool useLCMS = false; bool bwonly = params.blackwhite.enabled && !params.colorToning.enabled && !autili && !butili && !params.colorappearance.enabled; ///////////// Custom output gamma has been removed, the user now has to create @@ -1453,12 +1448,12 @@ private: case MetaDataParams::TUNNEL: // Sending back the whole first root, which won't necessarily be the selected frame number // and may contain subframe depending on initial raw's hierarchy - readyImg->setMetadata(ii->getMetaData()->getRootExifData()); + readyImg->setMetadata(initialImage->getMetaData()->getRootExifData()); break; case MetaDataParams::EDIT: // ask for the correct frame number, but may contain subframe depending on initial raw's hierarchy - readyImg->setMetadata(ii->getMetaData()->getBestExifData(imgsrc, ¶ms.raw), params.exif, params.iptc); + readyImg->setMetadata(initialImage->getMetaData()->getBestExifData(imgsrc, ¶ms.raw), params.exif, params.iptc); break; default: // case MetaDataParams::STRIP @@ -1468,36 +1463,28 @@ private: // Setting the output curve to readyImg - if (customGamma) { - if (!useLCMS) { - // use corrected sRGB profile in order to apply a good TRC if present, otherwise use LCMS2 profile generated by lab2rgb16 w/ gamma - ProfileContent pc(jprof); + // use the selected output profile if present, otherwise use LCMS2 profile generate by lab2rgb16 w/ gamma + + if (!params.icm.outputProfile.empty() && params.icm.outputProfile != ColorManagementParams::NoICMString) { + + // if ICCStore::getInstance()->getProfile send back an object, then ICCStore::getInstance()->getContent will do too + cmsHPROFILE jprof = ICCStore::getInstance()->getProfile(params.icm.outputProfile); //get outProfile + + if (jprof == nullptr) { + if (settings->verbose) { + printf("\"%s\" ICC output profile not found!\n - use LCMS2 substitution\n", params.icm.outputProfile.c_str()); + } + } else { + if (settings->verbose) { + printf("Using \"%s\" output profile\n", params.icm.outputProfile.c_str()); + } + + ProfileContent pc = ICCStore::getInstance()->getContent(params.icm.outputProfile); readyImg->setOutputProfile(pc.getData().c_str(), pc.getData().size()); } } else { - // use the selected output profile if present, otherwise use LCMS2 profile generate by lab2rgb16 w/ gamma - - if (!params.icm.outputProfile.empty() && params.icm.outputProfile != ColorManagementParams::NoICMString) { - - // if ICCStore::getInstance()->getProfile send back an object, then ICCStore::getInstance()->getContent will do too - cmsHPROFILE jprof = ICCStore::getInstance()->getProfile(params.icm.outputProfile); //get outProfile - - if (jprof == nullptr) { - if (settings->verbose) { - printf("\"%s\" ICC output profile not found!\n - use LCMS2 substitution\n", params.icm.outputProfile.c_str()); - } - } else { - if (settings->verbose) { - printf("Using \"%s\" output profile\n", params.icm.outputProfile.c_str()); - } - - ProfileContent pc = ICCStore::getInstance()->getContent(params.icm.outputProfile); - readyImg->setOutputProfile(pc.getData().c_str(), pc.getData().size()); - } - } else { - // No ICM - readyImg->setOutputProfile(nullptr, 0); - } + // No ICM + readyImg->setOutputProfile(nullptr, 0); } // t2.set(); @@ -1505,7 +1492,7 @@ private: // printf("Total:- %d usec\n", t2.etime(t1)); if (!job->initialImage) { - ii->decreaseRef(); + initialImage->decreaseRef(); } delete job; @@ -1669,7 +1656,7 @@ private: // internal state std::unique_ptr ipf_p; - InitialImage *ii; + InitialImage *initialImage; ImageSource *imgsrc; int fw; int fh; From d56c53b1ae9c69e8ddbbcb4f3c1962578393824c Mon Sep 17 00:00:00 2001 From: Desmis Date: Thu, 27 Feb 2020 18:06:30 +0100 Subject: [PATCH 06/13] Change tooltip --- rtdata/languages/default | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rtdata/languages/default b/rtdata/languages/default index a807ba9ea..7069d44ed 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -2320,7 +2320,7 @@ TP_WBALANCE_SOLUX47;Solux 4700K (vendor) TP_WBALANCE_SOLUX47_NG;Solux 4700K (Nat. Gallery) TP_WBALANCE_SPOTWB;Use the pipette to pick the white balance from a neutral patch in the preview. TP_WBALANCE_STUDLABEL;Student Itcwb: %1 -TP_WBALANCE_STUDLABEL_TOOLTIP;Display calculated Student correlation\nThe lower the student value, the better the correlation\nValues below 0.002 are excellent\nValues below 0.005 are very good\nValues below 0.01 are good\nValues below 0.05 are good enough\nValues above 0.5 are poor\nVery good Student test results does not mean that the WB is good, if the illuminant is non-standard the results are erratic. +TP_WBALANCE_STUDLABEL_TOOLTIP;Display calculated Student correlation\nThe lower the student value, the better the correlation\nValues below 0.002 are excellent\nValues below 0.005 are very good\nValues below 0.01 are good\nValues below 0.05 are good enough\nValues above 0.5 are poor\nVery good Student test results does not mean that the WB is good, if the illuminant is non-standard the results are erratic.\nStudent=1000 meeans the calculations were not restarted but results are probably goods TP_WBALANCE_TEMPBIAS;AWB temperature bias TP_WBALANCE_TEMPBIAS_TOOLTIP;Allows to alter the computation of the "auto white balance"\nby biasing it towards warmer or cooler temperatures. The bias\nis expressed as a percentage of the computed temperature,\nso that the result is given by "computedTemp + computedTemp * bias". TP_WBALANCE_TEMPERATURE;Temperature From 10af444786e6b5dc4baa3e35756525674872458a Mon Sep 17 00:00:00 2001 From: Desmis Date: Thu, 27 Feb 2020 18:08:02 +0100 Subject: [PATCH 07/13] Change tooltip orthographe --- rtdata/languages/default | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rtdata/languages/default b/rtdata/languages/default index 7069d44ed..5af093b6b 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -2320,7 +2320,7 @@ TP_WBALANCE_SOLUX47;Solux 4700K (vendor) TP_WBALANCE_SOLUX47_NG;Solux 4700K (Nat. Gallery) TP_WBALANCE_SPOTWB;Use the pipette to pick the white balance from a neutral patch in the preview. TP_WBALANCE_STUDLABEL;Student Itcwb: %1 -TP_WBALANCE_STUDLABEL_TOOLTIP;Display calculated Student correlation\nThe lower the student value, the better the correlation\nValues below 0.002 are excellent\nValues below 0.005 are very good\nValues below 0.01 are good\nValues below 0.05 are good enough\nValues above 0.5 are poor\nVery good Student test results does not mean that the WB is good, if the illuminant is non-standard the results are erratic.\nStudent=1000 meeans the calculations were not restarted but results are probably goods +TP_WBALANCE_STUDLABEL_TOOLTIP;Display calculated Student correlation\nThe lower the student value, the better the correlation\nValues below 0.002 are excellent\nValues below 0.005 are very good\nValues below 0.01 are good\nValues below 0.05 are good enough\nValues above 0.5 are poor\nVery good Student test results does not mean that the WB is good, if the illuminant is non-standard the results are erratic.\nStudent=1000 means the calculations were not restarted but results are probably goods TP_WBALANCE_TEMPBIAS;AWB temperature bias TP_WBALANCE_TEMPBIAS_TOOLTIP;Allows to alter the computation of the "auto white balance"\nby biasing it towards warmer or cooler temperatures. The bias\nis expressed as a percentage of the computed temperature,\nso that the result is given by "computedTemp + computedTemp * bias". TP_WBALANCE_TEMPERATURE;Temperature From a3c2264cde6af6296c62c526ecce8a64febbea04 Mon Sep 17 00:00:00 2001 From: Ingo Weyrich Date: Thu, 27 Feb 2020 19:56:42 +0100 Subject: [PATCH 08/13] eahd_demosaic.cc : be cppcheck clean --- rtengine/eahd_demosaic.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/rtengine/eahd_demosaic.cc b/rtengine/eahd_demosaic.cc index ad4bda3cd..009be0714 100644 --- a/rtengine/eahd_demosaic.cc +++ b/rtengine/eahd_demosaic.cc @@ -360,8 +360,8 @@ void RawImageSource::eahd_demosaic () int wh = 0; - for (int dmi = 0; dmi < 9; dmi++) { - wh += (dLmaph[dmi] <= eL) * (dCamaph[dmi] <= eCa) * (dCbmaph[dmi] <= eCb); + for (int d = 0; d < 9; ++d) { + wh += (dLmaph[d] <= eL) * (dCamaph[d] <= eCa) * (dCbmaph[d] <= eCb); } homh[imx][j - 1] += wh; @@ -376,8 +376,8 @@ void RawImageSource::eahd_demosaic () int wv = 0; - for (int dmi = 0; dmi < 9; dmi++) { - wv += (dLmapv[dmi] <= eL) * (dCamapv[dmi] <= eCa) * (dCbmapv[dmi] <= eCb); + for (int d = 0; d < 9; ++d) { + wv += (dLmapv[d] <= eL) * (dCamapv[d] <= eCa) * (dCbmapv[d] <= eCb); } homv[imx][j - 1] += wv; From ae0586719ae39a0c6e3f8b2cc229848ceef77e1a Mon Sep 17 00:00:00 2001 From: Desmis Date: Fri, 28 Feb 2020 08:33:12 +0100 Subject: [PATCH 09/13] Enabled bencfun for Itcwb --- rtdata/languages/default | 2 +- rtengine/rawimagesource.cc | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/rtdata/languages/default b/rtdata/languages/default index 5af093b6b..7e5830ec5 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -2320,7 +2320,7 @@ TP_WBALANCE_SOLUX47;Solux 4700K (vendor) TP_WBALANCE_SOLUX47_NG;Solux 4700K (Nat. Gallery) TP_WBALANCE_SPOTWB;Use the pipette to pick the white balance from a neutral patch in the preview. TP_WBALANCE_STUDLABEL;Student Itcwb: %1 -TP_WBALANCE_STUDLABEL_TOOLTIP;Display calculated Student correlation\nThe lower the student value, the better the correlation\nValues below 0.002 are excellent\nValues below 0.005 are very good\nValues below 0.01 are good\nValues below 0.05 are good enough\nValues above 0.5 are poor\nVery good Student test results does not mean that the WB is good, if the illuminant is non-standard the results are erratic.\nStudent=1000 means the calculations were not restarted but results are probably goods +TP_WBALANCE_STUDLABEL_TOOLTIP;Display calculated Student correlation\nThe lower the student value, the better the correlation\nValues below 0.002 are excellent\nValues below 0.005 are very good\nValues below 0.01 are good\nValues below 0.05 are good enough\nValues above 0.5 are poor\nVery good Student test results does not mean that the WB is good, if the illuminant is non-standard the results are erratic.\nStudent=1000 means the calculations were not restarted but results are probably goods, use previous results TP_WBALANCE_TEMPBIAS;AWB temperature bias TP_WBALANCE_TEMPBIAS_TOOLTIP;Allows to alter the computation of the "auto white balance"\nby biasing it towards warmer or cooler temperatures. The bias\nis expressed as a percentage of the computed temperature,\nso that the result is given by "computedTemp + computedTemp * bias". TP_WBALANCE_TEMPERATURE;Temperature diff --git a/rtengine/rawimagesource.cc b/rtengine/rawimagesource.cc index 3cabaf5b2..63a75cee6 100644 --- a/rtengine/rawimagesource.cc +++ b/rtengine/rawimagesource.cc @@ -43,7 +43,7 @@ #include "rtlensfun.h" #include "../rtgui/options.h" -//#define BENCHMARK +#define BENCHMARK #include "StopWatch.h" #ifdef _OPENMP @@ -5902,7 +5902,7 @@ void RawImageSource::ItcWB(bool extra, double &tempref, double &greenref, double itcwb_delta : 1 by defaut can be set between 0 to 5 ==> delta temp to build histogram xy - if camera temp is not probably good */ // BENCHFUN - // BENCHFUN + BENCHFUN TMatrix wprof = ICCStore::getInstance()->workingSpaceMatrix("sRGB"); From a9e2bde610dfcbbc641677445b88e9c99866f3dd Mon Sep 17 00:00:00 2001 From: Ingo Weyrich Date: Fri, 28 Feb 2020 11:44:25 +0100 Subject: [PATCH 10/13] use autold instead of auto, #5676 --- rtengine/improccoordinator.cc | 2 +- rtengine/rtthumbnail.cc | 2 +- rtgui/thumbnail.cc | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/rtengine/improccoordinator.cc b/rtengine/improccoordinator.cc index 6c9105036..795bcaabb 100644 --- a/rtengine/improccoordinator.cc +++ b/rtengine/improccoordinator.cc @@ -1584,7 +1584,7 @@ void ImProcCoordinator::saveInputICCReference(const Glib::ustring& fname, bool a if (params->wb.method == "Camera") { currWB = imgsrc->getWB(); - } else if (params->wb.method == "Auto") { + } else if (params->wb.method == "autold") { if (lastAwbEqual != params->wb.equal || lastAwbTempBias != params->wb.tempBias) { double rm, gm, bm; imgsrc->getAutoWBMultipliers(rm, gm, bm); diff --git a/rtengine/rtthumbnail.cc b/rtengine/rtthumbnail.cc index 4507f2b40..a063d965b 100644 --- a/rtengine/rtthumbnail.cc +++ b/rtengine/rtthumbnail.cc @@ -1130,7 +1130,7 @@ IImage8* Thumbnail::processImage (const procparams::ProcParams& params, eSensorT double cam_g = colorMatrix[1][0] * camwbRed + colorMatrix[1][1] * camwbGreen + colorMatrix[1][2] * camwbBlue; double cam_b = colorMatrix[2][0] * camwbRed + colorMatrix[2][1] * camwbGreen + colorMatrix[2][2] * camwbBlue; currWB = ColorTemp (cam_r, cam_g, cam_b, params.wb.equal); - } else if (params.wb.method == "Auto") { + } else if (params.wb.method == "autold") { currWB = ColorTemp (autoWBTemp, autoWBGreen, wbEqual, "Custom"); } diff --git a/rtgui/thumbnail.cc b/rtgui/thumbnail.cc index 87bc730eb..7452c9d72 100644 --- a/rtgui/thumbnail.cc +++ b/rtgui/thumbnail.cc @@ -216,7 +216,7 @@ const ProcParams& Thumbnail::getProcParamsU () double ct; getCamWB (ct, pparams->wb.green); pparams->wb.temperature = ct; - } else if (pparams->wb.method == "Auto") { + } else if (pparams->wb.method == "autold") { double ct; getAutoWB (ct, pparams->wb.green, pparams->wb.equal, pparams->wb.tempBias); pparams->wb.temperature = ct; From 77be7605d80ffd85aea48fb3191e4fa28ffbb87f Mon Sep 17 00:00:00 2001 From: Ingo Weyrich Date: Fri, 28 Feb 2020 12:02:38 +0100 Subject: [PATCH 11/13] "Auto" => "autold", #5676 --- rtengine/simpleprocess.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rtengine/simpleprocess.cc b/rtengine/simpleprocess.cc index 779f2b33d..8fdfefdd7 100644 --- a/rtengine/simpleprocess.cc +++ b/rtengine/simpleprocess.cc @@ -276,7 +276,7 @@ private: currWB = ColorTemp(); } else if (params.wb.method == "Camera") { currWB = imgsrc->getWB(); - } else if (params.wb.method == "Auto") { + } else if (params.wb.method == "autold") { double rm, gm, bm; imgsrc->getAutoWBMultipliers(rm, gm, bm); currWB.update(rm, gm, bm, params.wb.equal, params.wb.tempBias); From c7c1dec9cbe63016ceb54b1d181fc467b4201d85 Mon Sep 17 00:00:00 2001 From: Ingo Weyrich Date: Fri, 28 Feb 2020 13:19:10 +0100 Subject: [PATCH 12/13] whitebalance : fix bug in changing method, #5676 --- rtgui/whitebalance.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rtgui/whitebalance.cc b/rtgui/whitebalance.cc index 9a5f1a398..5d1c907df 100644 --- a/rtgui/whitebalance.cc +++ b/rtgui/whitebalance.cc @@ -897,7 +897,7 @@ int WhiteBalance::_setActiveMethod(Glib::ustring &label, Gtk::TreeModel::Childre if (row[methodColumns.colLabel] == label) { method->set_active(iter); - found = method->get_active_row_number(); + found = row[methodColumns.colId]; } if (found != -1) { From fbe718b64f0fac722ec665b74c7b1434abae8818 Mon Sep 17 00:00:00 2001 From: Benitoite Date: Fri, 28 Feb 2020 10:20:40 -0800 Subject: [PATCH 13/13] fixes macOS autobuild (#5674) * update macOS autobuild yaml * updates */CMakeLists* for macOS autobuild compatibility * "" a dir for cmake * Un empty an empty EXTRA_INCDIR * use a cmake operator * Use the . dir to un-empty a string * fix minutes timer in macos yaml * test & skip instead of load & include * disregard fractional part of minutes in mac yaml * add another cmake test * fix typo in mac yaml * fix other part of same typo * correct a filename in mac yaml * test all include dirs * fix of mac yaml * mac:fix a path in yaml * mac:and its antecedent * options.h include a dir * test __has_include (gcc 5.* & up & clang) * remove a printf() in mac yaml * mac:change a "" and an elseif() to else() * fix a whitespace error * fix 2 whitespace errors * ZULU>UTC * add a "UTC * on the other side of the " * mac:properly set default LOCAL_PREFIX in CACHE * use of zsh subshells in macos yaml * mac:remove some && * mac:remove some " * mac:floating point divisors * mac:use double paren (()) * mac:add a dir * mac:floatize with decimal point * mac:zsh -c certain lines * remove a marker --- .github/workflows/main.yml | 107 +++++++++++++++++++++---------------- AboutThisBuild.txt.in | 2 +- CMakeLists.txt | 64 +++++++++++++--------- UpdateInfo.cmake | 27 +++++----- rtdata/CMakeLists.txt | 18 +++---- rtengine/CMakeLists.txt | 81 ++++++++++++++++++---------- rtexif/CMakeLists.txt | 6 +-- rtgui/CMakeLists.txt | 18 +++---- rtgui/options.h | 5 ++ tools/osx/macosx_bundle.sh | 1 + 10 files changed, 193 insertions(+), 136 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 13aa6677a..e483ace01 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,81 +1,96 @@ name: macOS build on: push: - branches-ignore: - - '**' + branches: + - dev + - patch** + - newlocallab + pull_request: + branches: + - dev + - newlocallab + release: + types: + - created jobs: build: - runs-on: macos-latest + runs-on: macos-10.15 steps: - uses: actions/checkout@v1 - name: Install dependencies - run: > - brew install gtk+3 gtkmm3 gtk-mac-integration adwaita-icon-theme - libsigc++ little-cms2 libiptcdata fftw lensfun llvm expat pkgconfig - libomp shared-mime-info - - name: patch libiconv run: | - mkdir libiconv && cd libiconv - wget https://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.16.tar.gz - tar xf libiconv-1.16.tar.gz - cd libiconv-1.16 - patch -p1 < "${GITHUB_WORKSPACE}/tools/osx/libiconv_1.16_rt.patch" - mkdir build && cd build - destDir="$(pwd)" - ../configure --prefix=/opt/local --disable-static \ - CFLAGS='-arch x86_64 -mmacosx-version-min=10.9' \ - LDFLAGS='-arch x86_64 -mmacosx-version-min=10.9' \ - CXXFLAGS='-arch x86_64 -mmacosx-version-min=10.9' - make --jobs - make DESTDIR="${destDir}" install - sudo mv opt/local /usr/local/opt/libiconv - - name: cmake + date -u + mkdir build + date +%s > build/stamp + brew uninstall --ignore-dependencies libtiff + brew install libtiff gtk+3 gtkmm3 gtk-mac-integration adwaita-icon-theme libsigc++ little-cms2 libiptcdata fftw lensfun expat pkgconfig libomp shared-mime-info | tee -a depslog + date -u + echo "----====Pourage====----" + cat depslog | grep Pouring + zsh -c 'echo "Completed installation of dependencies in $(printf "%0.2f" $(($[$(date +%s)-$(cat build/stamp)]/$((60.))))) minutes"' + - name: Configure build system env: CMAKE_CXX_STANDARD: 11 - PKG_CONFIG_PATH: /usr/local/opt/libffi/lib/pkgconfig:/usr/local/opt/expat/lib/pkgconfig + PKG_CONFIG_PATH: /usr/local/opt/libtiff/lib/pkgconfig:/usr/local/opt/libffi/lib/pkgconfig:/usr/local/opt/expat/lib/pkgconfig RAW_THERAPEE_MAJOR: '5' RAW_THERAPEE_MINOR: '8' C_FLAGS: > - -Xpreprocessor -fopenmp /usr/local/lib/libomp.dylib - -I/usr/local/include -I/usr/local/opt/gdk-pixbuf/include - -I/usr/local/opt/libiconv/include -I/usr/local/opt/libxml2/include - -I/usr/local/opt/expat/include -I/usr/local/opt/llvm/include + -arch x86_64 -mtune=generic -Xpreprocessor -fopenmp /usr/local/lib/libomp.dylib -I/usr/local/include -I/usr/local/opt/gdk-pixbuf/include -I/usr/local/opt/libiconv/include -I/usr/local/opt/libxml2/include -I/usr/local/opt/expat/include -I/usr/local/opt/libtiff/include run: | # GITHUB_REF is the ref that triggered the build, like # refs/heads/new-feature - the next line parses that to REF: the branch # name only (new-feature) - REF=${GITHUB_REF##*/} - mkdir build && cd build + export REF=${GITHUB_REF##*/} + export C_FLAGS=$(echo -e $C_FLAGS | tr -d '\n') + cd build && date -u && date +%s > configstamp cmake \ - -DCMAKE_BUILD_TYPE="release" \ + -DCMAKE_BUILD_TYPE="Release" \ -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \ - -DCMAKE_EXE_LINKER_FLAGS="-L/usr/local/lib -L/usr/local/opt/llvm/lib -Wl,-rpath,/usr/local/opt/llvm/lib -L/usr/local/opt/gdk-pixbuf/lib -L/usr/local/opt/libiconv/lib -L/usr/local/opt/libffi/lib -L/usr/local/opt/libffi/lib -L/usr/local/opt/libxml2/lib -L/usr/local/opt/expat/lib" \ + -DCMAKE_EXE_LINKER_FLAGS="-L. -L/usr/local/lib -Wl,-rpath -Wl,/usr/local/lib -L/usr/local/opt/gdk-pixbuf/lib -L/usr/local/opt/libiconv/lib -L/usr/local/opt/libffi/lib -L/usr/local/opt/libffi/lib -L/usr/local/opt/libxml2/lib -L/usr/local/opt/expat/lib" \ -DCACHE_NAME_SUFFIX="${RAW_THERAPEE_MAJOR}.${RAW_THERAPEE_MINOR}-${REF}" \ - -DPROC_TARGET_NUMBER="2" \ + -DPROC_TARGET_NUMBER="1" \ -DPROC_LABEL="generic processor" \ -DWITH_LTO="OFF" \ - -DLENSFUNDBDIR="./share/lensfun" \ - -DOpenMP_C_FLAGS=-fopenmp=libomp \ - -DOpenMP_CXX_FLAGS=-fopenmp=libomp \ - -DOpenMP_C_LIB_NAMES="libomp" \ - -DOpenMP_CXX_LIB_NAMES="libomp" \ - -DOpenMP_libomp_LIBRARY="/usr/local/lib/libomp.dylib" \ + -DLENSFUNDBDIR="/Applications/RawTherapee.app/Contents/Resources/share/lensfun" \ + -DCMAKE_C_COMPILER=/usr/local/opt/llvm/bin/clang \ + -DCMAKE_CXX_COMPILER=/usr/local/opt/llvm/bin/clang++ \ + -DCMAKE_C_FLAGS="-arch x86_64 -Wno-pass-failed -Wno-deprecated-register -Wno-unused-command-line-argument" \ + -DCMAKE_CXX_FLAGS="-arch x86_64 -Wno-pass-failed -Wno-deprecated-register -Wno-unused-command-line-argument" \ -DOpenMP_C_FLAGS="${C_FLAGS}" \ -DOpenMP_CXX_FLAGS="${C_FLAGS}" \ - -DCMAKE_AR="/usr/local/opt/llvm/bin/llvm-ar" \ - -DCMAKE_RANLIB="/usr/local/opt/llvm/bin/llvm-ranlib" \ - -DCMAKE_OSX_DEPLOYMENT_TARGET="10.11" \ + -DOpenMP_C_LIB_NAMES=libomp \ + -DOpenMP_CXX_LIB_NAMES=libomp \ + -DOpenMP_libomp_LIBRARY=/usr/local/lib/libomp.dylib \ + -DCMAKE_AR=/usr/bin/ar \ + -DCMAKE_RANLIB=/usr/bin/ranlib \ + -DCMAKE_OSX_DEPLOYMENT_TARGET=10.15 \ .. - make --jobs - make install - sudo make macosx_bundle - ARTIFACT=(RawTherapee*.zip) + zsh -c 'echo "Configured in $(printf "%0.2f" $(($[$(date +%s)-$(cat configstamp)]/$((60.))))) minutes"' + - name: Compile RawTherapee + run: | + date -u && date +%s > build/compilestamp + cd build + export REF=${GITHUB_REF##*/} + make -j$(sysctl -a | grep machdep.cpu.thread_count | tail -c 2) install + zsh -c 'echo "Compiled in $(printf "%0.2f" $(($[$(date +%s)-$(cat compilestamp)]/$((60.))))) minutes"' + - name: Create application bundle + run: | + zsh + date +%s > build/bundlestamp && date -u && cd build + export REF=${GITHUB_REF##*/} && export LOCAL_PREFIX=/usr && sudo make macosx_bundle + export ARTIFACT=(RawTherapee*.zip) echo "=== artifact: ${ARTIFACT}" # defining environment variables for next step as per # https://github.com/actions/starter-workflows/issues/68 echo "::set-env name=ARTIFACT_PATH::${GITHUB_WORKSPACE}/build/${ARTIFACT}" echo "::set-env name=ARTIFACT_FILE::${ARTIFACT}" + zsh -c 'echo "Bundled in $(printf "%0.2f" $(($[$(date +%s)-$(cat bundlestamp)]/$((60.))))) minutes"' + exit - uses: actions/upload-artifact@v1 with: name: ${{env.ARTIFACT_FILE}} path: ${{env.ARTIFACT_PATH}} + - name: Finish build + run: | + date -u + zsh -c 'echo "Build completed in $(printf "%0.2f" $(($[$(date +%s)-$(cat build/stamp)]/$((60.))))) minutes"' diff --git a/AboutThisBuild.txt.in b/AboutThisBuild.txt.in index 06f628187..4d8f4f3fe 100644 --- a/AboutThisBuild.txt.in +++ b/AboutThisBuild.txt.in @@ -14,6 +14,6 @@ Link flags: ${LFLAGS} OpenMP support: ${OPTION_OMP} MMAP support: ${WITH_MYFILE_MMAP} Build OS: ${BUILDINFO_OS} -Build date: ${BUILDINFO_DATE} ZULU +Build date: ${BUILDINFO_DATE} UTC Build epoch: ${BUILDINFO_EPOCH} Build UUID: ${BUILDINFO_UUID} diff --git a/CMakeLists.txt b/CMakeLists.txt index 5998ccb50..e3ae3b7ff 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,8 +1,14 @@ -cmake_minimum_required(VERSION 3.5) +# Use of SOURCE_DIR target property begins at cmake 3.7 +if(APPLE) + cmake_minimum_required(VERSION 3.7) +else() + cmake_minimum_required(VERSION 3.5) +endif() # Compiler id for Apple Clang if(APPLE) cmake_policy(SET CMP0025 NEW) + cmake_policy(SET CMP0037 NEW) endif() # Must stay before the project() command: @@ -145,7 +151,7 @@ if(WIN32) CACHE STRING "Additional search paths") endif() -if(APPLE) +if(APPLE) # TODO make -mtune generic conditional and/or specifiable. if(CMAKE_CXX_COMPILER MATCHES "g\\+\\+-mp-4.[5-8]" OR CMAKE_CXX_COMPILER_ARG1 MATCHES "g\\+\\+-mp-4.[5-8]") set(CMAKE_EXE_LINKER_FLAGS @@ -210,7 +216,7 @@ endif() if(NOT DEFINED BUNDLE_BASE_INSTALL_DIR) if(APPLE) - set(BUNDLE_BASE_INSTALL_DIR "${CMAKE_BUILD_TYPE}/MacOS") + set(BUNDLE_BASE_INSTALL_DIR "${PROJECT_SOURCE_DIR}/build/${CMAKE_BUILD_TYPE}/MacOS") else() set(BUNDLE_BASE_INSTALL_DIR "${CMAKE_BINARY_DIR}/${CMAKE_BUILD_TYPE}") endif() @@ -219,7 +225,7 @@ endif() if(BUILD_BUNDLE) if(APPLE) set(BINDIR "${BUNDLE_BASE_INSTALL_DIR}") - set(CMAKE_INSTALL_PREFIX ".") + set(CMAKE_INSTALL_PREFIX "${PROJECT_SOURCE_DIR}/build") else() set(BINDIR .) set(CMAKE_INSTALL_PREFIX "${BUNDLE_BASE_INSTALL_DIR}") @@ -233,7 +239,7 @@ endif() if(NOT DEFINED DATADIR) if(BUILD_BUNDLE) if(APPLE) - set(DATADIR "${CMAKE_BUILD_TYPE}/Resources/share") + set(DATADIR "${PROJECT_SOURCE_DIR}/build/${CMAKE_BUILD_TYPE}/Resources/share") else() set(DATADIR .) endif() @@ -245,7 +251,7 @@ endif() if(NOT DEFINED LIBDIR) if(BUILD_BUNDLE) if(APPLE) - set(LIBDIR "${CMAKE_BUILD_TYPE}/Frameworks") + set(LIBDIR "${PROJECT_SOURCE_DIR}/build/${CMAKE_BUILD_TYPE}/Frameworks") else() set(LIBDIR .) endif() @@ -362,8 +368,10 @@ if(APPLE) set(LOCAL_PREFIX "${LOCAL_PREFIX}" CACHE STRING "macos/gtk parent directory ie /usr or /opt") - elseif(NOT DEFINED LOCAL_PREFIX) - set(LOCAL_PREFIX "/usr") + else() + set(LOCAL_PREFIX + /usr + CACHE STRING "macos/gtk parent directory ie /usr or /opt") endif() if("${FANCY_DMG}") set(FANCY_DMG @@ -612,12 +620,10 @@ else() set(PROC_BIT_DEPTH 64 bits) endif() -# Get compiler name and version. Only CMake > 2.8.7 knows -# CMAKE_*_COMPILER_VERSION -if(CMAKE_VERSION VERSION_GREATER 2.8.7) +# Get compiler name and version. get_filename_component(COMPILER_INFO ${CMAKE_C_COMPILER} NAME_WE) set(COMPILER_INFO "${COMPILER_INFO} ${CMAKE_C_COMPILER_VERSION}") -else() +if(NOT APPLE) execute_process( COMMAND gcc -dumpversion OUTPUT_VARIABLE GCC_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE) @@ -633,15 +639,18 @@ set(LFLAGS "${CMAKE_EXE_LINKER_FLAGS} ${CMAKE_EXE_LINKER_FLAGS_${UPPER_CMAKE_BUILD_TYPE}}" ) -set(ABOUT_COMMAND_WITH_ARGS - ${CMAKE_COMMAND} -DPROJECT_SOURCE_DIR:STRING=${PROJECT_SOURCE_DIR} - -DCACHE_NAME_SUFFIX:STRING=${CACHE_NAME_SUFFIX} - -DPROC_LABEL:STRING="${PROC_LABEL}" - -DPROC_BIT_DEPTH:STRING="${PROC_BIT_DEPTH}" - -DBUILD_TYPE:STRING=${CMAKE_BUILD_TYPE} - -DGTKMM_VERSION:STRING=${GTKMM_VERSION} -DOPTION_OMP:STRING=${OPTION_OMP} - -DWITH_MYFILE_MMAP:STRING=${WITH_MYFILE_MMAP} - -DLENSFUN_VERSION:STRING=${LENSFUN_VERSION}) +if(NOT APPLE) + set(ABOUT_COMMAND_WITH_ARGS + ${CMAKE_COMMAND} -DPROJECT_SOURCE_DIR:STRING=${PROJECT_SOURCE_DIR} + -DCACHE_NAME_SUFFIX:STRING=${CACHE_NAME_SUFFIX} + -DPROC_LABEL:STRING="${PROC_LABEL}" + -DPROC_BIT_DEPTH:STRING="${PROC_BIT_DEPTH}" + -DBUILD_TYPE:STRING=${CMAKE_BUILD_TYPE} + -DGTKMM_VERSION:STRING=${GTKMM_VERSION} + -DOPTION_OMP:STRING=${OPTION_OMP} + -DWITH_MYFILE_MMAP:STRING=${WITH_MYFILE_MMAP} + -DLENSFUN_VERSION:STRING=${LENSFUN_VERSION}) +endif() if(WIN32) list( @@ -654,16 +663,19 @@ if(WIN32) -DCMAKE_INSTALL_PREFIX:STRING="${CMAKE_INSTALL_PREFIX}" -DBIT_DEPTH:STRING="${CMAKE_SIZEOF_VOID_P}") elseif(APPLE) - list(APPEND ABOUT_COMMAND_WITH_ARGS -DSYSTEM:STRING=Apple - -DCXX_FLAGS:STRING=${CXX_FLAGS} -DLFLAGS:STRING=${LFLAGS} - -DCOMPILER_INFO:STRING=${COMPILER_INFO}) + set( + ABOUT_COMMAND_WITH_ARGS + cmake -DPROJECT_SOURCE_DIR:STRING=${PROJECT_SOURCE_DIR} -P ${PROJECT_SOURCE_DIR}/UpdateInfo.cmake -DSYSTEM:STRING=Apple -DCXX_FLAGS:STRING=${CXX_FLAGS} -DLFLAGS:STRING=${LFLAGS} -DCOMPILER_INFO:STRING=${COMPILER_INFO} -DCACHE_NAME_SUFFIX:STRING=${CACHE_NAME_SUFFIX}) else() list(APPEND ABOUT_COMMAND_WITH_ARGS -DSYSTEM:STRING=Linux -DCXX_FLAGS:STRING=${CXX_FLAGS} -DLFLAGS:STRING=${LFLAGS} -DCOMPILER_INFO:STRING=${COMPILER_INFO}) endif() - -list(APPEND ABOUT_COMMAND_WITH_ARGS -P "${PROJECT_SOURCE_DIR}/UpdateInfo.cmake") +if(NOT APPLE) + list(APPEND + ABOUT_COMMAND_WITH_ARGS + -P "${PROJECT_SOURCE_DIR}/UpdateInfo.cmake") +endif() add_custom_target( UpdateInfo ALL diff --git a/UpdateInfo.cmake b/UpdateInfo.cmake index 6fa8e289c..473c68364 100644 --- a/UpdateInfo.cmake +++ b/UpdateInfo.cmake @@ -1,5 +1,9 @@ # cmakefile executed within a makefile target +if(APPLE) + set(PROJECT_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/..") +endif() + # If we find ReleaseInfo.cmake we use the info from there and don't need Git to be installed find_file(REL_INFO_FILE ReleaseInfo.cmake PATHS "${PROJECT_SOURCE_DIR}" NO_DEFAULT_PATH) if(REL_INFO_FILE STREQUAL REL_INFO_FILE-NOTFOUND) @@ -68,20 +72,19 @@ if(REL_INFO_FILE STREQUAL REL_INFO_FILE-NOTFOUND) execute_process(COMMAND date -Ru OUTPUT_VARIABLE BUILDINFO_DATE OUTPUT_STRIP_TRAILING_WHITESPACE) execute_process(COMMAND date +%s OUTPUT_VARIABLE BUILDINFO_EPOCH OUTPUT_STRIP_TRAILING_WHITESPACE) execute_process(COMMAND uuidgen COMMAND tr "A-Z" "a-z" OUTPUT_VARIABLE BUILDINFO_UUID OUTPUT_STRIP_TRAILING_WHITESPACE) - message(STATUS "Git checkout information:") - message(STATUS " Commit description: ${GIT_DESCRIBE}") - message(STATUS " Branch: ${GIT_BRANCH}") - message(STATUS " Commit: ${GIT_COMMIT}") - message(STATUS " Commit date: ${GIT_COMMIT_DATE}") - message(STATUS " Commits since tag: ${GIT_COMMITS_SINCE_TAG}") - message(STATUS " Commits since branch: ${GIT_COMMITS_SINCE_BRANCH}") - message(STATUS " Version (unreliable): ${GIT_NUMERIC_VERSION_BS}") + message(STATUS " Commit description: ${GIT_DESCRIBE}") + message(STATUS " Branch: ${GIT_BRANCH}") + message(STATUS " Commit: ${GIT_COMMIT}") + message(STATUS " Commit date: ${GIT_COMMIT_DATE}") + message(STATUS " Commits since tag: ${GIT_COMMITS_SINCE_TAG}") + message(STATUS " Commits since branch: ${GIT_COMMITS_SINCE_BRANCH}") + message(STATUS " Version (unreliable): ${GIT_NUMERIC_VERSION_BS}") message(STATUS "Build information:") - message(STATUS " Build OS: ${BUILDINFO_OS}") - message(STATUS " Build date: ${BUILDINFO_DATE}") - message(STATUS " Epoch: ${BUILDINFO_EPOCH}") - message(STATUS " UUID: ${BUILDINFO_UUID}") + message(STATUS " Build OS: ${BUILDINFO_OS}") + message(STATUS " Build date: ${BUILDINFO_DATE} UTC") + message(STATUS " Epoch: ${BUILDINFO_EPOCH}") + message(STATUS " UUID: ${BUILDINFO_UUID}") if(NOT DEFINED CACHE_NAME_SUFFIX) set(CACHE_NAME_SUFFIX "${GIT_DESCRIBE}") diff --git a/rtdata/CMakeLists.txt b/rtdata/CMakeLists.txt index 76804c0f0..00a32c0cc 100644 --- a/rtdata/CMakeLists.txt +++ b/rtdata/CMakeLists.txt @@ -47,8 +47,8 @@ if(WIN32) install(FILES ${FONTS} DESTINATION "${DATADIR}/fonts") endif() -install(DIRECTORY ${PROFILESDIR} DESTINATION "${DATADIR}" FILES_MATCHING PATTERN "*.pp3") -install(DIRECTORY ${THEMEDIR} DESTINATION "${DATADIR}") +install(DIRECTORY "${PROFILESDIR}" DESTINATION "${DATADIR}" FILES_MATCHING PATTERN "*.pp3") +install(DIRECTORY "${THEMEDIR}" DESTINATION "${DATADIR}") install(FILES ${IMG_SVG} DESTINATION "${DATADIR}/images") install(FILES ${IMG_PNG} DESTINATION "${DATADIR}/images") @@ -57,19 +57,15 @@ install(FILES ${IMG_ICO} DESTINATION "${DATADIR}/images") if(APPLE) # CMake escapes first item quote character. Do not remove 'DUMMY_VARIABLE=' set(MACOSX_BUNDLE_COMMAND DUMMY_VARIABLE= - PROJECT_NAME="${PROJECT_NAME}" + PROJECT_NAME=${PROJECT_NAME} PROJECT_SOURCE_DIR="${PROJECT_SOURCE_DIR}" - CMAKE_BUILD_TYPE="${CMAKE_BUILD_TYPE}" + CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} GTK_PREFIX="${GTK_PREFIX}") - if(PROC_BIT_DEPTH MATCHES 32) - list(APPEND MACOSX_BUNDLE_COMMAND PROC_BIT_DEPTH=32) - else() - list(APPEND MACOSX_BUNDLE_COMMAND PROC_BIT_DEPTH=64) - endif() - list(APPEND MACOSX_BUNDLE_COMMAND sh "${PROJECT_SOURCE_DIR}/tools/osx/macosx_bundle.sh") + list(APPEND MACOSX_BUNDLE_COMMAND PROC_BIT_DEPTH=64) + list(APPEND MACOSX_BUNDLE_COMMAND sh ${PROJECT_SOURCE_DIR}/tools/osx/macosx_bundle.sh) add_custom_target(macosx_bundle COMMAND ${MACOSX_BUNDLE_COMMAND} - WORKING_DIRECTORY "${CMAKE_BINARY_DIR}" + WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/build COMMENT "Creating macOS bundle") endif() diff --git a/rtengine/CMakeLists.txt b/rtengine/CMakeLists.txt index 5f59da371..3813c5708 100644 --- a/rtengine/CMakeLists.txt +++ b/rtengine/CMakeLists.txt @@ -1,35 +1,60 @@ -include_directories(${EXTRA_INCDIR} - ${EXPAT_INCLUDE_DIRS} - ${FFTW3F_INCLUDE_DIRS} - ${GLIB2_INCLUDE_DIRS} - ${GLIBMM_INCLUDE_DIRS} - ${GOBJECT_INCLUDE_DIRS} - ${GTHREAD_INCLUDE_DIRS} - ${GTKMM_INCLUDE_DIRS} - ${GTK_INCLUDE_DIRS} - ${IPTCDATA_INCLUDE_DIRS} - ${LCMS_INCLUDE_DIRS} - ${LENSFUN_INCLUDE_DIRS} - ${RSVG_INCLUDE_DIRS} -) +if(EXTRA_INCDIR) + include_directories("${EXTRA_INCDIR}") +endif() +if(EXPAT_INCLUDE_DIRS) + include_directories("${EXPAT_INCLUDE_DIRS}") +endif() +if(FFTW3F_INCLUDE_DIRS) + include_directories("${FFTW3F_INCLUDE_DIRS}") +endif() +if(GLIB2_INCLUDE_DIRS) + include_directories("${GLIB2_INCLUDE_DIRS}") +endif() +if(GLIBMM_INCLUDE_DIRS) + include_directories("${GLIBMM_INCLUDE_DIRS}") +endif() +if(GOBJECT_INCLUDE_DIRS) + include_directories("${GOBJECT_INCLUDE_DIRS}") +endif() +if(GTHREAD_INCLUDE_DIRS) + include_directories("${GTHREAD_INCLUDE_DIRS}") +endif() +if(GTKMM_INCLUDE_DIRS) + include_directories("${GTKMM_INCLUDE_DIRS}") +endif() +if(GTK_INCLUDE_DIRS) + include_directories("${GTK_INCLUDE_DIRS}") +endif() +if(IPTCDATA_INCLUDE_DIRS) + include_directories("${IPTCDATA_INCLUDE_DIRS}") +endif() +if(LCMS_INCLUDE_DIRS) + include_directories("${LCMS_INCLUDE_DIRS}") +endif() +if(LENSFUN_INCLUDE_DIRS) + include_directories("${LENSFUN_INCLUDE_DIRS}") +endif() +if(RSVG_INCLUDE_DIRS) + include_directories("${RSVG_INCLUDE_DIRS}") +endif() if(NOT WITH_SYSTEM_KLT) include_directories("${CMAKE_SOURCE_DIR}/rtengine/klt") else() - include_directories(${KLT_INCLUDE_DIRS}) + include_directories("${KLT_INCLUDE_DIRS}") endif() link_directories("${PROJECT_SOURCE_DIR}/rtexif" - ${EXPAT_LIBRARY_DIRS} - ${EXTRA_LIBDIR} - ${FFTW3F_LIBRARY_DIRS} - ${GLIB2_LIBRARY_DIRS} - ${GLIBMM_LIBRARY_DIRS} - ${GOBJECT_LIBRARY_DIRS} - ${GTHREAD_LIBRARY_DIRS} - ${IPTCDATA_LIBRARY_DIRS} - ${LCMS_LIBRARY_DIRS} - ${LENSFUN_LIBRARY_DIRS} - ${RSVG_LIBRARY_DIRS} + "${EXPAT_LIBRARY_DIRS}" + "${EXTRA_LIBDIR}" + "${FFTW3F_LIBRARY_DIRS}" + "${GLIB2_LIBRARY_DIRS}" + "${GLIBMM_LIBRARY_DIRS}" + "${GOBJECT_LIBRARY_DIRS}" + "${GTHREAD_LIBRARY_DIRS}" + "${IPTCDATA_LIBRARY_DIRS}" + "${LCMS_LIBRARY_DIRS}" + "${LENSFUN_LIBRARY_DIRS}" + "${RSVG_LIBRARY_DIRS}" ) set(CAMCONSTSFILE "camconst.json") @@ -165,13 +190,13 @@ endif() include_directories(BEFORE "${CMAKE_CURRENT_BINARY_DIR}") -add_library(rtengine STATIC ${RTENGINESOURCEFILES}) +add_library(rtengine STATIC "${RTENGINESOURCEFILES}") add_dependencies(rtengine UpdateInfo) # It may be nice to store library version too if(BUILD_SHARED_LIBS) - install(TARGETS rtengine DESTINATION ${LIBDIR}) + install(TARGETS rtengine DESTINATION "${LIBDIR}") endif() set_target_properties(rtengine PROPERTIES COMPILE_FLAGS "${RTENGINE_CXX_FLAGS}") diff --git a/rtexif/CMakeLists.txt b/rtexif/CMakeLists.txt index 5a3831455..836f832e2 100644 --- a/rtexif/CMakeLists.txt +++ b/rtexif/CMakeLists.txt @@ -18,12 +18,12 @@ if(WIN32) link_directories(. "${PROJECT_SOURCE_DIR}/rtexif" ${EXTRA_LIBDIR} ${GLIB2_LIBRARY_DIRS} ${GLIBMM_LIBRARY_DIRS} ${GTK_LIBRARY_DIRS} ${GTKMM_LIBRARY_DIRS} ${LENSFUN_LIBRARY_DIRS}) else() set_target_properties(rtexif PROPERTIES COMPILE_FLAGS " -fPIC") - include_directories(${EXTRA_INCDIR} ${GLIB2_INCLUDE_DIRS} ${GLIBMM_INCLUDE_DIRS} ${GTK_INCLUDE_DIRS} ${GTKMM_INCLUDE_DIRS}) - link_directories(${EXTRA_LIBDIR} ${GLIB2_LIBRARY_DIRS} ${GLIBMM_LIBRARY_DIRS} ${GTK_LIBRARY_DIRS} ${GTKMM_LIBRARY_DIRS} ${LENSFUN_LIBRARY_DIRS}) + include_directories("${EXTRA_INCDIR} ${GLIB2_INCLUDE_DIRS} ${GLIBMM_INCLUDE_DIRS} ${GTK_INCLUDE_DIRS} ${GTKMM_INCLUDE_DIRS}") + link_directories("${EXTRA_LIBDIR} ${GLIB2_LIBRARY_DIRS} ${GLIBMM_LIBRARY_DIRS} ${GTK_LIBRARY_DIRS} ${GTKMM_LIBRARY_DIRS} ${LENSFUN_LIBRARY_DIRS}") endif() include_directories(BEFORE "${CMAKE_CURRENT_BINARY_DIR}") if(BUILD_SHARED_LIBS) - install(TARGETS rtexif DESTINATION ${LIBDIR}) + install(TARGETS rtexif DESTINATION "${LIBDIR}") endif() diff --git a/rtgui/CMakeLists.txt b/rtgui/CMakeLists.txt index 4b21ce421..828151338 100644 --- a/rtgui/CMakeLists.txt +++ b/rtgui/CMakeLists.txt @@ -164,13 +164,13 @@ set(NONCLISOURCEFILES zoompanel.cc ) -include_directories(BEFORE "${CMAKE_CURRENT_BINARY_DIR}") +include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR}) if(APPLE) find_package(MacIntegration REQUIRED) # At the time of writing CMake has no module finder for gtkmacintegration so here we have it hard-coded, if installed via macports it should be in /opt/local/... - set(EXTRA_LIB_RTGUI ${MacIntegration_LIBRARIES}) - set(EXTRA_INCDIR ${EXTRA_INCDIR} ${MacIntegration_INCLUDE_DIRS}) + set(EXTRA_LIB_RTGUI "${MacIntegration_LIBRARIES}") + set(EXTRA_INCDIR "${EXTRA_INCDIR}" "${MacIntegration_INCLUDE_DIRS}") endif() if(WIN32) @@ -236,16 +236,16 @@ else() endif() # Excluding libatomic needed by Clang/FreeBSD, #3636 -if(OPENMP_FOUND AND NOT APPLE AND NOT "${CMAKE_SYSTEM_NAME}" STREQUAL "FreeBSD") - set(EXTRA_LIB_RTGUI ${EXTRA_LIB_RTGUI} "atomic") +if(OPENMP_FOUND AND NOT APPLE AND NOT ${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD") + set(EXTRA_LIB_RTGUI "${EXTRA_LIB_RTGUI}" "atomic") endif() # Create config.h which defines where data are stored configure_file("${CMAKE_CURRENT_SOURCE_DIR}/config.h.in" "${CMAKE_CURRENT_BINARY_DIR}/config.h") # Create new executables targets -add_executable(rth ${EXTRA_SRC_NONCLI} ${NONCLISOURCEFILES}) -add_executable(rth-cli ${EXTRA_SRC_CLI} ${CLISOURCEFILES}) +add_executable(rth "${EXTRA_SRC_NONCLI}" "${NONCLISOURCEFILES}") +add_executable(rth-cli "${EXTRA_SRC_CLI}" "${CLISOURCEFILES}") # Add dependencies to executables targets add_dependencies(rth UpdateInfo) @@ -311,5 +311,5 @@ target_link_libraries(rth-cli rtengine ) # Install executables -install(TARGETS rth DESTINATION ${BINDIR}) -install(TARGETS rth-cli DESTINATION ${BINDIR}) +install(TARGETS rth DESTINATION "${BINDIR}") +install(TARGETS rth-cli DESTINATION "${BINDIR}") diff --git a/rtgui/options.h b/rtgui/options.h index c0ed2138b..0bc421300 100644 --- a/rtgui/options.h +++ b/rtgui/options.h @@ -20,7 +20,12 @@ #include #include +#if __has_include() #include +#else +#include +#endif + #include "../rtengine/settings.h" #include diff --git a/tools/osx/macosx_bundle.sh b/tools/osx/macosx_bundle.sh index 2352133a9..9258810c0 100644 --- a/tools/osx/macosx_bundle.sh +++ b/tools/osx/macosx_bundle.sh @@ -404,6 +404,7 @@ function CreateDmg { # Zip disk image for redistribution msg "Zipping disk image for redistribution:" + zip "${dmg_name}.zip" "${dmg_name}.dmg" rm "${dmg_name}.dmg" msg "Removing disk image caches:" rm -rf "${srcDir}"