diff --git a/CMakeLists.txt b/CMakeLists.txt index 3a5a7058..74c9608c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -222,7 +222,7 @@ if (UNIX) 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(res/config.h.in ${root_dir}/config.h) add_definitions(-DSYSAPI_UNIX=1 -DHAVE_CONFIG_H) diff --git a/src/cmd/synergyc/CMakeLists.txt b/src/cmd/synergyc/CMakeLists.txt index 7bd6c8dd..fa2eb11e 100644 --- a/src/cmd/synergyc/CMakeLists.txt +++ b/src/cmd/synergyc/CMakeLists.txt @@ -36,8 +36,6 @@ elseif (UNIX) endif() set(inc - ../.. - ../../lib ../../lib/arch ../../lib/base ../../lib/client @@ -49,6 +47,12 @@ set(inc ../../lib/synergy ) +if (UNIX) + list(APPEND inc + ../../.. + ) +endif() + include_directories(${inc}) add_executable(synergyc ${src}) target_link_libraries(synergyc diff --git a/src/cmd/synergys/CMakeLists.txt b/src/cmd/synergys/CMakeLists.txt index 7098aa98..f24a7bf0 100644 --- a/src/cmd/synergys/CMakeLists.txt +++ b/src/cmd/synergys/CMakeLists.txt @@ -38,8 +38,6 @@ elseif (UNIX) endif() set(inc - ../.. - ../../lib ../../lib/arch ../../lib/base ../../lib/common @@ -51,6 +49,12 @@ set(inc ../../lib/server ) +if (UNIX) + list(APPEND inc + ../../.. + ) +endif() + include_directories(${inc}) add_executable(synergys ${src}) target_link_libraries(synergys diff --git a/src/integtests/CMakeLists.txt b/src/integtests/CMakeLists.txt index fc7ed603..c62dcae2 100644 --- a/src/integtests/CMakeLists.txt +++ b/src/integtests/CMakeLists.txt @@ -53,6 +53,12 @@ set(inc ../../tools/gtest/include ) +if (UNIX) + list(APPEND inc + ../.. + ) +endif() + include_directories(${inc}) add_executable(integtests ${src}) target_link_libraries(integtests diff --git a/src/lib/arch/CMakeLists.txt b/src/lib/arch/CMakeLists.txt index 3e6ae546..061abdf9 100644 --- a/src/lib/arch/CMakeLists.txt +++ b/src/lib/arch/CMakeLists.txt @@ -89,5 +89,12 @@ set(inc ../synergy ) +if (UNIX) + list(APPEND inc + ../../.. + ../arch + ) +endif() + include_directories(${inc}) add_library(libarch STATIC ${src}) diff --git a/src/lib/base/CMakeLists.txt b/src/lib/base/CMakeLists.txt index 7a598593..06271384 100644 --- a/src/lib/base/CMakeLists.txt +++ b/src/lib/base/CMakeLists.txt @@ -62,5 +62,12 @@ set(inc ../synergy ) +if (UNIX) + list(APPEND inc + ../../.. + ../base + ) +endif() + include_directories(${inc}) add_library(libbase STATIC ${src}) diff --git a/src/lib/client/CMakeLists.txt b/src/lib/client/CMakeLists.txt index 7edeccf7..8b4e7380 100644 --- a/src/lib/client/CMakeLists.txt +++ b/src/lib/client/CMakeLists.txt @@ -37,5 +37,17 @@ set(inc ../synergy ) +if (UNIX) + list(APPEND inc + ../../.. + ) + +endif() + include_directories(${inc}) add_library(libclient STATIC ${src}) + +if (UNIX) + target_link_libraries(libclient + libsynergy libio) +endif() diff --git a/src/lib/common/CMakeLists.txt b/src/lib/common/CMakeLists.txt index 0a92103e..b84d0230 100644 --- a/src/lib/common/CMakeLists.txt +++ b/src/lib/common/CMakeLists.txt @@ -25,4 +25,10 @@ if (WIN32) list(APPEND src ${inc}) endif() +if (UNIX) + include_directories( + ../../.. + ) +endif() + add_library(libcommon STATIC ${src}) diff --git a/src/lib/io/CMakeLists.txt b/src/lib/io/CMakeLists.txt index 95290b6a..3997d91a 100644 --- a/src/lib/io/CMakeLists.txt +++ b/src/lib/io/CMakeLists.txt @@ -37,5 +37,11 @@ set(inc ../common ) +if (UNIX) + list(APPEND inc + ../../.. + ) +endif() + include_directories(${inc}) add_library(libio STATIC ${src}) diff --git a/src/lib/mt/CMakeLists.txt b/src/lib/mt/CMakeLists.txt index 0c35e62a..056c112b 100644 --- a/src/lib/mt/CMakeLists.txt +++ b/src/lib/mt/CMakeLists.txt @@ -41,5 +41,11 @@ set(inc ../synergy ) +if (UNIX) + list(APPEND inc + ../../.. + ) +endif() + include_directories(${inc}) add_library(libmt STATIC ${src}) diff --git a/src/lib/net/CMakeLists.txt b/src/lib/net/CMakeLists.txt index ecce8cd6..d9d1863e 100644 --- a/src/lib/net/CMakeLists.txt +++ b/src/lib/net/CMakeLists.txt @@ -53,5 +53,16 @@ set(inc ../synergy ) +if (UNIX) + list(APPEND inc + ../../.. + ) +endif() + include_directories(${inc}) add_library(libnet STATIC ${src}) + +if (UNIX) + target_link_libraries(libnet + libmt libio) +endif() diff --git a/src/lib/platform/CMakeLists.txt b/src/lib/platform/CMakeLists.txt index 9d71a808..5ebb90ea 100644 --- a/src/lib/platform/CMakeLists.txt +++ b/src/lib/platform/CMakeLists.txt @@ -97,9 +97,20 @@ set(inc ../synergy ) +if (UNIX) + list(APPEND inc + ../../.. + ) +endif() + include_directories(${inc}) add_library(libplatform STATIC ${src}) if (WIN32) add_library(synrgyhk SHARED ${inc_hook} ${src_hook}) endif() + +if (UNIX) + target_link_libraries(libplatform + libsynergy) +endif() diff --git a/src/lib/server/CMakeLists.txt b/src/lib/server/CMakeLists.txt index 25777b97..f63ee458 100644 --- a/src/lib/server/CMakeLists.txt +++ b/src/lib/server/CMakeLists.txt @@ -57,5 +57,16 @@ set(inc ../synergy ) +if (UNIX) + list(APPEND inc + ../../.. + ) +endif() + include_directories(${inc}) add_library(libserver STATIC ${src}) + +if (UNIX) + target_link_libraries(libserver + libsynergy) +endif() diff --git a/src/lib/synergy/CMakeLists.txt b/src/lib/synergy/CMakeLists.txt index e960b672..b16d6fd1 100644 --- a/src/lib/synergy/CMakeLists.txt +++ b/src/lib/synergy/CMakeLists.txt @@ -83,5 +83,16 @@ set(inc ../synergy ) +if (UNIX) + list(APPEND inc + ../../.. + ) +endif() + include_directories(${inc}) add_library(libsynergy STATIC ${src}) + +if (UNIX) + target_link_libraries(libsynergy + libarch libclient libnet libbase libplatform libmt libserver) +endif() diff --git a/src/unittests/CMakeLists.txt b/src/unittests/CMakeLists.txt index 28bf4200..66387067 100644 --- a/src/unittests/CMakeLists.txt +++ b/src/unittests/CMakeLists.txt @@ -31,6 +31,12 @@ set(inc ../../tools/gtest/include ) +if (UNIX) + list(APPEND inc + ../.. + ) +endif() + include_directories(${inc}) add_executable(unittests ${src}) target_link_libraries(unittests