diff --git a/.gitignore b/.gitignore index 80c3ab89..4a594cf9 100644 --- a/.gitignore +++ b/.gitignore @@ -103,6 +103,8 @@ megacmdconfig.h.in /build/megacmd/megacmd.dsc /build/megacmd/megacmd.spec /build/megacmd/megacmd_*.tar.gz +/build/build-cmake-* +/build/cmake/CMakeLists.txt.user contrib/QtCreator/MEGAcmd/MEGAcmdServer/Makefile.Debug contrib/QtCreator/MEGAcmd/.qmake.stash contrib/QtCreator/MEGAcmd/MEGAcmdClient/Makefile.Debug diff --git a/build/cmake/CMakeLists.txt b/build/cmake/CMakeLists.txt index fadacb44..af58608d 100644 --- a/build/cmake/CMakeLists.txt +++ b/build/cmake/CMakeLists.txt @@ -25,6 +25,7 @@ add_executable(mega-cmd-server "${ProjectDir}/src/megacmdutils.cpp" "${ProjectDir}/src/megacmdcommonutils.cpp" "${ProjectDir}/src/comunicationsmanager.cpp" + "${ProjectDir}/src/comunicationsmanagerfilesockets.cpp" "${ProjectDir}/src/comunicationsmanagernamedpipes.cpp" "${ProjectDir}/src/comunicationsmanagerportsockets.cpp" "${ProjectDir}/src/configurationmanager.cpp" @@ -43,14 +44,15 @@ add_executable(mega-cmd "${ProjectDir}/src/megacmdshell/megacmdshellcommunicationsnamedpipes.cpp" "${ProjectDir}/src/megacmdshell/megacmdshell.cpp" "${ProjectDir}/src/megacmdcommonutils.cpp" - ) -target_link_libraries(mega-exec Mega ) -target_link_libraries(mega-cmd Mega ) -target_link_libraries(mega-cmd-server Mega Lz32.lib) +target_link_libraries(mega-exec Mega) +target_link_libraries(mega-cmd Mega) +if (WIN32) + target_link_libraries(mega-cmd-server Mega Lz32.lib) +else() + target_link_libraries(mega-cmd-server Mega) +endif() if (NOT NO_READLINE) target_link_libraries(mega-cmd readline) endif (NOT NO_READLINE) - - diff --git a/src/megacmdshell/megacmdshellcommunications.cpp b/src/megacmdshell/megacmdshellcommunications.cpp index 738735c6..633bb2b1 100644 --- a/src/megacmdshell/megacmdshellcommunications.cpp +++ b/src/megacmdshell/megacmdshellcommunications.cpp @@ -358,6 +358,7 @@ SOCKET MegaCmdShellCommunications::createSocket(int number, bool initializeserve #else const char executable[] = "../MEGAcmdServer/MEGAcmd"; #endif + const char executable2[] = "./mega-cmd-server"; #else #ifdef __MACH__ @@ -380,14 +381,12 @@ SOCKET MegaCmdShellCommunications::createSocket(int number, bool initializeserve if (ret && errno == 2 ) { cerr << "Couln't initiate MEGAcmd server: executable not found: " << executable << endl; -#ifdef NDEBUG cerr << "Trying to use alternative executable: " << executable2 << endl; ret = execvp(executable2,args); if (ret && errno == 2 ) { cerr << "Couln't initiate MEGAcmd server: executable not found: " << executable2 << endl; } -#endif } if (ret && errno !=2 )