From 701e3a3440295dfd13b2be8eaf2badee342a1dd3 Mon Sep 17 00:00:00 2001 From: Chris Mayo Date: Mon, 4 Jul 2016 20:42:54 +0100 Subject: [PATCH] check Boost version with qtCompileTest instead of dpkg Removes use of BOOST_INSTALLED and removes boostdetect.pri --- config.tests/boost/boost.pro | 1 + config.tests/boost/main.cpp | 8 +++++ phoenix.pro | 6 ++-- pri/boostdetect.pri | 58 ------------------------------------ pri/utils.pri | 25 ++++++++++++++++ 5 files changed, 36 insertions(+), 62 deletions(-) create mode 100644 config.tests/boost/boost.pro create mode 100644 config.tests/boost/main.cpp delete mode 100644 pri/boostdetect.pri diff --git a/config.tests/boost/boost.pro b/config.tests/boost/boost.pro new file mode 100644 index 000000000..bba41b9c1 --- /dev/null +++ b/config.tests/boost/boost.pro @@ -0,0 +1 @@ +SOURCES = main.cpp diff --git a/config.tests/boost/main.cpp b/config.tests/boost/main.cpp new file mode 100644 index 000000000..a245b7c86 --- /dev/null +++ b/config.tests/boost/main.cpp @@ -0,0 +1,8 @@ +#include +#if BOOST_VERSION / 100000 == 1 && BOOST_VERSION / 100 % 1000 == 54 +#error "Boost 1.54 found" +#endif + +int main() +{ +} diff --git a/phoenix.pro b/phoenix.pro index cff7b0b0f..26e25b586 100644 --- a/phoenix.pro +++ b/phoenix.pro @@ -36,6 +36,8 @@ unix:!macx { CONFIG += link_pkgconfig } +load(configure) + win32 { # release build using msvc 2010 needs to use Multi-threaded (/MT) for the code generation/runtime library option # release build using msvc 2010 needs to add msvcrt.lib;%(IgnoreSpecificDefaultLibraries) to the linker/no default libraries option @@ -196,10 +198,6 @@ include(pri/translations.pri) include(pri/program.pri) include(pri/qtsysteminfo.pri) -!contains(DEFINES, BOOST_INSTALLED) { - include(pri/boostdetect.pri) -} - contains(DEFINES, QUAZIP_INSTALLED) { INCLUDEPATH += /usr/include/quazip LIBS += -lquazip diff --git a/pri/boostdetect.pri b/pri/boostdetect.pri deleted file mode 100644 index 26367ebf1..000000000 --- a/pri/boostdetect.pri +++ /dev/null @@ -1,58 +0,0 @@ -# /******************************************************************* -# Part of the Fritzing project - http://fritzing.org -# Copyright (c) 2007-16 Fritzing -# Fritzing is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# Fritzing is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# You should have received a copy of the GNU General Public License -# along with Fritzing. If not, see . -# ******************************************************************** -# $Revision: 6796 $: -# $Author: irascibl@gmail.com $: -# $Date: 2013-01-12 07:45:08 +0100 (Sa, 12. Jan 2013) $ -# ********************************************************************/ - -# boost_1_54_0 is buggy -BOOSTS = 43 44 45 46 47 48 49 50 51 52 53 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 -LATESTBOOST = 0 -for(boost, BOOSTS) { - exists(../src/lib/boost_1_$${boost}_0) { - LATESTBOOST = $$boost - } -} - -contains(LATESTBOOST, 0) { - unix { - !macx { - BOOSTINFO = $$system(dpkg -s libboost-dev | grep 'Version') - BADVERSION = $$find(BOOSTINFO, 1\.54) - !isEmpty(BADVERSION) { - message("Boost 1.54 has a bug in a function that Fritzing uses, so download or install some other version") - error("Easiest to copy the boost library to .../src/lib/, so that you have .../src/lib/boost_1_xx_0") - } - isEmpty(BADVERSION) { - BOOSTVERSION = $$find(BOOSTINFO, 1\...\.0) - !isEmpty(BOOSTVERSION) { - LATESTBOOST = installed - message("using installed BOOST library") - } - } - } - } -} - -contains(LATESTBOOST, 0) { - message("Please download the boost library--you can find it at http://www.boost.org/") - message("Note that boost 1.54 has a bug in a function that Fritzing uses, so download some other version") - error("Copy the boost library to .../src/lib/, so that you have .../src/lib/boost_1_xx_0") -} - -!contains(LATESTBOOST, installed) { - message("using boost from src/lib/boost_1_$${LATESTBOOST}_0") - INCLUDEPATH += src/lib/boost_1_$${LATESTBOOST}_0 -} diff --git a/pri/utils.pri b/pri/utils.pri index 3cd708263..210570f25 100644 --- a/pri/utils.pri +++ b/pri/utils.pri @@ -17,6 +17,31 @@ # $Date: 2013-01-12 07:45:08 +0100 (Sa, 12. Jan 2013) $ # ********************************************************************/ +# boost_1_54_0 is buggy +BOOSTS = 43 44 45 46 47 48 49 50 51 52 53 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 +LATESTBOOST = 0 +for(boost, BOOSTS) { + exists(../src/lib/boost_1_$${boost}_0) { + LATESTBOOST = $$boost + } +} + +contains(LATESTBOOST, 0) { + qtCompileTest(boost) + config_boost { + LATESTBOOST = installed + message("using installed Boost library") + } else { + message("Boost 1.54 has a bug in a function that Fritzing uses, so download or install some other version") + error("Easiest to copy the Boost library to .../src/lib/, so that you have .../src/lib/boost_1_xx_0") + } +} + +!contains(LATESTBOOST, installed) { + message("using Boost from src/lib/boost_1_$${LATESTBOOST}_0") + INCLUDEPATH += src/lib/boost_1_$${LATESTBOOST}_0 +} + HEADERS += \ src/utils/abstractstatesbutton.h \ src/utils/autoclosemessagebox.h \