From 9dc96ef0a06df108588f4936b87c3ac2dafa8b55 Mon Sep 17 00:00:00 2001 From: Nick Bolton Date: Mon, 25 Apr 2011 16:52:35 +0000 Subject: [PATCH] reformatted cmake config files --- CMakeLists.txt | 61 ++++---- cmake/CMakeLists_config.txt | 264 +++++++++++++++++----------------- cmake/CMakeLists_cpack.txt | 42 +++--- cmake/CMakeLists_doxygen.txt | 5 +- cmake/CMakeLists_gtest.txt | 6 +- cmake/CMakeLists_launcher.txt | 48 +++---- cmake/CMakeLists_lib.txt | 90 ++++++------ cmake/CMakeLists_synergyc.txt | 42 +++--- cmake/CMakeLists_synergys.txt | 42 +++--- cmake/CMakeLists_test.txt | 8 +- 10 files changed, 299 insertions(+), 309 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4368bbbc..7b687f47 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,60 +14,60 @@ # along with this program. If not, see . # Version number for Synergy -SET(VERSION_MAJOR 1) -SET(VERSION_MINOR 5) -SET(VERSION_REV 0) -SET(VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_REV}") +set(VERSION_MAJOR 1) +set(VERSION_MINOR 5) +set(VERSION_REV 0) +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) +cmake_minimum_required(VERSION 2.4.7) # CMake complains if we don't have this. -IF(COMMAND cmake_policy) +if (COMMAND cmake_policy) CMAKE_POLICY(SET CMP0003 NEW) -ENDIF(COMMAND cmake_policy) +endif() # We're escaping quotes in the Windows version number, because # for some reason CMake won't do it at config version 2.4.7 # It seems that this restores the newer behaviour where define # args are not auto-escaped. -IF(COMMAND cmake_policy) +if (COMMAND cmake_policy) CMAKE_POLICY(SET CMP0005 NEW) -ENDIF(COMMAND cmake_policy) +endif() # First, declare project (important for prerequisite checks). -PROJECT(synergy C CXX) +project(synergy C CXX) # Set some easy to type variables. -SET(root_dir ${CMAKE_SOURCE_DIR}) -SET(cmake_dir ${root_dir}/cmake) -SET(bin_dir ${root_dir}/bin) -SET(doc_dir ${root_dir}/doc) -SET(doc_dir ${root_dir}/doc) +set(root_dir ${CMAKE_SOURCE_DIR}) +set(cmake_dir ${root_dir}/cmake) +set(bin_dir ${root_dir}/bin) +set(doc_dir ${root_dir}/doc) +set(doc_dir ${root_dir}/doc) # Now for the stuff to generate config.h (and setup defines). -INCLUDE(${cmake_dir}/CMakeLists_config.txt) +include(${cmake_dir}/CMakeLists_config.txt) # Now for all the executables and libraries. -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_gtest.txt) -INCLUDE(${cmake_dir}/CMakeLists_test.txt) +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_gtest.txt) +include(${cmake_dir}/CMakeLists_test.txt) if (CONF_CPACK) # Setup the CPack config. - INCLUDE(${cmake_dir}/CMakeLists_cpack.txt) + include(${cmake_dir}/CMakeLists_cpack.txt) endif() if (CONF_DOXYGEN) # Setup doxygen - INCLUDE(${cmake_dir}/CMakeLists_doxygen.txt) + include(${cmake_dir}/CMakeLists_doxygen.txt) endif() -IF(WIN32) +if (WIN32) # add /analyze in order to unconver potential bugs in the source code # Details: http://msdn.microsoft.com/en-us/library/fwkeyyhe.aspx # add /FR to generate browse information (ncb files) usefull for using IDE @@ -83,17 +83,16 @@ IF(WIN32) # added _SECURE_SCL=1 for finding bugs with iterators - http://msdn.microsoft.com/en-us/library/aa985965.aspx # common args between all vs builds - SET(VS_ARGS "/FR /MP /D _BIND_TO_CURRENT_VCLIBS_VERSION=1 /D _SECURE_SCL=1 ${VS_ARGS_EXTRA}") + set(VS_ARGS "/FR /MP /D _BIND_TO_CURRENT_VCLIBS_VERSION=1 /D _SECURE_SCL=1 ${VS_ARGS_EXTRA}") # we may use `cmake -D VS_ARGS_EXTRA="/analyze"` for example to specify # analyze mode (since we don't always want to use it; e.g. on non-team # or non-x86 compiler editions where there's no support) - SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${VS_ARGS}") - SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} ${VS_ARGS}") + set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${VS_ARGS}") + set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} ${VS_ARGS}") # this line removes "/D NDEBUG" from release, we want them in order to # find bugs even on release builds. - SET(CMAKE_CXX_FLAGS_RELEASE "/MD /O2 /Ob2") - -ENDIF(WIN32) + set(CMAKE_CXX_FLAGS_RELEASE "/MD /O2 /Ob2") +endif() diff --git a/cmake/CMakeLists_config.txt b/cmake/CMakeLists_config.txt index a5e93db4..4fff9e0a 100644 --- a/cmake/CMakeLists_config.txt +++ b/cmake/CMakeLists_config.txt @@ -16,207 +16,199 @@ # Declare libs, so we can use list in linker later. There's probably # a more elegant way of doing this; with SCons, when you check for the # lib, it is automatically passed to the linker. -SET(libs) +set(libs) # Depending on the platform, pass in the required defines. -IF(UNIX) +if (UNIX) # For config.h, detect the libraries, functions, etc. - INCLUDE(CheckIncludeFiles) - INCLUDE(CheckLibraryExists) - INCLUDE(CheckFunctionExists) - INCLUDE(CheckTypeSize) - INCLUDE(CheckIncludeFileCXX) - INCLUDE(CheckSymbolExists) - INCLUDE(CheckCSourceCompiles) + include(CheckIncludeFiles) + include(CheckLibraryExists) + include(CheckFunctionExists) + include(CheckTypeSize) + include(CheckIncludeFileCXX) + include(CheckSymbolExists) + include(CheckCSourceCompiles) - CHECK_INCLUDE_FILE_CXX(istream HAVE_ISTREAM) - CHECK_INCLUDE_FILE_CXX(ostream HAVE_OSTREAM) - CHECK_INCLUDE_FILE_CXX(sstream HAVE_SSTREAM) + check_include_file_cxx(istream HAVE_ISTREAM) + check_include_file_cxx(ostream HAVE_OSTREAM) + check_include_file_cxx(sstream HAVE_SSTREAM) - CHECK_INCLUDE_FILES(inttypes.h HAVE_INTTYPES_H) - CHECK_INCLUDE_FILES(locale.h HAVE_LOCALE_H) - CHECK_INCLUDE_FILES(memory.h HAVE_MEMORY_H) - CHECK_INCLUDE_FILES(stdlib.h HAVE_STDLIB_H) - CHECK_INCLUDE_FILES(strings.h HAVE_STRINGS_H) - CHECK_INCLUDE_FILES(string.h HAVE_STRING_H) - CHECK_INCLUDE_FILES(sys/select.h HAVE_SYS_SELECT_H) - CHECK_INCLUDE_FILES(sys/socket.h HAVE_SYS_SOCKET_H) - CHECK_INCLUDE_FILES(sys/stat.h HAVE_SYS_STAT_H) - CHECK_INCLUDE_FILES(sys/time.h HAVE_SYS_TIME_H) - CHECK_INCLUDE_FILES(sys/utsname.h HAVE_SYS_UTSNAME_H) - CHECK_INCLUDE_FILES(unistd.h HAVE_UNISTD_H) - CHECK_INCLUDE_FILES(wchar.h HAVE_WCHAR_H) + check_include_files(inttypes.h HAVE_INTTYPES_H) + check_include_files(locale.h HAVE_LOCALE_H) + check_include_files(memory.h HAVE_MEMORY_H) + check_include_files(stdlib.h HAVE_STDLIB_H) + check_include_files(strings.h HAVE_STRINGS_H) + check_include_files(string.h HAVE_STRING_H) + check_include_files(sys/select.h HAVE_SYS_SELECT_H) + check_include_files(sys/socket.h HAVE_SYS_SOCKET_H) + check_include_files(sys/stat.h HAVE_SYS_STAT_H) + check_include_files(sys/time.h HAVE_SYS_TIME_H) + check_include_files(sys/utsname.h HAVE_SYS_UTSNAME_H) + check_include_files(unistd.h HAVE_UNISTD_H) + check_include_files(wchar.h HAVE_WCHAR_H) - CHECK_FUNCTION_EXISTS(getpwuid_r HAVE_GETPWUID_R) - CHECK_FUNCTION_EXISTS(gmtime_r HAVE_GMTIME_R) - CHECK_FUNCTION_EXISTS(nanosleep HAVE_NANOSLEEP) - CHECK_FUNCTION_EXISTS(poll HAVE_POLL) - CHECK_FUNCTION_EXISTS(sigwait HAVE_POSIX_SIGWAIT) - CHECK_FUNCTION_EXISTS(strftime HAVE_STRFTIME) - CHECK_FUNCTION_EXISTS(vsnprintf HAVE_VSNPRINTF) - CHECK_FUNCTION_EXISTS(inet_aton HAVE_INET_ATON) + check_function_exists(getpwuid_r HAVE_GETPWUID_R) + check_function_exists(gmtime_r HAVE_GMTIME_R) + check_function_exists(nanosleep HAVE_NANOSLEEP) + check_function_exists(poll HAVE_POLL) + check_function_exists(sigwait HAVE_POSIX_SIGWAIT) + check_function_exists(strftime HAVE_STRFTIME) + check_function_exists(vsnprintf HAVE_VSNPRINTF) + check_function_exists(inet_aton HAVE_INET_ATON) - # For some reason, the CHECK_FUNCTION_EXISTS macro doesn't detect + # For some reason, the check_function_exists macro doesn't detect # the inet_aton on some pure Unix platforms (e.g. sunos5). So we # need to do a more detailed check and also include some extra libs. - IF(NOT HAVE_INET_ATON) + if (NOT HAVE_INET_ATON) - SET(CMAKE_REQUIRED_LIBRARIES nsl) - CHECK_C_SOURCE_COMPILES( + set(CMAKE_REQUIRED_LIBRARIES nsl) + check_c_source_compiles( "#include \n int main() { inet_aton(0, 0); }" HAVE_INET_ATON_ADV) - SET(CMAKE_REQUIRED_LIBRARIES) + set(CMAKE_REQUIRED_LIBRARIES) - IF(HAVE_INET_ATON_ADV) + if (HAVE_INET_ATON_ADV) # Override the previous fail. - SET(HAVE_INET_ATON 1) + set(HAVE_INET_ATON 1) # Assume that both nsl and socket will be needed, # it seems safe to add socket on the back of nsl, # since socket only ever needed when nsl is needed. - LIST(APPEND libs nsl socket) + list(APPEND libs nsl socket) - ENDIF(HAVE_INET_ATON_ADV) + endif() - ENDIF(NOT HAVE_INET_ATON) + endif() - CHECK_TYPE_SIZE(char SIZEOF_CHAR) - CHECK_TYPE_SIZE(int SIZEOF_INT) - CHECK_TYPE_SIZE(long SIZEOF_LONG) - CHECK_TYPE_SIZE(short SIZEOF_SHORT) + check_type_size(char SIZEOF_CHAR) + check_type_size(int SIZEOF_INT) + check_type_size(long SIZEOF_LONG) + check_type_size(short SIZEOF_SHORT) # pthread is used on both Linux and Mac - CHECK_LIBRARY_EXISTS("pthread" pthread_create "" HAVE_PTHREAD) - IF(HAVE_PTHREAD) - LIST(APPEND libs pthread) - ELSE(HAVE_PTHREAD) - MESSAGE(FATAL_ERROR "Missing library: pthread") - ENDIF(HAVE_PTHREAD) + check_library_exists("pthread" pthread_create "" HAVE_PTHREAD) + if (HAVE_PTHREAD) + list(APPEND libs pthread) + else (HAVE_PTHREAD) + message(FATAL_ERROR "Missing library: pthread") + endif() - IF(APPLE) + if (APPLE) # build mac os x universal set(CMAKE_OSX_ARCHITECTURES "ppc;i386" CACHE STRING "Build architectures for OSX" FORCE) - # TODO: fix 64-bit failures - #set(CMAKE_OSX_ARCHITECTURES "ppc;i386;ppc64;x86_64" - # CACHE STRING "Build architectures for OSX" FORCE) + find_library(lib_ScreenSaver ScreenSaver) + find_library(lib_IOKit IOKit) + find_library(lib_ApplicationServices ApplicationServices) + find_library(lib_Foundation Foundation) + find_library(lib_Carbon Carbon) - # not sure this is a good idea - #set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mmacosx-version-min=10.5" - # CACHE STRING "Flags used by the compiler during all build types." FORCE) - - FIND_LIBRARY(lib_ScreenSaver ScreenSaver) - FIND_LIBRARY(lib_IOKit IOKit) - FIND_LIBRARY(lib_ApplicationServices ApplicationServices) - FIND_LIBRARY(lib_Foundation Foundation) - FIND_LIBRARY(lib_Carbon Carbon) - - LIST(APPEND libs - ${lib_ScreenSaver} - ${lib_IOKit} - ${lib_ApplicationServices} - ${lib_Foundation} - ${lib_Carbon} + list(APPEND libs + ${lib_ScreenSaver} + ${lib_IOKit} + ${lib_ApplicationServices} + ${lib_Foundation} + ${lib_Carbon} ) - ELSE(APPLE) + else (APPLE) - SET(XKBlib "X11/XKBlib.h") - CHECK_INCLUDE_FILES("${XKBlib};X11/extensions/dpms.h" HAVE_X11_EXTENSIONS_DPMS_H) - CHECK_INCLUDE_FILES("X11/extensions/Xinerama.h" HAVE_X11_EXTENSIONS_XINERAMA_H) - CHECK_INCLUDE_FILES("${XKBlib};X11/extensions/XKBstr.h" HAVE_X11_EXTENSIONS_XKBSTR_H) - CHECK_INCLUDE_FILES("X11/extensions/XKB.h" HAVE_XKB_EXTENSION) - CHECK_INCLUDE_FILES("X11/extensions/XTest.h" HAVE_X11_EXTENSIONS_XTEST_H) - CHECK_INCLUDE_FILES(${XKBlib} HAVE_X11_XKBLIB_H) + set(XKBlib "X11/XKBlib.h") + check_include_files("${XKBlib};X11/extensions/dpms.h" HAVE_X11_EXTENSIONS_DPMS_H) + check_include_files("X11/extensions/Xinerama.h" HAVE_X11_EXTENSIONS_XINERAMA_H) + check_include_files("${XKBlib};X11/extensions/XKBstr.h" HAVE_X11_EXTENSIONS_XKBSTR_H) + check_include_files("X11/extensions/XKB.h" HAVE_XKB_EXTENSION) + check_include_files("X11/extensions/XTest.h" HAVE_X11_EXTENSIONS_XTEST_H) + check_include_files(${XKBlib} HAVE_X11_XKBLIB_H) - IF(HAVE_X11_EXTENSIONS_DPMS_H) + if (HAVE_X11_EXTENSIONS_DPMS_H) # Assume that function prototypes declared, when include exists. - SET(HAVE_DPMS_PROTOTYPES 1) - ENDIF(HAVE_X11_EXTENSIONS_DPMS_H) + set(HAVE_DPMS_PROTOTYPES 1) + endif() - IF(NOT HAVE_X11_XKBLIB_H) - MESSAGE(FATAL_ERROR "Missing header: " ${XKBlib}) - ENDIF(NOT HAVE_X11_XKBLIB_H) + if (NOT HAVE_X11_XKBLIB_H) + message(FATAL_ERROR "Missing header: " ${XKBlib}) + endif() - CHECK_LIBRARY_EXISTS("SM;ICE" IceConnectionNumber "" HAVE_ICE) - CHECK_LIBRARY_EXISTS("X11;Xext" DPMSQueryExtension "" HAVE_Xext) - CHECK_LIBRARY_EXISTS("X11;Xext;Xtst" XTestQueryExtension "" HAVE_Xtst) - CHECK_LIBRARY_EXISTS("Xinerama" XineramaQueryExtension "" HAVE_Xinerama) + check_library_exists("SM;ICE" IceConnectionNumber "" HAVE_ICE) + check_library_exists("X11;Xext" DPMSQueryExtension "" HAVE_Xext) + check_library_exists("X11;Xext;Xtst" XTestQueryExtension "" HAVE_Xtst) + check_library_exists("Xinerama" XineramaQueryExtension "" HAVE_Xinerama) - IF(HAVE_ICE) + if (HAVE_ICE) # Assume we have SM if we have ICE. - SET(HAVE_SM 1) - LIST(APPEND libs SM ICE) + set(HAVE_SM 1) + list(APPEND libs SM ICE) - ENDIF(HAVE_ICE) + endif() - IF(HAVE_Xtst) + if (HAVE_Xtst) # Xtxt depends on X11. - SET(HAVE_X11) - LIST(APPEND libs X11 Xtst) + set(HAVE_X11) + list(APPEND libs X11 Xtst) - ELSE(HAVE_Xtst) + else (HAVE_Xtst) - MESSAGE(FATAL_ERROR "Missing library: Xtst") + message(FATAL_ERROR "Missing library: Xtst") - ENDIF(HAVE_Xtst) + endif() - IF(HAVE_Xext) - LIST(APPEND libs Xext) - ENDIF(HAVE_Xext) + if (HAVE_Xext) + list(APPEND libs Xext) + endif() - IF(HAVE_Xinerama) - LIST(APPEND libs Xinerama) - ELSE(HAVE_Xinerama) - IF(HAVE_X11_EXTENSIONS_XINERAMA_H) - MESSAGE(FATAL_ERROR "Missing library: Xinerama") - ENDIF(HAVE_X11_EXTENSIONS_XINERAMA_H) - ENDIF(HAVE_Xinerama) + if (HAVE_Xinerama) + list(APPEND libs Xinerama) + else (HAVE_Xinerama) + if (HAVE_X11_EXTENSIONS_XINERAMA_H) + message(FATAL_ERROR "Missing library: Xinerama") + endif() + endif() - ENDIF(APPLE) + endif() # For config.h, set some static values; it may be a good idea to make # these values dynamic for non-standard UNIX compilers. - SET(ACCEPT_TYPE_ARG3 socklen_t) - SET(HAVE_CXX_BOOL 1) - SET(HAVE_CXX_CASTS 1) - SET(HAVE_CXX_EXCEPTIONS 1) - SET(HAVE_CXX_MUTABLE 1) - SET(HAVE_CXX_STDLIB 1) - SET(HAVE_PTHREAD_SIGNAL 1) - SET(SELECT_TYPE_ARG1 int) - SET(SELECT_TYPE_ARG234 "(fd_set *)") - SET(SELECT_TYPE_ARG5 "(struct timeval *)") - SET(STDC_HEADERS 1) - SET(TIME_WITH_SYS_TIME 1) - SET(HAVE_SOCKLEN_T 1) + set(ACCEPT_TYPE_ARG3 socklen_t) + set(HAVE_CXX_BOOL 1) + set(HAVE_CXX_CASTS 1) + set(HAVE_CXX_EXCEPTIONS 1) + set(HAVE_CXX_MUTABLE 1) + set(HAVE_CXX_STDLIB 1) + set(HAVE_PTHREAD_SIGNAL 1) + set(SELECT_TYPE_ARG1 int) + set(SELECT_TYPE_ARG234 "(fd_set *)") + set(SELECT_TYPE_ARG5 "(struct timeval *)") + set(STDC_HEADERS 1) + set(TIME_WITH_SYS_TIME 1) + set(HAVE_SOCKLEN_T 1) # For config.h, save the results based on a template (config.h.in). - CONFIGURE_FILE(${cmake_dir}/config.h.in ${root_dir}/config.h) + configure_file(${cmake_dir}/config.h.in ${root_dir}/config.h) - ADD_DEFINITIONS(-DSYSAPI_UNIX=1 -DHAVE_CONFIG_H) + add_definitions(-DSYSAPI_UNIX=1 -DHAVE_CONFIG_H) - IF(APPLE) - ADD_DEFINITIONS(-DWINAPI_CARBON=1 -D_THREAD_SAFE -DMACOSX_DEPLOYMENT_TARGET=10.4) - ELSE(APPLE) - ADD_DEFINITIONS(-DWINAPI_XWINDOWS=1) - ENDIF(APPLE) + if (APPLE) + add_definitions(-DWINAPI_CARBON=1 -D_THREAD_SAFE -DMACOSX_DEPLOYMENT_TARGET=10.4) + else (APPLE) + add_definitions(-DWINAPI_XWINDOWS=1) + endif() -ELSE(UNIX) +else (UNIX) - LIST(APPEND libs Wtsapi32 Userenv) + list(APPEND libs Wtsapi32 Userenv) - ADD_DEFINITIONS( + add_definitions( /DWIN32 /D_WINDOWS /D_CRT_SECURE_NO_WARNINGS /DVERSION=\"${VERSION}\" ) -ENDIF(UNIX) +endif() diff --git a/cmake/CMakeLists_cpack.txt b/cmake/CMakeLists_cpack.txt index 8c15aa29..ad722836 100644 --- a/cmake/CMakeLists_cpack.txt +++ b/cmake/CMakeLists_cpack.txt @@ -29,7 +29,7 @@ install(TARGETS if (UNIX) if (APPLE) # no cpack support for apple - else() + else () install(FILES bin/qsynergy DESTINATION bin PERMISSIONS @@ -48,33 +48,33 @@ endif() # The default CPack behaviour is not to append the system processor # type, which is undesirable in our case, since we want to support # both 32-bit and 64-bit processors. -SET(CPACK_SYSTEM_NAME ${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR}) +set(CPACK_SYSTEM_NAME ${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR}) # For source code, use .tar.gz on Unix, and .zip on Windows -IF(UNIX) - SET(CPACK_SOURCE_GENERATOR TGZ) -ELSE(UNIX) - SET(CPACK_SOURCE_GENERATOR ZIP) -ENDIF(UNIX) +if (UNIX) + set(CPACK_SOURCE_GENERATOR TGZ) +else (UNIX) + set(CPACK_SOURCE_GENERATOR ZIP) +endif() -if(APPLE) +if (APPLE) set(CPACK_SYSTEM_NAME "MacOSX-Universal") -endif(APPLE) +endif() -SET(CPACK_PACKAGE_NAME "synergy") -SET(CPACK_PACKAGE_VENDOR "The Synergy Project") -SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Synergy server and client") -SET(CPACK_PACKAGE_VERSION_MAJOR ${VERSION_MAJOR}) -SET(CPACK_PACKAGE_VERSION_MINOR ${VERSION_MINOR}) -SET(CPACK_PACKAGE_VERSION_PATCH ${VERSION_REV}) -SET(CPACK_PACKAGE_VERSION ${VERSION}) -SET(CPACK_PACKAGE_CONTACT http://synergy-foss.org/) -SET(CPACK_RESOURCE_FILE_LICENSE "${cmake_dir}/License.rtf") -SET(CPACK_RESOURCE_FILE_README "${cmake_dir}/Readme.txt") +set(CPACK_PACKAGE_NAME "synergy") +set(CPACK_PACKAGE_VENDOR "The Synergy Project") +set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Synergy server and client") +set(CPACK_PACKAGE_VERSION_MAJOR ${VERSION_MAJOR}) +set(CPACK_PACKAGE_VERSION_MINOR ${VERSION_MINOR}) +set(CPACK_PACKAGE_VERSION_PATCH ${VERSION_REV}) +set(CPACK_PACKAGE_VERSION ${VERSION}) +set(CPACK_PACKAGE_CONTACT http://synergy-foss.org/) +set(CPACK_RESOURCE_FILE_LICENSE "${cmake_dir}/License.rtf") +set(CPACK_RESOURCE_FILE_README "${cmake_dir}/Readme.txt") # files to exclude from src package (regex patterns) # to escape, use 4 backslashes (\\\\) -- yuck! -SET(CPACK_SOURCE_IGNORE_FILES +set(CPACK_SOURCE_IGNORE_FILES # temp output dir in root "/bin/" @@ -104,4 +104,4 @@ SET(CPACK_SOURCE_IGNORE_FILES ) # Must be last (since it relies of CPACK_ vars). -INCLUDE(CPack) +include(CPack) diff --git a/cmake/CMakeLists_doxygen.txt b/cmake/CMakeLists_doxygen.txt index ac776da3..c60ad525 100644 --- a/cmake/CMakeLists_doxygen.txt +++ b/cmake/CMakeLists_doxygen.txt @@ -13,8 +13,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -SET(VERSION, "${VERSION}") +set(VERSION, "${VERSION}") # For doxygen.cfg, save the results based on a template (doxygen.cfg.in). -CONFIGURE_FILE(${cmake_dir}/doxygen.cfg.in ${doc_dir}/doxygen.cfg) - +configure_file(${cmake_dir}/doxygen.cfg.in ${doc_dir}/doxygen.cfg) diff --git a/cmake/CMakeLists_gtest.txt b/cmake/CMakeLists_gtest.txt index ef7913f5..c16327f7 100644 --- a/cmake/CMakeLists_gtest.txt +++ b/cmake/CMakeLists_gtest.txt @@ -13,10 +13,10 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -SET(inc_gtest_dirs +set(inc_gtest_dirs ${root_dir}/tools/gtest ${root_dir}/tools/gtest/include ) -INCLUDE_DIRECTORIES(${inc_gtest_dirs}) -ADD_LIBRARY(gtest STATIC ${root_dir}/tools/gtest/src/gtest-all.cc) +include_directories(${inc_gtest_dirs}) +add_library(gtest STATIC ${root_dir}/tools/gtest/src/gtest-all.cc) diff --git a/cmake/CMakeLists_launcher.txt b/cmake/CMakeLists_launcher.txt index 810fa6f7..9dc9d5d9 100644 --- a/cmake/CMakeLists_launcher.txt +++ b/cmake/CMakeLists_launcher.txt @@ -13,10 +13,10 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -IF(WIN32) - SET(root_cmd_launcher ${root_dir}/cmd/launcher) +if (WIN32) + set(root_cmd_launcher ${root_dir}/cmd/launcher) - SET(src_cmd_launcher_mswindows + set(src_cmd_launcher_mswindows ${root_cmd_launcher}/CAddScreen.cpp ${root_cmd_launcher}/CAdvancedOptions.cpp ${root_cmd_launcher}/CAutoStart.cpp @@ -28,7 +28,7 @@ IF(WIN32) ${root_cmd_launcher}/launcher.cpp ) - SET(inc_cmd_launcher_mswindows + set(inc_cmd_launcher_mswindows ${root_cmd_launcher}/CAddScreen.h ${root_cmd_launcher}/CAdvancedOptions.h ${root_cmd_launcher}/CAutoStart.h @@ -40,30 +40,30 @@ IF(WIN32) ${root_cmd_launcher}/resource.h ) - SET(res_cmd_launcher_mswindows + set(res_cmd_launcher_mswindows ${root_cmd_launcher}/launcher.rc ${root_cmd_launcher}/synergy.ico ) - SET(src_cmd_launcher) + set(src_cmd_launcher) - IF(UNIX) - IF(APPLE) - LIST(APPEND src_cmd_launcher ${src_cmd_launcher_carbon}) - ELSE(APPLE) - LIST(APPEND src_cmd_launcher ${src_cmd_launcher_xwindows}) - ENDIF(APPLE) - ENDIF(UNIX) + if (UNIX) + if (APPLE) + list(APPEND src_cmd_launcher ${src_cmd_launcher_carbon}) + else (APPLE) + list(APPEND src_cmd_launcher ${src_cmd_launcher_xwindows}) + endif() + endif() - IF(WIN32) - LIST(APPEND src_cmd_launcher - ${inc_cmd_launcher_mswindows} - ${res_cmd_launcher_mswindows} - ${src_cmd_launcher_mswindows} + if (WIN32) + list(APPEND src_cmd_launcher + ${inc_cmd_launcher_mswindows} + ${res_cmd_launcher_mswindows} + ${src_cmd_launcher_mswindows} ) - ENDIF(WIN32) + endif() - SET(inc_dirs_cmd_launcher + set(inc_dirs_cmd_launcher ${root_dir} ${root_dir}/lib ${root_dir}/lib/arch @@ -77,8 +77,8 @@ IF(WIN32) ${root_dir}/lib/server ) - INCLUDE_DIRECTORIES(${inc_dirs_cmd_launcher}) - ADD_EXECUTABLE(launcher WIN32 ${src_cmd_launcher}) - TARGET_LINK_LIBRARIES(launcher synergy ${libs}) + include_directories(${inc_dirs_cmd_launcher}) + add_executable(launcher WIN32 ${src_cmd_launcher}) + target_link_libraries(launcher synergy ${libs}) -ENDIF(WIN32) +endif() diff --git a/cmake/CMakeLists_lib.txt b/cmake/CMakeLists_lib.txt index 3c93f381..4bdeb904 100644 --- a/cmake/CMakeLists_lib.txt +++ b/cmake/CMakeLists_lib.txt @@ -13,9 +13,9 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -SET(root_lib ${root_dir}/lib) +set(root_lib ${root_dir}/lib) -SET(src_lib_arch +set(src_lib_arch ${root_lib}/arch/CArchAppUtil.cpp ${root_lib}/arch/CArch.cpp ${root_lib}/arch/CArchDaemonNone.cpp @@ -23,7 +23,7 @@ SET(src_lib_arch ${root_lib}/arch/CArchConsoleStd.cpp ) -SET(src_lib_arch_unix +set(src_lib_arch_unix ${root_lib}/arch/CArchAppUtilUnix.cpp ${root_lib}/arch/CArchConsoleUnix.cpp ${root_lib}/arch/CArchDaemonUnix.cpp @@ -39,7 +39,7 @@ SET(src_lib_arch_unix ${root_lib}/arch/XArchUnix.cpp ) -SET(src_lib_arch_windows +set(src_lib_arch_windows ${root_lib}/arch/CArchAppUtilWindows.cpp ${root_lib}/arch/CArchConsoleWindows.cpp ${root_lib}/arch/CArchDaemonWindows.cpp @@ -56,7 +56,7 @@ SET(src_lib_arch_windows ${root_lib}/arch/XArchWindows.cpp ) -SET(inc_lib_arch_windows +set(inc_lib_arch_windows ${root_lib}/arch/CArchAppUtil.h ${root_lib}/arch/CArchAppUtilWindows.h ${root_lib}/arch/CArchConsoleWindows.h @@ -76,7 +76,7 @@ SET(inc_lib_arch_windows ${root_lib}/arch/XArchWindows.h ) -SET(src_lib_base +set(src_lib_base ${root_lib}/base/CEvent.cpp ${root_lib}/base/CEventQueue.cpp ${root_lib}/base/CFunctionEventJob.cpp @@ -91,7 +91,7 @@ SET(src_lib_base ${root_lib}/base/XBase.cpp ) -SET(inc_lib_base +set(inc_lib_base ${root_lib}/base/CEvent.h ${root_lib}/base/CEventQueue.h ${root_lib}/base/CFunctionEventJob.h @@ -114,32 +114,32 @@ SET(inc_lib_base ${root_lib}/base/XBase.h ) -SET(src_lib_client +set(src_lib_client ${root_lib}/client/CClient.cpp ${root_lib}/client/CServerProxy.cpp ) -SET(inc_lib_client +set(inc_lib_client ${root_lib}/client/CClient.h ${root_lib}/client/CServerProxy.h ) -SET(src_lib_common +set(src_lib_common ${root_lib}/common/Version.cpp ) -SET(inc_lib_common +set(inc_lib_common ${root_lib}/common/Version.h ) -SET(src_lib_io +set(src_lib_io ${root_lib}/io/CStreamBuffer.cpp ${root_lib}/io/CStreamFilter.cpp ${root_lib}/io/IStream.cpp ${root_lib}/io/XIO.cpp ) -SET(inc_lib_io +set(inc_lib_io ${root_lib}/io/CStreamBuffer.h ${root_lib}/io/CStreamFilter.h ${root_lib}/io/IStream.h @@ -147,7 +147,7 @@ SET(inc_lib_io ${root_lib}/io/XIO.h ) -SET(src_lib_mt +set(src_lib_mt ${root_lib}/mt/CCondVar.cpp ${root_lib}/mt/CLock.cpp ${root_lib}/mt/CMutex.cpp @@ -155,7 +155,7 @@ SET(src_lib_mt ${root_lib}/mt/XMT.cpp ) -SET(inc_lib_mt +set(inc_lib_mt ${root_lib}/mt/CCondVar.h ${root_lib}/mt/CLock.h ${root_lib}/mt/CMutex.h @@ -164,7 +164,7 @@ SET(inc_lib_mt ${root_lib}/mt/XThread.h ) -SET(src_lib_net +set(src_lib_net ${root_lib}/net/CNetworkAddress.cpp ${root_lib}/net/CSocketMultiplexer.cpp ${root_lib}/net/CTCPListenSocket.cpp @@ -176,7 +176,7 @@ SET(src_lib_net ${root_lib}/net/XSocket.cpp ) -SET(inc_lib_net +set(inc_lib_net ${root_lib}/net/CNetworkAddress.h ${root_lib}/net/CSocketMultiplexer.h ${root_lib}/net/CTCPListenSocket.h @@ -191,7 +191,7 @@ SET(inc_lib_net ${root_lib}/net/XSocket.h ) -SET(src_lib_platform_xwindows +set(src_lib_platform_xwindows ${root_lib}/platform/CXWindowsClipboard.cpp ${root_lib}/platform/CXWindowsClipboardAnyBitmapConverter.cpp ${root_lib}/platform/CXWindowsClipboardBMPConverter.cpp @@ -206,7 +206,7 @@ SET(src_lib_platform_xwindows ${root_lib}/platform/CXWindowsUtil.cpp ) -SET(src_lib_platform_mswindows +set(src_lib_platform_mswindows ${root_lib}/platform/CMSWindowsClipboard.cpp ${root_lib}/platform/CMSWindowsClipboardAnyTextConverter.cpp ${root_lib}/platform/CMSWindowsClipboardBitmapConverter.cpp @@ -222,7 +222,7 @@ SET(src_lib_platform_mswindows ${root_lib}/platform/CMSWindowsRelauncher.cpp ) -SET(inc_lib_platform_mswindows +set(inc_lib_platform_mswindows ${root_lib}/platform/CMSWindowsClipboard.h ${root_lib}/platform/CMSWindowsClipboardAnyTextConverter.h ${root_lib}/platform/CMSWindowsClipboardBitmapConverter.h @@ -238,15 +238,15 @@ SET(inc_lib_platform_mswindows ${root_lib}/platform/CMSWindowsRelauncher.h ) -SET(src_lib_platform_hook +set(src_lib_platform_hook ${root_lib}/platform/CSynergyHook.cpp ) -SET(inc_lib_platform_hook +set(inc_lib_platform_hook ${root_lib}/platform/CSynergyHook.h ) -SET(src_lib_platform_carbon +set(src_lib_platform_carbon ${root_lib}/platform/COSXClipboard.cpp ${root_lib}/platform/COSXClipboardAnyTextConverter.cpp ${root_lib}/platform/COSXClipboardTextConverter.cpp @@ -258,7 +258,7 @@ SET(src_lib_platform_carbon ${root_lib}/platform/COSXScreenSaverUtil.m ) -SET(src_lib_server +set(src_lib_server ${root_lib}/server/CBaseClientProxy.cpp ${root_lib}/server/CClientListener.cpp ${root_lib}/server/CClientProxy.cpp @@ -273,7 +273,7 @@ SET(src_lib_server ${root_lib}/server/CServer.cpp ) -SET(inc_lib_server +set(inc_lib_server ${root_lib}/server/CBaseClientProxy.h ${root_lib}/server/CClientListener.h ${root_lib}/server/CClientProxy.h @@ -288,7 +288,7 @@ SET(inc_lib_server ${root_lib}/server/CServer.h ) -SET(src_lib_synergy +set(src_lib_synergy ${root_lib}/synergy/CClientTaskBarReceiver.cpp ${root_lib}/synergy/CServerTaskBarReceiver.cpp ${root_lib}/synergy/CApp.cpp @@ -311,7 +311,7 @@ SET(src_lib_synergy ${root_lib}/synergy/XSynergy.cpp ) -SET(inc_lib_synergy +set(inc_lib_synergy ${root_lib}/synergy/CClientTaskBarReceiver.h ${root_lib}/synergy/CServerTaskBarReceiver.h ${root_lib}/synergy/CApp.h @@ -342,7 +342,7 @@ SET(inc_lib_synergy ) # Create default `src`, with cross-platform sources. -SET(src_lib +set(src_lib ${src_lib_arch} ${src_lib_base} ${src_lib_client} @@ -355,27 +355,27 @@ SET(src_lib ) # Append to `src_lib`, the platform specific sources. -IF(UNIX) - LIST(APPEND src_lib ${src_lib_arch_unix}) +if (UNIX) + list(APPEND src_lib ${src_lib_arch_unix}) - IF(APPLE) - LIST(APPEND src_lib + if (APPLE) + list(APPEND src_lib ${src_lib_platform_carbon} ${inc_lib_synergy_carbon} ${src_lib_synergy_carbon} ) - ELSE(APPLE) - LIST(APPEND src_lib + else (APPLE) + list(APPEND src_lib ${src_lib_platform_xwindows} ${inc_lib_synergy_xwindows} ${src_lib_synergy_xwindows} ) - ENDIF(APPLE) + endif() -ENDIF(UNIX) +endif() -IF(WIN32) - LIST(APPEND src_lib +if (WIN32) + list(APPEND src_lib ${inc_lib_base} ${inc_lib_client} ${inc_lib_common} @@ -391,9 +391,9 @@ IF(WIN32) ${inc_lib_synergy_mswindows} ${src_lib_synergy_mswindows} ) -ENDIF(WIN32) +endif() -SET(inc_lib_dirs +set(inc_lib_dirs ${root_dir} ${root_dir}/lib/arch ${root_dir}/lib/base @@ -409,9 +409,9 @@ SET(inc_lib_dirs ${root_dir}/third_party/gtest/include ) -INCLUDE_DIRECTORIES(${inc_lib_dirs}) -ADD_LIBRARY(synergy STATIC ${src_lib}) +include_directories(${inc_lib_dirs}) +add_library(synergy STATIC ${src_lib}) -IF(WIN32) - ADD_LIBRARY(synrgyhk SHARED ${inc_lib_platform_hook} ${src_lib_platform_hook}) -ENDIF(WIN32) +if (WIN32) + add_library(synrgyhk SHARED ${inc_lib_platform_hook} ${src_lib_platform_hook}) +endif() diff --git a/cmake/CMakeLists_synergyc.txt b/cmake/CMakeLists_synergyc.txt index 92e60862..9ce94d52 100644 --- a/cmake/CMakeLists_synergyc.txt +++ b/cmake/CMakeLists_synergyc.txt @@ -13,26 +13,26 @@ # 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(root_cmd_synergyc ${root_dir}/cmd/synergyc) -SET(src_cmd_synergyc_common +set(src_cmd_synergyc_common ${root_cmd_synergyc}/synergyc.cpp ) -SET(src_cmd_synergyc_xwindows +set(src_cmd_synergyc_xwindows ${root_cmd_synergyc}/CXWindowsClientTaskBarReceiver.cpp ) -SET(src_cmd_synergyc_mswindows +set(src_cmd_synergyc_mswindows ${root_cmd_synergyc}/CMSWindowsClientTaskBarReceiver.cpp ) -SET(inc_cmd_synergyc_mswindows +set(inc_cmd_synergyc_mswindows ${root_cmd_synergyc}/CMSWindowsClientTaskBarReceiver.h ${root_cmd_synergyc}/resource.h ) -SET(res_cmd_synergyc_mswindows +set(res_cmd_synergyc_mswindows ${root_cmd_synergyc}/synergyc.ico ${root_cmd_synergyc}/synergyc.rc ${root_cmd_synergyc}/tb_error.ico @@ -41,31 +41,31 @@ SET(res_cmd_synergyc_mswindows ${root_cmd_synergyc}/tb_wait.ico ) -SET(src_cmd_synergyc_carbon +set(src_cmd_synergyc_carbon ${root_cmd_synergyc}/COSXClientTaskBarReceiver.cpp ) -SET(src_cmd_synergyc ${src_cmd_synergyc_common}) +set(src_cmd_synergyc ${src_cmd_synergyc_common}) -IF(UNIX) +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) + if (APPLE) + list(APPEND src_cmd_synergyc ${src_cmd_synergyc_carbon}) + else (APPLE) + list(APPEND src_cmd_synergyc ${src_cmd_synergyc_xwindows}) + endif() -ELSE(UNIX) +else (UNIX) - LIST(APPEND src_cmd_synergyc + list(APPEND src_cmd_synergyc ${inc_cmd_synergyc_mswindows} ${res_cmd_synergyc_mswindows} ${src_cmd_synergyc_mswindows} ) -ENDIF(UNIX) +endif() -SET(inc_dirs_cmd_synergyc +set(inc_dirs_cmd_synergyc ${root_dir} ${root_dir}/lib ${root_dir}/lib/arch @@ -79,6 +79,6 @@ SET(inc_dirs_cmd_synergyc ${root_dir}/lib/synergy ) -INCLUDE_DIRECTORIES(${inc_dirs_cmd_synergyc}) -ADD_EXECUTABLE(synergyc ${src_cmd_synergyc}) -TARGET_LINK_LIBRARIES(synergyc synergy ${libs}) +include_directories(${inc_dirs_cmd_synergyc}) +add_executable(synergyc ${src_cmd_synergyc}) +target_link_libraries(synergyc synergy ${libs}) diff --git a/cmake/CMakeLists_synergys.txt b/cmake/CMakeLists_synergys.txt index 266a33e1..87e465ab 100644 --- a/cmake/CMakeLists_synergys.txt +++ b/cmake/CMakeLists_synergys.txt @@ -13,26 +13,26 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -SET(root_cmd_synergys ${root_dir}/cmd/synergys) +set(root_cmd_synergys ${root_dir}/cmd/synergys) -SET(src_cmd_synergys_common +set(src_cmd_synergys_common ${root_cmd_synergys}/synergys.cpp ) -SET(src_cmd_synergys_xwindows +set(src_cmd_synergys_xwindows ${root_cmd_synergys}/CXWindowsServerTaskBarReceiver.cpp ) -SET(src_cmd_synergys_mswindows +set(src_cmd_synergys_mswindows ${root_cmd_synergys}/CMSWindowsServerTaskBarReceiver.cpp ) -SET(inc_cmd_synergys_mswindows +set(inc_cmd_synergys_mswindows ${root_cmd_synergys}/CMSWindowsServerTaskBarReceiver.h ${root_cmd_synergys}/resource.h ) -SET(res_cmd_synergys_mswindows +set(res_cmd_synergys_mswindows ${root_cmd_synergys}/synergys.ico ${root_cmd_synergys}/synergys.rc ${root_cmd_synergys}/tb_error.ico @@ -41,31 +41,31 @@ SET(res_cmd_synergys_mswindows ${root_cmd_synergys}/tb_wait.ico ) -SET(src_cmd_synergys_carbon +set(src_cmd_synergys_carbon ${root_cmd_synergys}/COSXServerTaskBarReceiver.cpp ) -SET(src_cmd_synergys ${src_cmd_synergys_common}) +set(src_cmd_synergys ${src_cmd_synergys_common}) -IF(UNIX) +if (UNIX) - IF(APPLE) - LIST(APPEND src_cmd_synergys ${src_cmd_synergys_carbon}) - ELSE(APPLE) - LIST(APPEND src_cmd_synergys ${src_cmd_synergys_xwindows}) - ENDIF(APPLE) + if (APPLE) + list(APPEND src_cmd_synergys ${src_cmd_synergys_carbon}) + else (APPLE) + list(APPEND src_cmd_synergys ${src_cmd_synergys_xwindows}) + endif() -ELSE(UNIX) +else (UNIX) - LIST(APPEND src_cmd_synergys + list(APPEND src_cmd_synergys ${inc_cmd_synergys_mswindows} ${res_cmd_synergys_mswindows} ${src_cmd_synergys_mswindows} ) -ENDIF(UNIX) +endif() -SET(inc_dirs_cmd_synergys +set(inc_dirs_cmd_synergys ${root_dir} ${root_dir}/lib ${root_dir}/lib/arch @@ -79,6 +79,6 @@ SET(inc_dirs_cmd_synergys ${root_dir}/lib/server ) -INCLUDE_DIRECTORIES(${inc_dirs_cmd_synergys}) -ADD_EXECUTABLE(synergys ${src_cmd_synergys}) -TARGET_LINK_LIBRARIES(synergys synergy ${libs}) +include_directories(${inc_dirs_cmd_synergys}) +add_executable(synergys ${src_cmd_synergys}) +target_link_libraries(synergys synergy ${libs}) diff --git a/cmake/CMakeLists_test.txt b/cmake/CMakeLists_test.txt index d91d40b1..13ddb456 100644 --- a/cmake/CMakeLists_test.txt +++ b/cmake/CMakeLists_test.txt @@ -23,18 +23,18 @@ set(integtests ${root_dir}/src/integtest/Main.cpp ) -if(WIN32) +if (WIN32) list(APPEND integtests ${root_dir}/src/integtest/platform/CMSWindowsClipboardTests.cpp ) endif() -if(UNIX) - if(APPLE) +if (UNIX) + if (APPLE) list(APPEND integtests ${root_dir}/src/integtest/platform/COSXClipboardTests.cpp ) - else() + else () list(APPEND integtests ${root_dir}/src/integtest/platform/CXWindowsClipboardTests.cpp )