From e7629dcedf703fa703cc44484c9b5956660c0d56 Mon Sep 17 00:00:00 2001 From: Philippe Renon Date: Wed, 27 Jan 2016 08:46:16 +0100 Subject: [PATCH 1/5] windows: make sure to use mingw32-make when invoking cmake to build third party libraries --- make/3rdparty/marble/marble.mk | 1 + make/3rdparty/osgearth/osgearth.mk | 6 ++---- make/tools.mk | 5 +++++ 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/make/3rdparty/marble/marble.mk b/make/3rdparty/marble/marble.mk index f407cd9ee..625d80760 100644 --- a/make/3rdparty/marble/marble.mk +++ b/make/3rdparty/marble/marble.mk @@ -77,6 +77,7 @@ marble: $(V1) ( $(CD) $(MARBLE_BUILD_DIR) && \ PATH=$(MARBLE_BUILD_PATH) && \ $(CMAKE) -Wno-dev -G $(MARBLE_CMAKE_GENERATOR) -DCMAKE_BUILD_TYPE=$(MARBLE_BUILD_CONF) \ + -DCMAKE_MAKE_PROGRAM=$(MAKE) \ -DQTONLY=1 -DQT5BUILD=1 -DWITH_DESIGNER_PLUGIN=0 \ -DCMAKE_INSTALL_PREFIX=$(MARBLE_INSTALL_DIR) $(MARBLE_SRC_DIR) && \ $(MAKE) && \ diff --git a/make/3rdparty/osgearth/osgearth.mk b/make/3rdparty/osgearth/osgearth.mk index fd1e6a490..fda42a212 100644 --- a/make/3rdparty/osgearth/osgearth.mk +++ b/make/3rdparty/osgearth/osgearth.mk @@ -63,7 +63,6 @@ else ifeq ($(UNAME), Darwin) else ifeq ($(UNAME), Windows) OSG_NAME := $(OSG_BASE_NAME)-$(QT_SDK_ARCH) OSG_CMAKE_GENERATOR := "MinGW Makefiles" - OSG_CMAKE_MAKE_PROGRAM := /mingw32/bin/mingw32-make endif OSG_NAME := $(OSG_NAME_PREFIX)$(OSG_NAME)$(OSG_NAME_SUFIX) @@ -81,7 +80,7 @@ osg: PATH=$(OSG_BUILD_PATH) ; \ fi ; \ $(CMAKE) -G $(OSG_CMAKE_GENERATOR) -DCMAKE_BUILD_TYPE=$(OSG_BUILD_CONF) \ - -DCMAKE_MAKE_PROGRAM=$(OSG_CMAKE_MAKE_PROGRAM) \ + -DCMAKE_MAKE_PROGRAM=$(MAKE) \ -DOSG_USE_QT=ON \ -DBUILD_OSG_APPLICATIONS=ON \ -DBUILD_OSG_EXAMPLES=OFF \ @@ -212,7 +211,6 @@ else ifeq ($(UNAME), Darwin) else ifeq ($(UNAME), Windows) OSGEARTH_NAME := $(OSGEARTH_BASE_NAME)-$(QT_SDK_ARCH) OSGEARTH_CMAKE_GENERATOR := "MinGW Makefiles" - OSGEARTH_CMAKE_MAKE_PROGRAM := /mingw32/bin/mingw32-make OSGEARTH_LIB_PATH := $(OSG_INSTALL_DIR)/lib endif @@ -234,7 +232,7 @@ osgearth: export DYLD_LIBRARY_PATH=$(OSGEARTH_LIB_PATH) && \ unset OSG_NOTIFY_LEVEL && \ $(CMAKE) -G $(OSGEARTH_CMAKE_GENERATOR) -DCMAKE_BUILD_TYPE=$(OSGEARTH_BUILD_CONF) \ - -DCMAKE_MAKE_PROGRAM=$(OSGEARTH_CMAKE_MAKE_PROGRAM) \ + -DCMAKE_MAKE_PROGRAM=$(MAKE) \ -DOSGEARTH_USE_QT=ON \ -DINSTALL_TO_OSG_DIR=OFF \ -DOSG_DIR=$(OSG_INSTALL_DIR) \ diff --git a/make/tools.mk b/make/tools.mk index ef17af993..0fdc11a26 100644 --- a/make/tools.mk +++ b/make/tools.mk @@ -218,6 +218,11 @@ ifneq ($(shell $(SEVENZIP) --version >/dev/null 2>&1 && $(ECHO) "found"), found) SEVENZIP = $(TOOLS_DIR)/bin/7za.exe endif endif +ifneq ($(UNAME), Windows) + MAKE := make +else + MAKE := mingw32-make +endif # Echo in recipes is a bit tricky in a Windows Git Bash window in some cases. # It does not work if make started under msysGit installed into a path with spaces. From a6b5a782292f7af6c7ef517c83dbf0dac4cabc1c Mon Sep 17 00:00:00 2001 From: Philippe Renon Date: Wed, 27 Jan 2016 08:50:48 +0100 Subject: [PATCH 2/5] make: variablize Qt version --- make/3rdparty/marble/marble.mk | 3 --- make/3rdparty/osgearth/osgearth.mk | 3 --- make/tools.mk | 19 ++++++++++--------- 3 files changed, 10 insertions(+), 15 deletions(-) diff --git a/make/3rdparty/marble/marble.mk b/make/3rdparty/marble/marble.mk index 625d80760..3fc26a2a8 100644 --- a/make/3rdparty/marble/marble.mk +++ b/make/3rdparty/marble/marble.mk @@ -19,9 +19,6 @@ # ################################ -# TODO should be discovered -QT_VERSION := 5.4.1 - MARBLE_NAME_PREFIX := MARBLE_NAME_SUFIX := -qt-$(QT_VERSION) diff --git a/make/3rdparty/osgearth/osgearth.mk b/make/3rdparty/osgearth/osgearth.mk index fda42a212..b820f2881 100644 --- a/make/3rdparty/osgearth/osgearth.mk +++ b/make/3rdparty/osgearth/osgearth.mk @@ -14,9 +14,6 @@ # ################################ -# [TODO] should be discovered -QT_VERSION := 5.5.1 - ################################ # # common stuff diff --git a/make/tools.mk b/make/tools.mk index 0fdc11a26..a6eb35f39 100644 --- a/make/tools.mk +++ b/make/tools.mk @@ -126,7 +126,8 @@ GTEST_URL := http://librepilot.github.io/tools/gtest-1.6.0.zip CCACHE_URL := http://samba.org/ftp/ccache/ccache-3.2.2.tar.bz2 CCACHE_MD5_URL := http://librepilot.github.io/tools/ccache-3.2.2.tar.bz2.md5 -QT_SDK_DIR := $(TOOLS_DIR)/qt-5.5.1 +QT_VERSION := 5.5.1 +QT_SDK_DIR := $(TOOLS_DIR)/qt-$(QT_VERSION) UNCRUSTIFY_DIR := $(TOOLS_DIR)/uncrustify-0.60 DOXYGEN_DIR := $(TOOLS_DIR)/doxygen-1.8.3.1 GTEST_DIR := $(TOOLS_DIR)/gtest-1.6.0 @@ -135,23 +136,23 @@ OSG_TOOLS_DIR := $(TOOLS_DIR) ifeq ($(UNAME), Linux) ifeq ($(ARCH), x86_64) - OSG_SDK_DIR := $(OSG_TOOLS_DIR)/osg-3.4-linux-x64-qt-5.5.1 - OSGEARTH_SDK_DIR := $(OSG_TOOLS_DIR)/osgearth-2.7-linux-x64-qt-5.5.1 + OSG_SDK_DIR := $(OSG_TOOLS_DIR)/osg-3.4-linux-x64-qt-$(QT_VERSION) + OSGEARTH_SDK_DIR := $(OSG_TOOLS_DIR)/osgearth-2.7-linux-x64-qt-$(QT_VERSION) else - OSG_SDK_DIR := $(OSG_TOOLS_DIR)/osg-3.4-linux-x86-qt-5.5.1 - OSGEARTH_SDK_DIR := $(OSG_TOOLS_DIR)/osgearth-2.7-linux-x86-qt-5.5.1 + OSG_SDK_DIR := $(OSG_TOOLS_DIR)/osg-3.4-linux-x86-qt-$(QT_VERSION) + OSGEARTH_SDK_DIR := $(OSG_TOOLS_DIR)/osgearth-2.7-linux-x86-qt-$(QT_VERSION) endif else ifeq ($(UNAME), Darwin) - OSG_SDK_DIR := $(OSG_TOOLS_DIR)/osg-3.4-clang_64-qt-5.5.1 - OSGEARTH_SDK_DIR := $(OSG_TOOLS_DIR)/osgearth-2.7-clang_64-qt-5.5.1 + OSG_SDK_DIR := $(OSG_TOOLS_DIR)/osg-3.4-clang_64-qt-$(QT_VERSION) + OSGEARTH_SDK_DIR := $(OSG_TOOLS_DIR)/osgearth-2.7-clang_64-qt-$(QT_VERSION) else ifeq ($(UNAME), Windows) MINGW_DIR := $(QT_SDK_DIR)/Tools/$(QT_SDK_ARCH) # When changing PYTHON_DIR, you must also update it in ground/gcs/src/python.pri PYTHON_DIR := $(QT_SDK_DIR)/Tools/$(QT_SDK_ARCH)/opt/bin NSIS_DIR := $(TOOLS_DIR)/nsis-2.46-unicode MESAWIN_DIR := $(TOOLS_DIR)/mesawin - OSG_SDK_DIR := $(OSG_TOOLS_DIR)/osg-3.4-mingw492_32-qt-5.5.1 - OSGEARTH_SDK_DIR := $(OSG_TOOLS_DIR)/osgearth-2.7-mingw492_32-qt-5.5.1 + OSG_SDK_DIR := $(OSG_TOOLS_DIR)/osg-3.4-mingw492_32-qt-$(QT_VERSION) + OSGEARTH_SDK_DIR := $(OSG_TOOLS_DIR)/osgearth-2.7-mingw492_32-qt-$(QT_VERSION) endif QT_SDK_PREFIX := $(QT_SDK_DIR) From 4981721c601364594253403603e362e6ef6a5767 Mon Sep 17 00:00:00 2001 From: Philippe Renon Date: Wed, 27 Jan 2016 08:52:03 +0100 Subject: [PATCH 3/5] marble: port marble.mk to msys2 --- make/3rdparty/marble/marble.mk | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/make/3rdparty/marble/marble.mk b/make/3rdparty/marble/marble.mk index 3fc26a2a8..f99ea3376 100644 --- a/make/3rdparty/marble/marble.mk +++ b/make/3rdparty/marble/marble.mk @@ -2,18 +2,6 @@ # Targets to build Marble # ################################ -# Linux prerequisites -################################ -# -# -################################ -# Windows prerequisites -################################ -# -# -################################ -# Building -################################ # # $ make all_marble # @@ -54,8 +42,6 @@ else ifeq ($(UNAME), Windows) MARBLE_NAME := $(MARBLE_BASE_NAME)-$(QT_SDK_ARCH) MARBLE_DATA_BASE_DIR := data MARBLE_CMAKE_GENERATOR := "MinGW Makefiles" - # CMake is quite picky about its PATH and will complain if sh.exe is found in it - MARBLE_BUILD_PATH := "$(TOOLS_DIR)/bin;$(QT_SDK_PREFIX)/bin;$(MINGW_DIR)/bin;$$SYSTEMROOT/System32" endif MARBLE_NAME := $(MARBLE_NAME_PREFIX)$(MARBLE_NAME)$(MARBLE_NAME_SUFIX) @@ -72,7 +58,9 @@ marble: @$(ECHO) "Building marble $(call toprel, $(MARBLE_SRC_DIR)) into $(call toprel, $(MARBLE_BUILD_DIR))" $(V1) $(MKDIR) -p $(MARBLE_BUILD_DIR) $(V1) ( $(CD) $(MARBLE_BUILD_DIR) && \ - PATH=$(MARBLE_BUILD_PATH) && \ + if [ -n "$(MARBLE_BUILD_PATH)" ]; then \ + PATH=$(MARBLE_BUILD_PATH) ; \ + fi ; \ $(CMAKE) -Wno-dev -G $(MARBLE_CMAKE_GENERATOR) -DCMAKE_BUILD_TYPE=$(MARBLE_BUILD_CONF) \ -DCMAKE_MAKE_PROGRAM=$(MAKE) \ -DQTONLY=1 -DQT5BUILD=1 -DWITH_DESIGNER_PLUGIN=0 \ From e645477849a3b2619bfaebaa69073b5d34a32ccb Mon Sep 17 00:00:00 2001 From: Philippe Renon Date: Wed, 27 Jan 2016 08:53:46 +0100 Subject: [PATCH 4/5] marble: don't build with qt webkit (crashes GCS otherwise) needs to be investigated further as removing webkit breaks some things in marble (like viewing wikipedia articles) --- make/3rdparty/marble/marble.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/make/3rdparty/marble/marble.mk b/make/3rdparty/marble/marble.mk index f99ea3376..01a214f3b 100644 --- a/make/3rdparty/marble/marble.mk +++ b/make/3rdparty/marble/marble.mk @@ -63,7 +63,7 @@ marble: fi ; \ $(CMAKE) -Wno-dev -G $(MARBLE_CMAKE_GENERATOR) -DCMAKE_BUILD_TYPE=$(MARBLE_BUILD_CONF) \ -DCMAKE_MAKE_PROGRAM=$(MAKE) \ - -DQTONLY=1 -DQT5BUILD=1 -DWITH_DESIGNER_PLUGIN=0 \ + -DWITH_KF5=FALSE -DQT5BUILD=ON -DBUILD_WITH_DBUS=OFF -DMARBLE_NO_WEBKIT=TRUE -DWITH_DESIGNER_PLUGIN=NO \ -DCMAKE_INSTALL_PREFIX=$(MARBLE_INSTALL_DIR) $(MARBLE_SRC_DIR) && \ $(MAKE) && \ $(MAKE) install ; \ From 92ef64bc7b12d62f23e21546f66c3bd495bef570 Mon Sep 17 00:00:00 2001 From: Philippe Renon Date: Wed, 27 Jan 2016 08:54:45 +0100 Subject: [PATCH 5/5] make: misc cleanups --- Makefile | 6 +++++- make/tools.mk | 8 ++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 6a7eb5f43..8b1b12109 100644 --- a/Makefile +++ b/Makefile @@ -147,8 +147,12 @@ export UAVOBJGENERATOR # Set up default build configurations (debug | release) GCS_BUILD_CONF := release -GCS_EXTRA_CONF := osg copy_osg +# Set extra configuration +GCS_EXTRA_CONF := + +# osg & osgearth +GCS_EXTRA_CONF += osg copy_osg ifeq ($(UNAME), Windows) GCS_EXTRA_CONF += osgearth endif diff --git a/make/tools.mk b/make/tools.mk index a6eb35f39..1fe5788e2 100644 --- a/make/tools.mk +++ b/make/tools.mk @@ -86,24 +86,24 @@ $(TOOL_REMOVE_TARGETS): ifeq ($(UNAME), Linux) ifeq ($(ARCH), x86_64) + QT_SDK_ARCH := gcc_64 QT_SDK_URL := http://download.qt.io/official_releases/qt/5.5/5.5.1/qt-opensource-linux-x64-5.5.1.run QT_SDK_MD5_URL := http://download.qt.io/official_releases/qt/5.5/5.5.1/qt-opensource-linux-x64-5.5.1.run.md5 - QT_SDK_ARCH := gcc_64 OSG_URL := http://librepilot.github.io/tools/osg-3.4-linux-x64-qt-5.5.1.tar.gz OSGEARTH_URL := http://librepilot.github.io/tools/osgearth-2.7-linux-x64-qt-5.5.1.tar.gz else + QT_SDK_ARCH := gcc QT_SDK_URL := http://download.qt.io/official_releases/qt/5.5/5.5.1/qt-opensource-linux-x86-5.5.1.run QT_SDK_MD5_URL := http://download.qt.io/official_releases/qt/5.5/5.5.1/qt-opensource-linux-x86-5.5.1.run.md5 - QT_SDK_ARCH := gcc OSG_URL := http://librepilot.github.io/tools/osg-3.4-linux-x86-qt-5.5.1.tar.gz OSGEARTH_URL := http://librepilot.github.io/tools/osgearth-2.7-linux-x86-qt-5.5.1.tar.gz endif UNCRUSTIFY_URL := http://librepilot.github.io/tools/uncrustify-0.60.tar.gz DOXYGEN_URL := http://librepilot.github.io/tools/doxygen-1.8.3.1.src.tar.gz else ifeq ($(UNAME), Darwin) + QT_SDK_ARCH := clang_64 QT_SDK_URL := http://download.qt.io/official_releases/qt/5.5/5.5.1/qt-opensource-mac-x64-clang-5.5.1.dmg QT_SDK_MD5_URL := http://download.qt.io/official_releases/qt/5.5/5.5.1/qt-opensource-mac-x64-clang-5.5.1.dmg.md5 - QT_SDK_ARCH := clang_64 QT_SDK_MOUNT_DIR := /Volumes/qt-opensource-mac-x64-clang-5.5.1 QT_SDK_MAINTENANCE_TOOL := /Volumes/qt-opensource-mac-x64-clang-5.5.1/qt-opensource-mac-x64-clang-5.5.1.app/Contents/MacOS/qt-opensource-mac-x64-clang-5.5.1 UNCRUSTIFY_URL := http://librepilot.github.io/tools/uncrustify-0.60.tar.gz @@ -111,9 +111,9 @@ else ifeq ($(UNAME), Darwin) OSG_URL := http://librepilot.github.io/tools/osg-3.4-clang_64-qt-5.5.1.tar.gz OSGEARTH_URL := http://librepilot.github.io/tools/osgearth-2.7-clang_64-qt-5.5.1.tar.gz else ifeq ($(UNAME), Windows) + QT_SDK_ARCH := mingw492_32 QT_SDK_URL := http://download.qt.io/official_releases/qt/5.5/5.5.1/qt-opensource-windows-x86-mingw492-5.5.1.exe QT_SDK_MD5_URL := http://download.qt.io/official_releases/qt/5.5/5.5.1/qt-opensource-windows-x86-mingw492-5.5.1.exe.md5 - QT_SDK_ARCH := mingw492_32 NSIS_URL := http://librepilot.github.io/tools/nsis-2.46-unicode.tar.bz2 MESAWIN_URL := http://librepilot.github.io/tools/mesawin.tar.gz UNCRUSTIFY_URL := http://librepilot.github.io/tools/uncrustify-0.60-windows.tar.bz2