From 1ec2a7a80c9ac3b24b2d4450a5789c6cc8fc87f7 Mon Sep 17 00:00:00 2001 From: BostonVaulter Date: Fri, 28 Jan 2011 19:00:01 +0000 Subject: [PATCH] Integrated google test into the cmake build --- CMakeLists.txt | 3 ++ cmake/CMakeLists_lib.txt | 2 + cmake/CMakeLists_test.txt | 91 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 96 insertions(+) create mode 100644 cmake/CMakeLists_test.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index ca83bbdf..bd5bfbe3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -54,6 +54,9 @@ INCLUDE(${cmake_dir}/CMakeLists_lib.txt) INCLUDE(${cmake_dir}/CMakeLists_synergyc.txt) INCLUDE(${cmake_dir}/CMakeLists_synergys.txt) INCLUDE(${cmake_dir}/CMakeLists_launcher.txt) +INCLUDE(${cmake_dir}/CMakeLists_test.txt) + +add_subdirectory(third_party/gtest) if (CONF_CPACK) # Setup the CPack config. diff --git a/cmake/CMakeLists_lib.txt b/cmake/CMakeLists_lib.txt index ccfeed0f..82aba9ce 100644 --- a/cmake/CMakeLists_lib.txt +++ b/cmake/CMakeLists_lib.txt @@ -300,6 +300,7 @@ SET(src_lib_synergy ${root_lib}/synergy/CPacketStreamFilter.cpp ${root_lib}/synergy/CPlatformScreen.cpp ${root_lib}/synergy/CProtocolUtil.cpp + ${root_lib}/synergy/CProtocolUtilTest.cpp ${root_lib}/synergy/CScreen.cpp ${root_lib}/synergy/IClipboard.cpp ${root_lib}/synergy/IKeyState.cpp @@ -309,6 +310,7 @@ SET(src_lib_synergy ${root_lib}/synergy/ProtocolTypes.cpp ${root_lib}/synergy/XScreen.cpp ${root_lib}/synergy/XSynergy.cpp + ${root_dir}/third_party/gtest/src/gtest-all.cc ) SET(inc_lib_synergy diff --git a/cmake/CMakeLists_test.txt b/cmake/CMakeLists_test.txt new file mode 100644 index 00000000..ce11e975 --- /dev/null +++ b/cmake/CMakeLists_test.txt @@ -0,0 +1,91 @@ +# synergy -- mouse and keyboard sharing utility +# Copyright (C) 2009 Chris Schoeneman, Nick Bolton, Sorin Sbarnea +# +# This package is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# found in the file COPYING that should have accompanied this file. +# +# This package is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +SET(root_cmd_synergyc ${root_dir}/cmd/synergyc) + +SET(src_cmd_synergyc_common + ${root_dir}/lib/synergy/CProtocolUtilTest.cpp + ${root_dir}/third_party/gtest/src/gtest-all.cc + #${root_cmd_synergyc}/synergyc.cpp +) + +SET(src_cmd_synergyc_xwindows + ${root_cmd_synergyc}/CXWindowsClientTaskBarReceiver.cpp +) + +SET(src_cmd_synergyc_mswindows + ${root_cmd_synergyc}/CMSWindowsClientTaskBarReceiver.cpp +) + +SET(inc_cmd_synergyc_mswindows + ${root_cmd_synergyc}/CMSWindowsClientTaskBarReceiver.h + ${root_cmd_synergyc}/resource.h +) + +SET(res_cmd_synergyc_mswindows + ${root_cmd_synergyc}/synergyc.ico + ${root_cmd_synergyc}/synergyc.rc + ${root_cmd_synergyc}/tb_error.ico + ${root_cmd_synergyc}/tb_idle.ico + ${root_cmd_synergyc}/tb_run.ico + ${root_cmd_synergyc}/tb_wait.ico +) + +SET(src_cmd_synergyc_carbon + ${root_cmd_synergyc}/COSXClientTaskBarReceiver.cpp +) + +SET(src_cmd_synergyc ${src_cmd_synergyc_common}) + +IF(UNIX) + + IF(APPLE) + LIST(APPEND src_cmd_synergyc ${src_cmd_synergyc_carbon}) + ELSE(APPLE) + LIST(APPEND src_cmd_synergyc ${src_cmd_synergyc_xwindows}) + ENDIF(APPLE) + +ELSE(UNIX) + + LIST(APPEND src_cmd_synergyc + ${inc_cmd_synergyc_mswindows} + ${res_cmd_synergyc_mswindows} + ${src_cmd_synergyc_mswindows} + ) + +ENDIF(UNIX) + +SET(inc_dirs_test + ${root_dir} + ${root_dir}/lib + ${root_dir}/lib/arch + ${root_dir}/lib/base + ${root_dir}/lib/client + ${root_dir}/lib/common + ${root_dir}/lib/io + ${root_dir}/lib/mt + ${root_dir}/lib/net + ${root_dir}/lib/platform + ${root_dir}/lib/synergy + ${root_dir}/third_party/gtest + ${root_dir}/third_party/gtest/include +) + +INCLUDE_DIRECTORIES(${inc_dirs_test}) +#ADD_EXECUTABLE(tests ${root_dir}/third_party/gtest/src/gtest-all.cc) +#ADD_EXECUTABLE(tests ${root_dir}/lib/synergy/CProtocolUtilTest.cpp) +ADD_LIBRARY(prototest STATIC ${src_cmd_synergyc_common}) +ADD_EXECUTABLE(tests ${root_dir}/third_party/gtest/src/gtest_main.cc) +TARGET_LINK_LIBRARIES(tests synergy prototest ${libs})