Skip to content

Commit

Permalink
fix relocate problem in linux
Browse files Browse the repository at this point in the history
  • Loading branch information
Markus committed Apr 30, 2019
1 parent 379896c commit 254ab3f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 24 deletions.
14 changes: 7 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ if (UNIX AND NOT APPLE)
message(STATUS ">>> Linux")

set(Qt5_DIR "")
LIST(APPEND Qt5_DIR "~/Qt/5.8/gcc_64/" "~/Qt/5.7/gcc_64/" "/usr/local/qt/5.11.1/gcc_64/" "/home/mjoppich/qt/qt-everywhere-src-5.10.0/qtbase" "/opt/Qt5.11.1/5.11.1/gcc_64/" "/opt/Qt5.10.0/5.10.0/gcc_64/")
LIST(APPEND Qt5_DIR "/home/markus/Qt/5.12.3/gcc_64/" "~/Qt/5.8/gcc_64/" "~/Qt/5.7/gcc_64/" "/usr/local/qt/5.11.1/gcc_64/" "/home/mjoppich/qt/qt-everywhere-src-5.10.0/qtbase" "/opt/Qt5.11.1/5.11.1/gcc_64/" "/opt/Qt5.10.0/5.10.0/gcc_64/")

set(ENV{OPENSSL_ROOT_DIR} "/home/users/joppich/libs/openssl/")
set(ENV{LUA_DIR} "/home/users/joppich/libs/lua/")
Expand Down Expand Up @@ -230,12 +230,12 @@ add_project_meta(META_FILES_TO_INCLUDE)

set(RESOURCE_FILES "${PROJECT_NAME}.qrc")

find_package(Qt5Core REQUIRED)
find_package(Qt5Gui REQUIRED)
find_package(Qt5Widgets REQUIRED)
find_package(Qt5Network REQUIRED)
find_package(Qt5Xml REQUIRED)
find_package(Qt5XmlPatterns REQUIRED)
find_package(Qt5Core REQUIRED PATHS ${Qt5_DIR} NO_DEFAULT_PATH)
find_package(Qt5Gui REQUIRED PATHS ${Qt5_DIR} NO_DEFAULT_PATH)
find_package(Qt5Widgets REQUIRED PATHS ${Qt5_DIR} NO_DEFAULT_PATH)
find_package(Qt5Network REQUIRED PATHS ${Qt5_DIR} NO_DEFAULT_PATH)
find_package(Qt5Xml REQUIRED PATHS ${Qt5_DIR} NO_DEFAULT_PATH)
find_package(Qt5XmlPatterns REQUIRED PATHS ${Qt5_DIR} NO_DEFAULT_PATH)


if (APPLE)
Expand Down
26 changes: 9 additions & 17 deletions src/parsing/nodes/ExecutionPathRelocateNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,18 @@ class ExecutionPathRelocateNode : public ExecutionNode {

}

static std::string relocateWSL(std::string sPaths, std::string sSeparator, std::string sInSeparator)
static std::string relocateWSL(std::string sPaths, std::string sSeparator, std::string sInSeparator, bool makeWSL=true)
{

std::string sEmpty = "";
std::string sWSLPrefix = "/mnt/";

return relocateGeneral(sPaths, sEmpty, sEmpty, sWSLPrefix, sSeparator, sInSeparator, true);
if (!makeWSL)
{
sWSLPrefix = "";
}

return relocateGeneral(sPaths, sEmpty, sEmpty, sWSLPrefix, sSeparator, sInSeparator, makeWSL);
}

static std::string relocateGeneral(std::string& sPaths, std::string& sFrom, std::string& sTo, std::string& sPrepend, std::string& sSeparator, std::string& sInSeparator, bool bMakeUnix)
Expand Down Expand Up @@ -165,27 +170,14 @@ class ExecutionPathRelocateNode : public ExecutionNode {
}
}


if ((m_bHasWSLAttrib) && (bWSL == false))
{
// nothing to be done
return sChildren;
}

if (bWSL)
{
bMakeUnix = true;
}


if (bWSL)
if (m_bHasWSLAttrib)
{
if (m_sFrom.size() == 0)
{
return "";
}

return relocateWSL(m_sFrom, m_sSeperator, m_sInSeperator);
return relocateWSL(m_sFrom, m_sSeperator, m_sInSeperator, bWSL);
} else {

std::string sPaths = this->evaluateChildren(pID2Node, pInputID2Value, pInputID2FunctionWidget);
Expand Down

0 comments on commit 254ab3f

Please sign in to comment.