From eb0e5a9ecd91c43e29ce6c479a0dff9cd04bf243 Mon Sep 17 00:00:00 2001 From: "Jerry (Xinyu Hou)" Date: Fri, 18 Nov 2016 15:13:42 +0000 Subject: [PATCH] Only copy binaries to ROOT/bin on Windows --- src/cmd/synergyc/CMakeLists.txt | 28 +++++++++++++++------------- src/cmd/synergyp/CMakeLists.txt | 28 +++++++++++++++------------- src/cmd/synergys/CMakeLists.txt | 28 +++++++++++++++------------- src/cmd/syntool/CMakeLists.txt | 28 +++++++++++++++------------- 4 files changed, 60 insertions(+), 52 deletions(-) diff --git a/src/cmd/synergyc/CMakeLists.txt b/src/cmd/synergyc/CMakeLists.txt index b2e778bf..9c619a28 100644 --- a/src/cmd/synergyc/CMakeLists.txt +++ b/src/cmd/synergyc/CMakeLists.txt @@ -60,17 +60,19 @@ add_executable(synergyc ${sources}) target_link_libraries(synergyc arch base client common io mt net ipc platform server synergy ${libs} ${OPENSSL_LIBS}) -if (CONF_CPACK) - install(TARGETS - synergyc - COMPONENT core - DESTINATION bin) +if (WIN32) + add_custom_command( + TARGET synergyc + POST_BUILD + COMMAND xcopy /Y /Q + ..\\..\\..\\..\\..\\synergy\\bin\\${CMAKE_CFG_INTDIR}\\synergyc.* + ..\\..\\..\\..\\..\\bin\\${CMAKE_CFG_INTDIR} + ) +else () + if (CONF_CPACK) + install(TARGETS + synergyc + COMPONENT core + DESTINATION bin) + endif() endif() - -add_custom_command( - TARGET synergyc - POST_BUILD - COMMAND xcopy /Y /Q - ..\\..\\..\\..\\..\\synergy\\bin\\${CMAKE_CFG_INTDIR}\\synergyc.* - ..\\..\\..\\..\\..\\bin\\${CMAKE_CFG_INTDIR} -) diff --git a/src/cmd/synergyp/CMakeLists.txt b/src/cmd/synergyp/CMakeLists.txt index c13534c3..fd2c7384 100644 --- a/src/cmd/synergyp/CMakeLists.txt +++ b/src/cmd/synergyp/CMakeLists.txt @@ -65,17 +65,19 @@ endif() target_link_libraries(synergyp arch base client common io mt net ipc platform server synergy client ${libs} ${OPENSSL_LIBS}) -if (CONF_CPACK) - install(TARGETS - synergyp - COMPONENT core - DESTINATION bin) +if (WIN32) + add_custom_command( + TARGET synergyp + POST_BUILD + COMMAND xcopy /Y /Q + ..\\..\\..\\..\\..\\synergy\\bin\\${CMAKE_CFG_INTDIR}\\synergyp.* + ..\\..\\..\\..\\..\\bin\\${CMAKE_CFG_INTDIR} + ) +else () + if (CONF_CPACK) + install(TARGETS + synergyp + COMPONENT core + DESTINATION bin) + endif() endif() - -add_custom_command( - TARGET synergyp - POST_BUILD - COMMAND xcopy /Y /Q - ..\\..\\..\\..\\..\\synergy\\bin\\${CMAKE_CFG_INTDIR}\\synergyp.* - ..\\..\\..\\..\\..\\bin\\${CMAKE_CFG_INTDIR} -) diff --git a/src/cmd/synergys/CMakeLists.txt b/src/cmd/synergys/CMakeLists.txt index 4a59541d..7441a46f 100644 --- a/src/cmd/synergys/CMakeLists.txt +++ b/src/cmd/synergys/CMakeLists.txt @@ -60,17 +60,19 @@ add_executable(synergys ${sources}) target_link_libraries(synergys arch base client common io mt net ipc platform server synergy ${libs} ${OPENSSL_LIBS}) -if (CONF_CPACK) - install(TARGETS - synergys - COMPONENT core - DESTINATION bin) +if (WIN32) + add_custom_command( + TARGET synergys + POST_BUILD + COMMAND xcopy /Y /Q + ..\\..\\..\\..\\..\\synergy\\bin\\${CMAKE_CFG_INTDIR}\\synergys.* + ..\\..\\..\\..\\..\\bin\\${CMAKE_CFG_INTDIR} + ) +else () + if (CONF_CPACK) + install(TARGETS + synergys + COMPONENT core + DESTINATION bin) + endif() endif() - -add_custom_command( - TARGET synergys - POST_BUILD - COMMAND xcopy /Y /Q - ..\\..\\..\\..\\..\\synergy\\bin\\${CMAKE_CFG_INTDIR}\\synergys.* - ..\\..\\..\\..\\..\\bin\\${CMAKE_CFG_INTDIR} -) diff --git a/src/cmd/syntool/CMakeLists.txt b/src/cmd/syntool/CMakeLists.txt index d4d9cfc0..6f61f1d0 100644 --- a/src/cmd/syntool/CMakeLists.txt +++ b/src/cmd/syntool/CMakeLists.txt @@ -31,17 +31,19 @@ add_executable(syntool ${sources}) target_link_libraries(syntool synergy arch base client common io ipc mt net platform server ${libs} ${OPENSSL_LIBS}) -if (CONF_CPACK) - install(TARGETS - syntool - COMPONENT core - DESTINATION bin) +if (WIN32) + add_custom_command( + TARGET syntool + POST_BUILD + COMMAND xcopy /Y /Q + ..\\..\\..\\..\\..\\synergy\\bin\\${CMAKE_CFG_INTDIR}\\syntool.* + ..\\..\\..\\..\\..\\bin\\${CMAKE_CFG_INTDIR} + ) +else () + if (CONF_CPACK) + install(TARGETS + syntool + COMPONENT core + DESTINATION bin) + endif() endif() - -add_custom_command( - TARGET syntool - POST_BUILD - COMMAND xcopy /Y /Q - ..\\..\\..\\..\\..\\synergy\\bin\\${CMAKE_CFG_INTDIR}\\syntool.* - ..\\..\\..\\..\\..\\bin\\${CMAKE_CFG_INTDIR} -)