[PATCH] Add option "USE_REAL_RESOURCES" to avoid the if 1 dance for test/release builds

Wald Commits scm-commit at wald.intevation.org
Mon Sep 15 10:17:21 CEST 2014


# HG changeset patch
# User Andre Heinecke <andre.heinecke at intevation.de>
# Date 1410769037 -7200
# Node ID 153af47456d09c1976e26346768d8dadc61910c7
# Parent  02fd9992ccc9565134054403a35266b5c936b059
Add option "USE_REAL_RESOURCES" to avoid the if 1 dance for test/release builds.

    If the option is not set the download resource is trustbridge-development.*

diff -r 02fd9992ccc9 -r 153af47456d0 CMakeLists.txt
--- a/CMakeLists.txt	Fri Sep 12 16:11:08 2014 +0200
+++ b/CMakeLists.txt	Mon Sep 15 10:17:17 2014 +0200
@@ -9,6 +9,7 @@
 project(trustbridge)
 
 option(DO_RELEASE_BUILD "Build for a public release." OFF)
+option(USE_REAL_RESOURCES "Use real resource names on the download server. Autmatically ON if DO_RELEASE_BUILD is set" OFF )
 option(ENABLE_PROFILING "Set to enable profiling." OFF)
 option(USE_CURL "Use libcurl to download updates and certificate lists." ON)
 
@@ -65,6 +66,7 @@
       set (CMAKE_BUILD_TYPE RELEASE)
    endif (NOT CMAKE_BUILD_TYPE)
    add_definitions (-DRELEASE_BUILD)
+   set(USE_REAL_RESOURCES ON)
 else()
 # Default to debug build
    if (NOT CMAKE_BUILD_TYPE)
@@ -74,6 +76,10 @@
    endif (NOT CMAKE_BUILD_TYPE)
 endif()
 
+if(USE_REAL_RESOURCES)
+   add_definitions (-DUSE_REAL_RESOURCES)
+endif()
+
 # Warn level to be used for privileged parts
 set(WARN_HARDENING_FLAGS " -Wextra -Wconversion -Wformat-security")
 
diff -r 02fd9992ccc9 -r 153af47456d0 ui/mainwindow.cpp
--- a/ui/mainwindow.cpp	Fri Sep 12 16:11:08 2014 +0200
+++ b/ui/mainwindow.cpp	Mon Sep 15 10:17:17 2014 +0200
@@ -65,7 +65,7 @@
 #define TB_ARCH_STRING "-amd64"
 #endif
 
-#if 1
+#ifdef USE_REAL_RESOURCES
 # define LIST_RESOURCE "/zertifikatsliste.txt"
 # ifdef Q_OS_WIN
 #  define SW_RESOURCE_VERSION "/TrustBridge-%1.exe"


More information about the Trustbridge-commits mailing list