summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt6
-rw-r--r--api/logic/updater/DownloadTask_test.cpp4
-rw-r--r--cmake/UnitTest.cmake2
3 files changed, 8 insertions, 4 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d6acf79b..e20d375a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -17,9 +17,13 @@ enable_testing()
set(CMAKE_AUTOMOC ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
-######## Set module path ########
set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake/")
+# Output all executables and shared libs in the main build folder, not in subfolders.
+set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR})
+if(UNIX)
+ set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR})
+endif()
set(CMAKE_JAVA_TARGET_OUTPUT_DIR ${PROJECT_BINARY_DIR}/jars)
######## Set compiler flags ########
diff --git a/api/logic/updater/DownloadTask_test.cpp b/api/logic/updater/DownloadTask_test.cpp
index edf0f507..5b88b366 100644
--- a/api/logic/updater/DownloadTask_test.cpp
+++ b/api/logic/updater/DownloadTask_test.cpp
@@ -12,7 +12,7 @@ using namespace GoUpdate;
FileSourceList encodeBaseFile(const char *suffix)
{
- auto base = qApp->applicationDirPath();
+ auto base = QDir::currentPath();
QUrl localFile = QUrl::fromLocalFile(base + suffix);
QString localUrlString = localFile.toString(QUrl::FullyEncoded);
auto item = FileSource("http", localUrlString);
@@ -179,7 +179,7 @@ slots:
OperationList operations;
- processFileLists(currentVersion, newVersion, QCoreApplication::applicationDirPath(), tempFolder, new NetJob("Dummy"), operations);
+ processFileLists(currentVersion, newVersion, QDir::currentPath(), tempFolder, new NetJob("Dummy"), operations);
qDebug() << (operations == expectedOperations);
qDebug() << operations;
qDebug() << expectedOperations;
diff --git a/cmake/UnitTest.cmake b/cmake/UnitTest.cmake
index d2c99933..e48ff74d 100644
--- a/cmake/UnitTest.cmake
+++ b/cmake/UnitTest.cmake
@@ -45,5 +45,5 @@ function(add_unit_test name)
target_include_directories(${name}_test PRIVATE "${TEST_RESOURCE_PATH}/UnitTest/")
- add_test(NAME ${name} COMMAND ${name}_test)
+ add_test(NAME ${name} COMMAND ${name}_test WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
endfunction()