From bf58c8ab758076aae456cc16481a548e1b3713c8 Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Wed, 10 Jun 2015 02:37:37 +0200 Subject: [PATCH] Correctly copy libraries Combine SyncWidget and openspace::DownloadManager --- apps/Launcher/syncwidget.cpp | 8 ++++++++ apps/Launcher/syncwidget.h | 1 + ext/ghoul | 2 +- include/openspace/engine/configurationmanager.h | 1 + src/engine/configurationmanager.cpp | 1 + src/engine/openspaceengine.cpp | 2 +- support/cmake/support_macros.cmake | 5 ++++- 7 files changed, 17 insertions(+), 3 deletions(-) diff --git a/apps/Launcher/syncwidget.cpp b/apps/Launcher/syncwidget.cpp index 30babbe899..7d6371a1b6 100644 --- a/apps/Launcher/syncwidget.cpp +++ b/apps/Launcher/syncwidget.cpp @@ -24,6 +24,8 @@ #include "syncwidget.h" +#include + #include #include #include @@ -42,6 +44,12 @@ SyncWidget::SyncWidget(QWidget* parent) ghoul::initialize(); + openspace::DownloadManager::initialize("http://openspace.itn.liu.se/request.cgi"); +} + +SyncWidget::~SyncWidget() { + openspace::DownloadManager::deinitialize(); + ghoul::deinitialize(); } void SyncWidget::setSceneFile(QString scene) { diff --git a/apps/Launcher/syncwidget.h b/apps/Launcher/syncwidget.h index ef206914f4..be78e6a332 100644 --- a/apps/Launcher/syncwidget.h +++ b/apps/Launcher/syncwidget.h @@ -30,6 +30,7 @@ class SyncWidget : public QWidget { public: SyncWidget(QWidget* parent); + ~SyncWidget(); void setSceneFile(QString scene); diff --git a/ext/ghoul b/ext/ghoul index c660e8dd75..eb66778e0a 160000 --- a/ext/ghoul +++ b/ext/ghoul @@ -1 +1 @@ -Subproject commit c660e8dd75beae2a827cbc04d19987e45b23f4fb +Subproject commit eb66778e0aaf1809fff1a1476872594a24ac0ac3 diff --git a/include/openspace/engine/configurationmanager.h b/include/openspace/engine/configurationmanager.h index 2013bb3aa6..bd11a2dd23 100644 --- a/include/openspace/engine/configurationmanager.h +++ b/include/openspace/engine/configurationmanager.h @@ -50,6 +50,7 @@ public: static const std::string KeyLogImmediateFlush; static const std::string KeyLogs; static const std::string KeyDisableMasterRendering; + static const std::string KeyDownloadRequestURL; bool loadFromFile(const std::string& filename); diff --git a/src/engine/configurationmanager.cpp b/src/engine/configurationmanager.cpp index 65f9f26f81..5c2c9bf3ed 100644 --- a/src/engine/configurationmanager.cpp +++ b/src/engine/configurationmanager.cpp @@ -58,6 +58,7 @@ const std::string ConfigurationManager::KeyLogLevel = "Logging.LogLevel"; const std::string ConfigurationManager::KeyLogImmediateFlush = "Logging.ImmediateFlush"; const std::string ConfigurationManager::KeyLogs = "Logging.Logs"; const std::string ConfigurationManager::KeyDisableMasterRendering = "DisableRenderingOnMaster"; +const std::string ConfigurationManager::KeyDownloadRequestURL = "DownloadRequestURL"; bool ConfigurationManager::loadFromFile(const std::string& filename) { using ghoul::filesystem::FileSystem; diff --git a/src/engine/openspaceengine.cpp b/src/engine/openspaceengine.cpp index 37abd2ac32..193d67e0f1 100644 --- a/src/engine/openspaceengine.cpp +++ b/src/engine/openspaceengine.cpp @@ -290,7 +290,7 @@ bool OpenSpaceEngine::initialize() { SysCap.logCapabilities(); std::string requestURL = ""; - bool success = configurationManager()->getValue(KeyDownloadRequestURL, requestURL); + bool success = configurationManager()->getValue(ConfigurationManager::KeyDownloadRequestURL, requestURL); if (success) DownloadManager::initialize(requestURL); diff --git a/support/cmake/support_macros.cmake b/support/cmake/support_macros.cmake index 3813976a8b..4ee6a9c93f 100644 --- a/support/cmake/support_macros.cmake +++ b/support/cmake/support_macros.cmake @@ -166,10 +166,10 @@ function (add_external_dependencies) # Curl if (WIN32) set(CURL_ROOT_DIR "${OPENSPACE_EXT_DIR}/curl") + set(CURL_ROOT_DIR "${OPENSPACE_EXT_DIR}/curl" PARENT_SCOPE) target_include_directories(libOpenSpace SYSTEM PUBLIC ${CURL_ROOT_DIR}/include) target_link_libraries(libOpenSpace ${CURL_ROOT_DIR}/lib/libcurl_imp.lib) target_compile_definitions(libOpenSpace PUBLIC "OPENSPACE_CURL_ENABLED" "CURL_STATICLIB") - copy_files(OpenSpace "${CURL_ROOT_DIR}/lib/libcurl.dll") else () find_package(curl) if (CURL_FOUND) @@ -437,6 +437,9 @@ endfunction () function (copy_dynamic_libraries) if (WIN32) + + copy_files(OpenSpace "${CURL_ROOT_DIR}/lib/libcurl.dll") + # Copy DLLs needed by Ghoul into the executable directory ghl_copy_shared_libraries(OpenSpace ${OPENSPACE_EXT_DIR}/ghoul)