|
From: <tiz...@us...> - 2012-08-10 17:05:56
|
Revision: 320
http://sepiola.svn.sourceforge.net/sepiola/?rev=320&view=rev
Author: tizianomueller
Date: 2012-08-10 17:05:49 +0000 (Fri, 10 Aug 2012)
Log Message:
-----------
Various build system fixes (mostly for MinGW building)
- Bump version to 2.1.0
- Small cleanup of debug compiler flags on Linux
- Use CMakeDetermineRCCompilers $CMAKE_RC_COMPILER instead of hardcoded windres path
- Compile platform-specific code only when building for that platform
- Some tests are platform specific, do not build them on others
- Include libraries required when building using MinGW in the installer
Modified Paths:
--------------
trunk/CMakeLists.txt
trunk/installer/win32-x86/NSIS.template.in
trunk/src/CMakeLists.txt
trunk/src/test/CMakeLists.txt
trunk/src/tools/schtasks.cc
Modified: trunk/CMakeLists.txt
===================================================================
--- trunk/CMakeLists.txt 2012-08-10 17:05:27 UTC (rev 319)
+++ trunk/CMakeLists.txt 2012-08-10 17:05:49 UTC (rev 320)
@@ -46,13 +46,17 @@
SET(CPACK_PACKAGE_FULL_NAME ${SSBACKUP_APPLICATION_FULL_NAME})
SET(CPACK_PACKAGE_VENDOR "stepping stone GmbH")
SET(CPACK_PACKAGE_VERSION_MAJOR "2")
-SET(CPACK_PACKAGE_VERSION_MINOR "0")
-SET(CPACK_PACKAGE_VERSION_PATCH "1")
+SET(CPACK_PACKAGE_VERSION_MINOR "1")
+SET(CPACK_PACKAGE_VERSION_PATCH "0")
SET(CPACK_PACKAGE_INSTALL_REGISTRY_KEY "${CPACK_PACKAGE_NAME} ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
SET(CPACK_PACKAGE_EXECUTABLES ${CPACK_PACKAGE_NAME} ${CPACK_PACKAGE_FULL_NAME})
SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/COPYING")
SET(CPACK_RESOURCE_FILE_README "${CMAKE_CURRENT_SOURCE_DIR}/README")
+IF(CMAKE_BUILD_TYPE STREQUAL "Debug")
+ SET(CPACK_NSIS_QT_SUFFIX "d")
+ENDIF(CMAKE_BUILD_TYPE STREQUAL "Debug")
+
# Has to be below the variables because they are accessed in the src/CMakeLists.txt
ADD_SUBDIRECTORY(src)
Modified: trunk/installer/win32-x86/NSIS.template.in
===================================================================
--- trunk/installer/win32-x86/NSIS.template.in 2012-08-10 17:05:27 UTC (rev 319)
+++ trunk/installer/win32-x86/NSIS.template.in 2012-08-10 17:05:49 UTC (rev 320)
@@ -457,6 +457,15 @@
SetOutPath "$INSTDIR"
File /r "${INST_DIR}\*.*"
+ ;Libraries from the MinGW installation
+ File "@CPACK_INSTALL_PREFIX@/bin/QtCore@CPACK_NSIS_QT_SUFFIX@4.dll"
+ File "@CPACK_INSTALL_PREFIX@/bin/QtGui@CPACK_NSIS_QT_SUFFIX@4.dll"
+ File "@CPACK_INSTALL_PREFIX@/bin/QtNetwork@CPACK_NSIS_QT_SUFFIX@4.dll"
+ File "@CPACK_INSTALL_PREFIX@/bin/zlib1.dll"
+ File "@CPACK_INSTALL_PREFIX@/bin/libpng15-*.dll"
+ File "@CPACK_INSTALL_PREFIX@/bin/libstdc++-6.dll"
+ File "@CPACK_INSTALL_PREFIX@/bin/libgcc_s_sjlj-1.dll"
+
;Store installation folder
WriteRegStr SHCTX "Software\@CPACK_PACKAGE_VENDOR@\@CPACK_PACKAGE_INSTALL_REGISTRY_KEY@" "" $INSTDIR
Modified: trunk/src/CMakeLists.txt
===================================================================
--- trunk/src/CMakeLists.txt 2012-08-10 17:05:27 UTC (rev 319)
+++ trunk/src/CMakeLists.txt 2012-08-10 17:05:49 UTC (rev 320)
@@ -30,7 +30,6 @@
ENDIF(CMAKE_BUILD_TYPE STREQUAL Deploy)
IF(CMAKE_COMPILER_IS_GNUCXX)
- SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ggdb")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -pedantic")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wuninitialized -Winit-self")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wredundant-decls -Wstrict-null-sentinel")
@@ -39,17 +38,18 @@
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Woverloaded-virtual")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wfloat-equal -Wno-long-long")
- SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -D_GLIBCXX_DEBUG")# -Werror")
+ SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -D_GLIBCXX_DEBUG -ggdb")# -Werror")
SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}" )
ENDIF(CMAKE_COMPILER_IS_GNUCXX)
SET(CMAKE_CXX_FLAGS_DEPLOY ${CMAKE_CXX_FLAGS_RELWITHDEBUGINFO})
IF(Q_WS_WIN)
+ include(CMakeDetermineRCCompiler)
# add windows icon
SET(ICON_RC_DIR ${CMAKE_CURRENT_SOURCE_DIR}/icon/windows)
ADD_CUSTOM_COMMAND(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/icon.o
- COMMAND windres.exe -I${ICON_RC_DIR}
+ COMMAND ${CMAKE_RC_COMPILER} -I${ICON_RC_DIR}
-i${CMAKE_CURRENT_SOURCE_DIR}/icon/windows/icon.rc
-o ${CMAKE_CURRENT_BINARY_DIR}/icon.o
)
@@ -193,7 +193,7 @@
)
SET(SOURCE_FILES
- main.cc
+ main.cc
cli/cli_manager.cc
gui/about_dialog.cc
gui/backup_form.cc
@@ -218,15 +218,9 @@
model/backup_task.cc
settings/settings.cc
test/test_manager.cc
- tools/at.cc
- tools/schtasks.cc
- tools/crontab.cc
tools/plink.cc
- tools/posix_acl.cc
tools/process.cc
tools/rsync.cc
- tools/set_acl.cc
- tools/unix_permissions.cc
tools/tool_factory.cc
utils/string_utils.cc
utils/extended_file.cc
@@ -234,12 +228,32 @@
utils/log_file_utils.cc
utils/host_file_utils.cc
utils/progress_task.cc
- ${sepiola_UI}
- ${sepiola_MOC}
+ ${sepiola_UI}
+ ${sepiola_MOC}
${sepiola_RC}
${sepiola_CFG}
)
+# Use Q_WS_WIN from Qt-module instead of WIN32 from cmake
+# to make it work when cross-compiling using MinGW
+IF(Q_WS_WIN)
+ LIST(APPEND SOURCE_FILES
+ tools/at.cc
+ tools/schtasks.cc
+ tools/set_acl.cc
+ )
+ELSEIF(Q_WS_MAC)
+ LIST(APPEND SOURCE_FILES
+ tools/unix_permissions.cc
+ )
+ELSEIF(Q_WS_X11)
+ LIST(APPEND SOURCE_FILES
+ tools/crontab.cc
+ tools/posix_acl.cc
+ )
+ENDIF(Q_WS_WIN)
+
+
ADD_EXECUTABLE(
${SSBACKUP_EXECUTABLE_NAME}
WIN32
Modified: trunk/src/test/CMakeLists.txt
===================================================================
--- trunk/src/test/CMakeLists.txt 2012-08-10 17:05:27 UTC (rev 319)
+++ trunk/src/test/CMakeLists.txt 2012-08-10 17:05:49 UTC (rev 320)
@@ -1,3 +1,23 @@
+#| sepiola - Open Source Online Backup Client
+#| Copyright (C) 2012 stepping stone GmbH
+#|
+#| This program is free software; you can redistribute it and/or
+#| modify it under the terms of the GNU General Public License
+#| Version 2 as published by the Free Software Foundation.
+#|
+#| This program 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 this program; if not, write to the Free Software
+#| Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+# Unix specific tests
+
+IF(Q_WS_X11)
+
QT4_WRAP_CPP(test_posix_acl_MOC
test_posix_acl.hh
../tools/posix_acl.hh
@@ -19,6 +39,12 @@
${QT_QTCORE_LIBRARY}
${QT_QTNETWORK_LIBRARY})
+ADD_TEST(test_posix_acl ${CMAKE_CURRENT_BINARY_DIR}/test_posix_acl)
+
+ENDIF(Q_WS_X11)
+
+# All-platform tests
+
QT4_WRAP_CPP(test_host_file_utils_MOC
test_host_file_utils.hh
../utils/host_file_utils.hh
@@ -35,5 +61,4 @@
${QT_QTCORE_LIBRARY}
${QT_QTNETWORK_LIBRARY})
-ADD_TEST(test_posix_acl ${CMAKE_CURRENT_BINARY_DIR}/test_posix_acl)
ADD_TEST(test_host_file_utils ${CMAKE_CURRENT_BINARY_DIR}/test_host_file_utils)
Modified: trunk/src/tools/schtasks.cc
===================================================================
--- trunk/src/tools/schtasks.cc 2012-08-10 17:05:27 UTC (rev 319)
+++ trunk/src/tools/schtasks.cc 2012-08-10 17:05:49 UTC (rev 320)
@@ -22,9 +22,7 @@
#include <QTextCodec>
#include <QStringList>
#include <QRegExp>
-#ifdef Q_OS_WIN32
#include <windows.h>
-#endif
#include "tools/schtasks.hh"
#include "settings/settings.hh"
@@ -95,10 +93,7 @@
{
qDebug() << "Schtasks::schedule( " << execName << ", " << cliArgument << ", " << schtasksArguments << ", " << locale << " )";
- QString username = "";
-#ifdef Q_OS_WIN32
- username = QString::fromWCharArray( _wgetenv( L"USERDOMAIN" ) ) + "\\" + QString::fromWCharArray( _wgetenv( L"USERNAME" ) );
-#endif
+ QString username = QString::fromWCharArray( _wgetenv( L"USERDOMAIN" ) ) + "\\" + QString::fromWCharArray( _wgetenv( L"USERNAME" ) );
QString password;
bool schtasks_success = false;
@@ -197,10 +192,7 @@
if ( taskExists() )
{
QLocale locale = getSchtasksBinaryLocale();
- QString username = "";
-#ifdef Q_OS_WIN32
- username = QString::fromWCharArray( _wgetenv( L"USERDOMAIN" ) ) + "\\" + QString::fromWCharArray( _wgetenv( L"USERNAME" ) );
-#endif
+ QString username = QString::fromWCharArray( _wgetenv( L"USERDOMAIN" ) ) + "\\" + QString::fromWCharArray( _wgetenv( L"USERNAME" ) );
QString password;
bool password_ok = getWindowsPassword( username, password, QObject::tr( "Enter login information to update the existing schedule task." ) );
@@ -419,11 +411,9 @@
QString Schtasks::getCodecName()
{
QString codecName = "";
-#ifdef Q_OS_WIN32
char oemCodePage[6];
GetLocaleInfo( LOCALE_USER_DEFAULT, LOCALE_IDEFAULTCODEPAGE, oemCodePage, sizeof( oemCodePage ) / sizeof( char ) );
codecName = QString( oemCodePage );
-#endif
return codecName;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|