From f11c660efbde8b27ef49ec87b565102e4db2f290 Mon Sep 17 00:00:00 2001 From: Nick Bolton Date: Wed, 26 Feb 2014 17:46:02 +0000 Subject: [PATCH] used glob instead of manually specifying files. cmake does not recommend this, but we always re-run cmake anyway after adding files since we use vs. --- CMakeLists.txt | 12 +++- src/CMakeLists.txt | 5 +- src/cmd/synergyc/CMakeLists.txt | 15 +++-- src/cmd/synergyd/CMakeLists.txt | 15 ++--- src/cmd/synergyp/CMakeLists.txt | 18 +++--- src/cmd/synergys/CMakeLists.txt | 15 +++-- src/cmd/syntool/CMakeLists.txt | 12 ++-- src/cmd/usynergy/CMakeLists.txt | 6 +- src/lib/arch/CMakeLists.txt | 17 +++--- src/lib/base/CMakeLists.txt | 52 +++------------- src/lib/client/CMakeLists.txt | 22 +++---- src/lib/common/CMakeLists.txt | 15 ++--- src/lib/io/CMakeLists.txt | 33 +++------- src/lib/ipc/CMakeLists.txt | 32 +++------- src/lib/mt/CMakeLists.txt | 29 +++------ src/lib/net/CMakeLists.txt | 37 +++-------- src/lib/platform/CMakeLists.txt | 95 +++++------------------------ src/lib/server/CMakeLists.txt | 46 +++----------- src/lib/synergy/CMakeLists.txt | 98 ++++++------------------------ src/lib/synwinhk/CMakeLists.txt | 20 +++--- src/lib/synwinxt/CMakeLists.txt | 25 +++----- src/micro/CMakeLists.txt | 11 ++-- src/plugin/winmmjoy/CMakeLists.txt | 14 ++--- src/test/integtests/CMakeLists.txt | 61 ++++++++----------- src/test/unittests/CMakeLists.txt | 36 +++-------- 25 files changed, 201 insertions(+), 540 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 51c1b23f..2c3ef929 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,8 +20,8 @@ set(VERSION_MINOR 4) set(VERSION_REV 17) set(VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_REV}") -# The check for 2.6 may be too strict (consider lowering). -cmake_minimum_required(VERSION 2.4.7) +# 2.8 needed for file glob. +cmake_minimum_required(VERSION 2.8) # CMake complains if we don't have this. if (COMMAND cmake_policy) @@ -64,6 +64,14 @@ set(doc_dir ${root_dir}/doc) # lib, it is automatically passed to the linker. set(libs) +# only include headers as "source" if not unix makefiles, +# which is useful when using an IDE. +if (${CMAKE_GENERATOR} STREQUAL "Unix Makefiles") + set(SYNERGY_ADD_HEADERS FALSE) +else() + set(SYNERGY_ADD_HEADERS TRUE) +endif() + # Depending on the platform, pass in the required defines. if (UNIX) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 930d4ca8..40293446 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -16,8 +16,9 @@ add_subdirectory(lib) add_subdirectory(cmd) +add_subdirectory(plugin) +add_subdirectory(micro) + if (NOT ${CMAKE_SYSTEM_NAME} MATCHES "IRIX") add_subdirectory(test) endif() -add_subdirectory(plugin) -add_subdirectory(micro) diff --git a/src/cmd/synergyc/CMakeLists.txt b/src/cmd/synergyc/CMakeLists.txt index ec569fce..d30be939 100644 --- a/src/cmd/synergyc/CMakeLists.txt +++ b/src/cmd/synergyc/CMakeLists.txt @@ -14,12 +14,12 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -set(src +set(sources synergyc.cpp ) if (WIN32) - list(APPEND src + list(APPEND sources CMSWindowsClientTaskBarReceiver.cpp CMSWindowsClientTaskBarReceiver.h resource.h @@ -31,12 +31,12 @@ if (WIN32) tb_wait.ico ) elseif (APPLE) - list(APPEND src COSXClientTaskBarReceiver.cpp) + list(APPEND sources COSXClientTaskBarReceiver.cpp) elseif (UNIX) - list(APPEND src CXWindowsClientTaskBarReceiver.cpp) + list(APPEND sources CXWindowsClientTaskBarReceiver.cpp) endif() -set(inc +include_directories( ../../lib/arch ../../lib/base ../../lib/client @@ -52,13 +52,12 @@ set(inc ) if (UNIX) - list(APPEND inc + include_directories( ../../.. ) endif() -include_directories(${inc}) -add_executable(synergyc ${src}) +add_executable(synergyc ${sources}) target_link_libraries(synergyc arch base client common io mt net ipc platform server synergy cryptopp ${libs}) diff --git a/src/cmd/synergyd/CMakeLists.txt b/src/cmd/synergyd/CMakeLists.txt index c7c26480..267c34ca 100644 --- a/src/cmd/synergyd/CMakeLists.txt +++ b/src/cmd/synergyd/CMakeLists.txt @@ -14,11 +14,10 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -set(src - synergyd.cpp -) +file(GLOB headers "*.h") +file(GLOB sources "*.cpp") -set(inc +include_directories( ../../lib/arch ../../lib/base ../../lib/common @@ -31,17 +30,15 @@ set(inc ) if (UNIX) - list(APPEND inc + include_directories( ../../.. ) endif() -include_directories(${inc}) - if (WIN32) - add_executable(synergyd WIN32 ${src}) + add_executable(synergyd WIN32 ${sources}) else() - add_executable(synergyd ${src}) + add_executable(synergyd ${sources}) endif() target_link_libraries(synergyd diff --git a/src/cmd/synergyp/CMakeLists.txt b/src/cmd/synergyp/CMakeLists.txt index cfa43f8a..0c11461c 100644 --- a/src/cmd/synergyp/CMakeLists.txt +++ b/src/cmd/synergyp/CMakeLists.txt @@ -14,12 +14,12 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -set(src +set(sources synergyp.cpp ) if (WIN32) - list(APPEND src + list(APPEND sources CMSWindowsPortableTaskBarReceiver.cpp CMSWindowsPortableTaskBarReceiver.h resource.h @@ -31,12 +31,12 @@ if (WIN32) tb_wait.ico ) elseif (APPLE) - list(APPEND src COSXPortableTaskBarReceiver.cpp) + list(APPEND sources COSXPortableTaskBarReceiver.cpp) elseif (UNIX) - list(APPEND src CXWindowsPortableTaskBarReceiver.cpp) + list(APPEND sources CXWindowsPortableTaskBarReceiver.cpp) endif() -set(inc +include_directories( ../../lib/arch ../../lib/base ../../lib/common @@ -52,17 +52,15 @@ set(inc ) if (UNIX) - list(APPEND inc + include_directories( ../../.. ) endif() -include_directories(${inc}) - if (WIN32) - add_executable(synergyp WIN32 ${src}) + add_executable(synergyp WIN32 ${sources}) else() - add_executable(synergyp ${src}) + add_executable(synergyp ${sources}) endif() target_link_libraries(synergyp diff --git a/src/cmd/synergys/CMakeLists.txt b/src/cmd/synergys/CMakeLists.txt index d91b6063..33bb0c08 100644 --- a/src/cmd/synergys/CMakeLists.txt +++ b/src/cmd/synergys/CMakeLists.txt @@ -14,12 +14,12 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -set(src +set(sources synergys.cpp ) if (WIN32) - list(APPEND src + list(APPEND sources CMSWindowsServerTaskBarReceiver.cpp CMSWindowsServerTaskBarReceiver.h resource.h @@ -31,12 +31,12 @@ if (WIN32) tb_wait.ico ) elseif (APPLE) - list(APPEND src COSXServerTaskBarReceiver.cpp) + list(APPEND sources COSXServerTaskBarReceiver.cpp) elseif (UNIX) - list(APPEND src CXWindowsServerTaskBarReceiver.cpp) + list(APPEND sources CXWindowsServerTaskBarReceiver.cpp) endif() -set(inc +include_directories( ../../lib/arch ../../lib/base ../../lib/common @@ -52,13 +52,12 @@ set(inc ) if (UNIX) - list(APPEND inc + include_directories( ../../.. ) endif() -include_directories(${inc}) -add_executable(synergys ${src}) +add_executable(synergys ${sources}) target_link_libraries(synergys arch base client common io mt net ipc platform server synergy cryptopp ${libs}) diff --git a/src/cmd/syntool/CMakeLists.txt b/src/cmd/syntool/CMakeLists.txt index 5a2af4d7..f10ec80d 100644 --- a/src/cmd/syntool/CMakeLists.txt +++ b/src/cmd/syntool/CMakeLists.txt @@ -13,11 +13,10 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -set(src - syntool.cpp -) +file(GLOB headers "*.h") +file(GLOB sources "*.cpp") -set(inc +include_directories( ../../lib/arch ../../lib/base ../../lib/common @@ -32,13 +31,12 @@ set(inc ) if (UNIX) - list(APPEND inc + include_directories( ../../.. ) endif() -include_directories(${inc}) -add_executable(syntool ${src}) +add_executable(syntool ${sources}) target_link_libraries(syntool synergy arch base client common io ipc mt net platform server cryptopp ${libs}) diff --git a/src/cmd/usynergy/CMakeLists.txt b/src/cmd/usynergy/CMakeLists.txt index 7db84d6a..b08e0d34 100644 --- a/src/cmd/usynergy/CMakeLists.txt +++ b/src/cmd/usynergy/CMakeLists.txt @@ -15,11 +15,11 @@ # along with this program. If not, see . if (WIN32) - set(src uSynergyWin32.c) + set(sources uSynergyWin32.c) elseif (UNIX) - set(src uSynergyUnix.c) + set(sources uSynergyUnix.c) endif() include_directories(../../micro) -add_executable(usynergy ${src}) +add_executable(usynergy ${sources}) target_link_libraries(usynergy micro) diff --git a/src/lib/arch/CMakeLists.txt b/src/lib/arch/CMakeLists.txt index 5599a333..97272ef0 100644 --- a/src/lib/arch/CMakeLists.txt +++ b/src/lib/arch/CMakeLists.txt @@ -14,7 +14,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -set(src +set(sources CArch.cpp IArchString.cpp XArch.cpp @@ -23,7 +23,7 @@ set(src if (WIN32) - set(inc + set(headers CArch.h CArchConsoleWindows.h CArchDaemonWindows.h @@ -47,8 +47,8 @@ if (WIN32) CArchInternetWindows.h ) - list(APPEND src - ${inc} + list(APPEND sources + ${headers} CArchConsoleWindows.cpp CArchDaemonWindows.cpp CArchFileWindows.cpp @@ -68,7 +68,7 @@ if (WIN32) elseif (UNIX) - list(APPEND src + list(APPEND sources CArchConsoleUnix.cpp CArchDaemonUnix.cpp CArchFileUnix.cpp @@ -88,7 +88,7 @@ elseif (UNIX) endif() -set(inc +include_directories( ../base ../common ../mt @@ -97,11 +97,10 @@ set(inc ) if (UNIX) - list(APPEND inc + include_directories( ../../.. ../arch ) endif() -include_directories(${inc}) -add_library(arch STATIC ${src}) +add_library(arch STATIC ${sources}) diff --git a/src/lib/base/CMakeLists.txt b/src/lib/base/CMakeLists.txt index b2e0e822..ba708664 100644 --- a/src/lib/base/CMakeLists.txt +++ b/src/lib/base/CMakeLists.txt @@ -14,51 +14,14 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -set(inc - CEvent.h - CEventQueue.h - CEventTypes.h - CFunctionEventJob.h - CFunctionJob.h - CLog.h - CPriorityQueue.h - CSimpleEventQueueBuffer.h - CStopwatch.h - CString.h - CStringUtil.h - CUnicode.h - IEventJob.h - IEventQueue.h - IEventQueueBuffer.h - IJob.h - ILogOutputter.h - LogOutputters.h - TMethodEventJob.h - TMethodJob.h - XBase.h - ELevel.h -) +file(GLOB headers "*.h") +file(GLOB sources "*.cpp") -set(src - CEvent.cpp - CEventQueue.cpp - CEventTypes.cpp - CFunctionEventJob.cpp - CFunctionJob.cpp - CLog.cpp - CSimpleEventQueueBuffer.cpp - CStopwatch.cpp - CStringUtil.cpp - CUnicode.cpp - LogOutputters.cpp - XBase.cpp -) - -if (WIN32) - list(APPEND src ${inc}) +if (SYNERGY_ADD_HEADERS) + list(APPEND sources ${headers}) endif() -set(inc +include_directories( ../arch ../common ../mt @@ -66,14 +29,13 @@ set(inc ) if (UNIX) - list(APPEND inc + include_directories( ../../.. ../base ) endif() -include_directories(${inc}) -add_library(base STATIC ${src}) +add_library(base STATIC ${sources}) if (UNIX) target_link_libraries(base common) diff --git a/src/lib/client/CMakeLists.txt b/src/lib/client/CMakeLists.txt index a3dd5d0d..1ea66b1e 100644 --- a/src/lib/client/CMakeLists.txt +++ b/src/lib/client/CMakeLists.txt @@ -14,21 +14,14 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -set(inc - CClient.h - CServerProxy.h -) +file(GLOB headers "*.h") +file(GLOB sources "*.cpp") -set(src - CClient.cpp - CServerProxy.cpp -) - -if (WIN32) - list(APPEND src ${inc}) +if (SYNERGY_ADD_HEADERS) + list(APPEND sources ${headers}) endif() -set(inc +include_directories( ../arch ../base ../common @@ -40,14 +33,13 @@ set(inc ) if (UNIX) - list(APPEND inc + include_directories( ../../.. ) endif() -include_directories(${inc}) -add_library(client STATIC ${src}) +add_library(client STATIC ${sources}) if (UNIX) target_link_libraries(client synergy io) diff --git a/src/lib/common/CMakeLists.txt b/src/lib/common/CMakeLists.txt index 611ff1b3..23de44e1 100644 --- a/src/lib/common/CMakeLists.txt +++ b/src/lib/common/CMakeLists.txt @@ -14,16 +14,11 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -set(inc - Version.h -) +file(GLOB headers "*.h") +file(GLOB sources "*.cpp") -set(src - Version.cpp -) - -if (WIN32) - list(APPEND src ${inc}) +if (SYNERGY_ADD_HEADERS) + list(APPEND sources ${headers}) endif() if (UNIX) @@ -32,4 +27,4 @@ if (UNIX) ) endif() -add_library(common STATIC ${src}) +add_library(common STATIC ${sources}) diff --git a/src/lib/io/CMakeLists.txt b/src/lib/io/CMakeLists.txt index a2303d93..654ca590 100644 --- a/src/lib/io/CMakeLists.txt +++ b/src/lib/io/CMakeLists.txt @@ -14,32 +14,14 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -set(inc - CStreamBuffer.h - CStreamFilter.h - IStream.h - IStreamFilterFactory.h - XIO.h - CCryptoStream.h - CCryptoMode.h - ECryptoMode.h - CCryptoOptions.h -) +file(GLOB headers "*.h") +file(GLOB sources "*.cpp") -set(src - CStreamBuffer.cpp - CStreamFilter.cpp - XIO.cpp - CCryptoStream.cpp - CCryptoMode.cpp - CCryptoOptions.cpp -) - -if (WIN32) - list(APPEND src ${inc}) +if (SYNERGY_ADD_HEADERS) + list(APPEND sources ${headers}) endif() -set(inc +include_directories( ../arch ../base ../common @@ -48,13 +30,12 @@ set(inc ) if (UNIX) - list(APPEND inc + include_directories( ../../.. ) endif() -include_directories(${inc}) -add_library(io STATIC ${src}) +add_library(io STATIC ${sources}) if (UNIX) target_link_libraries(io cryptopp) diff --git a/src/lib/ipc/CMakeLists.txt b/src/lib/ipc/CMakeLists.txt index 40807d52..14a0da47 100644 --- a/src/lib/ipc/CMakeLists.txt +++ b/src/lib/ipc/CMakeLists.txt @@ -14,31 +14,14 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -set(inc - Ipc.h - CIpcServer.h - CIpcClient.h - CIpcServerProxy.h - CIpcClientProxy.h - CIpcMessage.h - CIpcLogOutputter.h -) +file(GLOB headers "*.h") +file(GLOB sources "*.cpp") -set(src - Ipc.cpp - CIpcServer.cpp - CIpcClient.cpp - CIpcServerProxy.cpp - CIpcClientProxy.cpp - CIpcMessage.cpp - CIpcLogOutputter.cpp -) - -if (WIN32) - list(APPEND src ${inc}) +if (SYNERGY_ADD_HEADERS) + list(APPEND sources ${headers}) endif() -set(inc +include_directories( ../arch ../base ../common @@ -49,13 +32,12 @@ set(inc ) if (UNIX) - list(APPEND inc + include_directories( ../../.. ) endif() -include_directories(${inc}) -add_library(ipc STATIC ${src}) +add_library(ipc STATIC ${sources}) if (UNIX) target_link_libraries(ipc arch base common mt io net synergy) diff --git a/src/lib/mt/CMakeLists.txt b/src/lib/mt/CMakeLists.txt index 86913f77..1242249a 100644 --- a/src/lib/mt/CMakeLists.txt +++ b/src/lib/mt/CMakeLists.txt @@ -14,28 +14,14 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -set(inc - CCondVar.h - CLock.h - CMutex.h - CThread.h - XMT.h - XThread.h -) +file(GLOB headers "*.h") +file(GLOB sources "*.cpp") -set(src - CCondVar.cpp - CLock.cpp - CMutex.cpp - CThread.cpp - XMT.cpp -) - -if (WIN32) - list(APPEND src ${inc}) +if (SYNERGY_ADD_HEADERS) + list(APPEND sources ${headers}) endif() -set(inc +include_directories( ../arch ../base ../common @@ -43,10 +29,9 @@ set(inc ) if (UNIX) - list(APPEND inc + include_directories( ../../.. ) endif() -include_directories(${inc}) -add_library(mt STATIC ${src}) +add_library(mt STATIC ${sources}) diff --git a/src/lib/net/CMakeLists.txt b/src/lib/net/CMakeLists.txt index 726209cd..83838e63 100644 --- a/src/lib/net/CMakeLists.txt +++ b/src/lib/net/CMakeLists.txt @@ -14,36 +14,14 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -set(inc - CNetworkAddress.h - CSocketMultiplexer.h - CTCPListenSocket.h - CTCPSocket.h - CTCPSocketFactory.h - IDataSocket.h - IListenSocket.h - ISocket.h - ISocketFactory.h - ISocketMultiplexerJob.h - TSocketMultiplexerMethodJob.h - XSocket.h -) +file(GLOB headers "*.h") +file(GLOB sources "*.cpp") -set(src - CNetworkAddress.cpp - CSocketMultiplexer.cpp - CTCPListenSocket.cpp - CTCPSocket.cpp - CTCPSocketFactory.cpp - IDataSocket.cpp - XSocket.cpp -) - -if (WIN32) - list(APPEND src ${inc}) +if (SYNERGY_ADD_HEADERS) + list(APPEND sources ${headers}) endif() -set(inc +include_directories( ../arch ../base ../common @@ -53,13 +31,12 @@ set(inc ) if (UNIX) - list(APPEND inc + include_directories( ../../.. ) endif() -include_directories(${inc}) -add_library(net STATIC ${src}) +add_library(net STATIC ${sources}) if (UNIX) target_link_libraries(net mt io) diff --git a/src/lib/platform/CMakeLists.txt b/src/lib/platform/CMakeLists.txt index 551f9305..eddf9952 100644 --- a/src/lib/platform/CMakeLists.txt +++ b/src/lib/platform/CMakeLists.txt @@ -15,88 +15,21 @@ # along with this program. If not, see . if (WIN32) - - set(inc - CMSWindowsClipboard.h - CMSWindowsClipboardAnyTextConverter.h - CMSWindowsClipboardBitmapConverter.h - CMSWindowsClipboardHTMLConverter.h - CMSWindowsClipboardTextConverter.h - CMSWindowsClipboardUTF16Converter.h - CMSWindowsDesks.h - CMSWindowsEventQueueBuffer.h - CMSWindowsKeyState.h - CMSWindowsScreen.h - CMSWindowsScreenSaver.h - CMSWindowsUtil.h - CMSWindowsWatchdog.h - CMSWindowsHookLibraryLoader.h - IMSWindowsClipboardFacade.h - CMSWindowsDebugOutputter.h - CMSWindowsSession.h - ) - - set(src - CMSWindowsClipboard.cpp - CMSWindowsClipboardFacade.cpp - CMSWindowsClipboardAnyTextConverter.cpp - CMSWindowsClipboardBitmapConverter.cpp - CMSWindowsClipboardHTMLConverter.cpp - CMSWindowsClipboardTextConverter.cpp - CMSWindowsClipboardUTF16Converter.cpp - CMSWindowsDesks.cpp - CMSWindowsEventQueueBuffer.cpp - CMSWindowsKeyState.cpp - CMSWindowsScreen.cpp - CMSWindowsScreenSaver.cpp - CMSWindowsUtil.cpp - CMSWindowsWatchdog.cpp - CMSWindowsHookLibraryLoader.cpp - CMSWindowsDebugOutputter.cpp - CMSWindowsSession.cpp - ) - - list(APPEND src - ${inc} - ) - + file(GLOB headers "CMSWindows*.h") + file(GLOB sources "CMSWindows*.cpp") elseif (APPLE) - - set(src - COSXClipboard.cpp - COSXClipboardAnyTextConverter.cpp - COSXClipboardTextConverter.cpp - COSXClipboardUTF16Converter.cpp - COSXEventQueueBuffer.cpp - COSXKeyState.cpp - COSXScreen.cpp - COSXScreenSaver.cpp - COSXScreenSaverUtil.m - COSXPasteboardPeeker.m - COSXDragSimulator.m - COSXDragView.m - ) - + file(GLOB headers "COSX*.h") + file(GLOB sources "COSX*.cpp") elseif (UNIX) - - set(src - CXWindowsClipboard.cpp - CXWindowsClipboardAnyBitmapConverter.cpp - CXWindowsClipboardBMPConverter.cpp - CXWindowsClipboardHTMLConverter.cpp - CXWindowsClipboardTextConverter.cpp - CXWindowsClipboardUCS2Converter.cpp - CXWindowsClipboardUTF8Converter.cpp - CXWindowsEventQueueBuffer.cpp - CXWindowsKeyState.cpp - CXWindowsScreen.cpp - CXWindowsScreenSaver.cpp - CXWindowsUtil.cpp - ) - + file(GLOB headers "CXWindows*.h") + file(GLOB sources "CXWindows*.cpp") endif() -set(inc +if (SYNERGY_ADD_HEADERS) + list(APPEND sources ${headers}) +endif() + +include_directories( ../arch ../base ../common @@ -112,7 +45,7 @@ set(inc ) if (UNIX) - list(APPEND inc + include_directories( ../../.. ) endif() @@ -124,7 +57,7 @@ if (APPLE) endif() include_directories(${inc}) -add_library(platform STATIC ${src}) +add_library(platform STATIC ${sources}) target_link_libraries(platform client ${libs}) if (UNIX) @@ -132,6 +65,6 @@ if (UNIX) endif() if (APPLE) - FIND_LIBRARY(COCOA_LIBRARY Cocoa) + find_library(COCOA_LIBRARY Cocoa) target_link_libraries(platform ${COCOA_LIBRARY}) endif() diff --git a/src/lib/server/CMakeLists.txt b/src/lib/server/CMakeLists.txt index 5015dbf2..353cb05d 100644 --- a/src/lib/server/CMakeLists.txt +++ b/src/lib/server/CMakeLists.txt @@ -14,45 +14,14 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -set(inc - CBaseClientProxy.h - CClientListener.h - CClientProxy.h - CClientProxy1_0.h - CClientProxy1_1.h - CClientProxy1_2.h - CClientProxy1_3.h - CClientProxy1_4.h - CClientProxy1_5.h - CClientProxyUnknown.h - CConfig.h - CInputFilter.h - CPrimaryClient.h - CServer.h -) +file(GLOB headers "*.h") +file(GLOB sources "*.cpp") -set(src - CBaseClientProxy.cpp - CClientListener.cpp - CClientProxy.cpp - CClientProxy1_0.cpp - CClientProxy1_1.cpp - CClientProxy1_2.cpp - CClientProxy1_3.cpp - CClientProxy1_4.cpp - CClientProxy1_5.cpp - CClientProxyUnknown.cpp - CConfig.cpp - CInputFilter.cpp - CPrimaryClient.cpp - CServer.cpp -) - -if (WIN32) - list(APPEND src ${inc}) +if (SYNERGY_ADD_HEADERS) + list(APPEND sources ${headers}) endif() -set(inc +include_directories( ../arch ../base ../common @@ -64,13 +33,12 @@ set(inc ) if (UNIX) - list(APPEND inc + include_directories( ../../.. ) endif() -include_directories(${inc}) -add_library(server STATIC ${src}) +add_library(server STATIC ${sources}) if (UNIX) target_link_libraries(server synergy) diff --git a/src/lib/synergy/CMakeLists.txt b/src/lib/synergy/CMakeLists.txt index dbb5dd11..ce21882f 100644 --- a/src/lib/synergy/CMakeLists.txt +++ b/src/lib/synergy/CMakeLists.txt @@ -14,89 +14,26 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -set(inc - CClientTaskBarReceiver.h - CServerTaskBarReceiver.h - CPortableTaskBarReceiver.h - CApp.h - CClientApp.h - CServerApp.h - CClipboard.h - CKeyMap.h - CKeyState.h - CPacketStreamFilter.h - CPlatformScreen.h - CProtocolUtil.h - CScreen.h - ClipboardTypes.h - IClient.h - IClipboard.h - IKeyState.h - IPlatformScreen.h - IPrimaryScreen.h - IScreen.h - IScreenSaver.h - ISecondaryScreen.h - KeyTypes.h - MouseTypes.h - OptionTypes.h - ProtocolTypes.h - XScreen.h - XSynergy.h - CDaemonApp.h - CAppUtil.h - CArgsBase.h - IAppUtil.h - CFileChunker.h - CDragInformation.h - CToolApp.h -) +file(GLOB headers "*.h") +file(GLOB sources "*.cpp") -set(src - CClientTaskBarReceiver.cpp - CServerTaskBarReceiver.cpp - CPortableTaskBarReceiver.cpp - CApp.cpp - CClientApp.cpp - CServerApp.cpp - CClipboard.cpp - CKeyMap.cpp - CKeyState.cpp - CPacketStreamFilter.cpp - CPlatformScreen.cpp - CProtocolUtil.cpp - CScreen.cpp - IClipboard.cpp - IKeyState.cpp - IPrimaryScreen.cpp - KeyTypes.cpp - ProtocolTypes.cpp - XScreen.cpp - XSynergy.cpp - CDaemonApp.cpp - CAppUtil.cpp - CArgsBase.cpp - CFileChunker.cpp - CDragInformation.cpp - CToolApp.cpp -) +# remove files which are not cross platform +list(REMOVE_ITEM headers "*Windows*") +list(REMOVE_ITEM headers "*Unix*") +# arch if (WIN32) - list(APPEND inc - CAppUtilWindows.h - ) - - list(APPEND src - ${inc} - CAppUtilWindows.cpp - ) -elseif(UNIX) - list(APPEND src - CAppUtilUnix.cpp - ) + file(GLOB arch_sources "*Windows*.cpp") + file(GLOB arch_headers "*Windows*.h") +elseif (UNIX) + file(GLOB arch_sources "*Unix*.cpp") + file(GLOB arch_headers "*Unix*.h") endif() -set(inc +list(APPEND sources ${arch_sources}) +list(APPEND headers ${arch_headers}) + +include_directories( ../arch ../base ../client @@ -115,13 +52,12 @@ set(inc ) if (UNIX) - list(APPEND inc + include_directories( ../../.. ) endif() -include_directories(${inc}) -add_library(synergy STATIC ${src}) +add_library(synergy STATIC ${sources}) if (UNIX) target_link_libraries(synergy arch client ipc net base platform mt server) diff --git a/src/lib/synwinhk/CMakeLists.txt b/src/lib/synwinhk/CMakeLists.txt index fc9a0fb9..314973fd 100644 --- a/src/lib/synwinhk/CMakeLists.txt +++ b/src/lib/synwinhk/CMakeLists.txt @@ -13,25 +13,19 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -set(headers - synwinhk.h -) +file(GLOB headers "*.h") +file(GLOB sources "*.cpp") -set(source - synwinhk.cpp -) +if (SYNERGY_ADD_HEADERS) + list(APPEND sources ${headers}) +endif() -list(APPEND source - ${headers} -) - -set(includes +include_directories( ../common ../synergy ) -include_directories(${includes}) -add_library(synwinhk SHARED ${source}) +add_library(synwinhk SHARED ${sources}) # copy the dlls (and supporting files) from the lib dir to # the bin dir, so that synergyc and synergys can easily find them. diff --git a/src/lib/synwinxt/CMakeLists.txt b/src/lib/synwinxt/CMakeLists.txt index 109e78fd..f4c0f120 100644 --- a/src/lib/synwinxt/CMakeLists.txt +++ b/src/lib/synwinxt/CMakeLists.txt @@ -13,31 +13,20 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -set(headers - CClassFactory.h - CDataHandlerExtension.h - synwinxt.h -) +file(GLOB headers "*.h") +file(GLOB sources "*.cpp" "*.def") -set(source - CClassFactory.cpp - CDataHandlerExtension.cpp - synwinxt.cpp - synwinxt.def -) +if (SYNERGY_ADD_HEADERS) + list(APPEND sources ${headers}) +endif() -list(APPEND source - ${headers} -) - -set(includes +include_directories( ../arch ../base ../common ) -include_directories(${includes}) -add_library(synwinxt SHARED ${source}) +add_library(synwinxt SHARED ${sources}) target_link_libraries(synwinxt arch base common ${libs}) diff --git a/src/micro/CMakeLists.txt b/src/micro/CMakeLists.txt index 281e1504..1a0fcc80 100644 --- a/src/micro/CMakeLists.txt +++ b/src/micro/CMakeLists.txt @@ -14,12 +14,11 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -set(src - uSynergy.c -) +file(GLOB headers "*.h") +file(GLOB sources "*.c") -if (WIN32) - list(APPEND src uSynergy.h) +if (SYNERGY_ADD_HEADERS) + list(APPEND sources ${headers}) endif() -add_library(micro STATIC ${src}) +add_library(micro STATIC ${sources}) diff --git a/src/plugin/winmmjoy/CMakeLists.txt b/src/plugin/winmmjoy/CMakeLists.txt index 9ab71e69..11ae9b03 100644 --- a/src/plugin/winmmjoy/CMakeLists.txt +++ b/src/plugin/winmmjoy/CMakeLists.txt @@ -14,16 +14,14 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -set(inc - winmmjoy.h -) +file(GLOB headers "*.h") +file(GLOB sources "*.cpp") -set(src - winmmjoy.cpp - ${inc} -) +if (SYNERGY_ADD_HEADERS) + list(APPEND sources ${headers}) +endif() -add_library(winmmjoy SHARED ${inc} ${src}) +add_library(winmmjoy SHARED ${sources}) add_custom_command( TARGET winmmjoy diff --git a/src/test/integtests/CMakeLists.txt b/src/test/integtests/CMakeLists.txt index 8fd76fb6..3e4db263 100644 --- a/src/test/integtests/CMakeLists.txt +++ b/src/test/integtests/CMakeLists.txt @@ -14,51 +14,41 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -set(h - CTestEventQueue.h -) - -set(src - ${h} - Main.cpp - CIpcTests.cpp - NetworkTests.cpp - CTestEventQueue.cpp -) +file(GLOB headers "*.h") +file(GLOB sources "*.cpp") # arch if (WIN32) - list(APPEND src - arch/CArchInternetWindowsTests.cpp - ) + file(GLOB arch_sources "arch/CArchWindows*.cpp") + file(GLOB arch_headers "arch/CArchWindows*.h") elseif (UNIX) - list(APPEND src - arch/CArchInternetUnixTests.cpp - ) + file(GLOB arch_sources "arch/CArchUnix*.cpp") + file(GLOB arch_headers "arch/CArchUnix*.h") endif() +list(APPEND sources ${arch_sources}) +list(APPEND headers ${arch_headers}) + # platform if (WIN32) - list(APPEND src - platform/CMSWindowsClipboardTests.cpp - platform/CMSWindowsKeyStateTests.cpp - ) + file(GLOB platform_sources "platform/CMSWindows*.cpp") + file(GLOB platform_headers "platform/CMSWindows*.h") elseif (APPLE) - list(APPEND src - platform/COSXClipboardTests.cpp - platform/COSXKeyStateTests.cpp - platform/COSXScreenTests.cpp - ) + file(GLOB platform_sources "platform/COSX*.cpp") + file(GLOB platform_headers "platform/COSX*.h") elseif (UNIX) - list(APPEND src - platform/CXWindowsClipboardTests.cpp - platform/CXWindowsKeyStateTests.cpp - platform/CXWindowsScreenTests.cpp - platform/CXWindowsScreenSaverTests.cpp - ) + file(GLOB platform_sources "platform/CXWindows*.cpp") + file(GLOB platform_headers "platform/CXWindows*.h") endif() -set(inc +list(APPEND sources ${platform_sources}) +list(APPEND headers ${platform_headers}) + +if (SYNERGY_ADD_HEADERS) + list(APPEND sources ${headers}) +endif() + +include_directories( ../../lib/arch ../../lib/base ../../lib/client @@ -78,12 +68,11 @@ set(inc ) if (UNIX) - list(APPEND inc + include_directories( ../../.. ) endif() -include_directories(${inc}) -add_executable(integtests ${src}) +add_executable(integtests ${sources}) target_link_libraries(integtests arch base client common io ipc mt net platform server synergy gtest gmock cryptopp ${libs}) diff --git a/src/test/unittests/CMakeLists.txt b/src/test/unittests/CMakeLists.txt index bb12f151..b3eef25e 100644 --- a/src/test/unittests/CMakeLists.txt +++ b/src/test/unittests/CMakeLists.txt @@ -14,31 +14,10 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -set(h - synergy/CKeyStateTests.h - synergy/CMockEventQueue.h - synergy/CMockKeyMap.h - client/CMockClient.h - io/CMockStream.h - server/CMockServer.h - io/CMockCryptoStream.h - synergy/CMockScreen.h - server/CMockConfig.h - server/CMockPrimaryClient.h - server/CMockInputFilter.h -) +file(GLOB_RECURSE headers "*.h") +file(GLOB_RECURSE sources "*.cpp") -set(src - ${h} - Main.cpp - synergy/CClipboardTests.cpp - synergy/CKeyStateTests.cpp - client/CServerProxyTests.cpp - synergy/CCryptoStreamTests.cpp - server/CClientProxyTests.cpp -) - -set(inc +include_directories( ../../lib/arch ../../lib/base ../../lib/client @@ -57,12 +36,15 @@ set(inc ) if (UNIX) - list(APPEND inc + include_directories( ../../.. ) endif() -include_directories(${inc}) -add_executable(unittests ${src}) +if (SYNERGY_ADD_HEADERS) + list(APPEND sources ${headers}) +endif() + +add_executable(unittests ${sources}) target_link_libraries(unittests arch base client server common io net platform server synergy mt gtest gmock cryptopp ${libs})