2
0
mirror of https://github.com/meganz/MEGAcmd synced 2025-08-31 13:55:10 +00:00

Fix cmake build

This commit is contained in:
Christian Blume
2020-01-29 15:37:35 +13:00
parent ab526c1675
commit e115980ae2
3 changed files with 11 additions and 8 deletions

2
.gitignore vendored
View File

@@ -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

View File

@@ -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)

View File

@@ -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 )