fixed library linkage on linux

This commit is contained in:
Nick Bolton 2011-04-25 22:10:46 +00:00
parent 143c4cd297
commit 66c4bdc356
15 changed files with 113 additions and 5 deletions

View File

@ -222,7 +222,7 @@ if (UNIX)
set(HAVE_SOCKLEN_T 1) set(HAVE_SOCKLEN_T 1)
# For config.h, save the results based on a template (config.h.in). # 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) add_definitions(-DSYSAPI_UNIX=1 -DHAVE_CONFIG_H)

View File

@ -36,8 +36,6 @@ elseif (UNIX)
endif() endif()
set(inc set(inc
../..
../../lib
../../lib/arch ../../lib/arch
../../lib/base ../../lib/base
../../lib/client ../../lib/client
@ -49,6 +47,12 @@ set(inc
../../lib/synergy ../../lib/synergy
) )
if (UNIX)
list(APPEND inc
../../..
)
endif()
include_directories(${inc}) include_directories(${inc})
add_executable(synergyc ${src}) add_executable(synergyc ${src})
target_link_libraries(synergyc target_link_libraries(synergyc

View File

@ -38,8 +38,6 @@ elseif (UNIX)
endif() endif()
set(inc set(inc
../..
../../lib
../../lib/arch ../../lib/arch
../../lib/base ../../lib/base
../../lib/common ../../lib/common
@ -51,6 +49,12 @@ set(inc
../../lib/server ../../lib/server
) )
if (UNIX)
list(APPEND inc
../../..
)
endif()
include_directories(${inc}) include_directories(${inc})
add_executable(synergys ${src}) add_executable(synergys ${src})
target_link_libraries(synergys target_link_libraries(synergys

View File

@ -53,6 +53,12 @@ set(inc
../../tools/gtest/include ../../tools/gtest/include
) )
if (UNIX)
list(APPEND inc
../..
)
endif()
include_directories(${inc}) include_directories(${inc})
add_executable(integtests ${src}) add_executable(integtests ${src})
target_link_libraries(integtests target_link_libraries(integtests

View File

@ -89,5 +89,12 @@ set(inc
../synergy ../synergy
) )
if (UNIX)
list(APPEND inc
../../..
../arch
)
endif()
include_directories(${inc}) include_directories(${inc})
add_library(libarch STATIC ${src}) add_library(libarch STATIC ${src})

View File

@ -62,5 +62,12 @@ set(inc
../synergy ../synergy
) )
if (UNIX)
list(APPEND inc
../../..
../base
)
endif()
include_directories(${inc}) include_directories(${inc})
add_library(libbase STATIC ${src}) add_library(libbase STATIC ${src})

View File

@ -37,5 +37,17 @@ set(inc
../synergy ../synergy
) )
if (UNIX)
list(APPEND inc
../../..
)
endif()
include_directories(${inc}) include_directories(${inc})
add_library(libclient STATIC ${src}) add_library(libclient STATIC ${src})
if (UNIX)
target_link_libraries(libclient
libsynergy libio)
endif()

View File

@ -25,4 +25,10 @@ if (WIN32)
list(APPEND src ${inc}) list(APPEND src ${inc})
endif() endif()
if (UNIX)
include_directories(
../../..
)
endif()
add_library(libcommon STATIC ${src}) add_library(libcommon STATIC ${src})

View File

@ -37,5 +37,11 @@ set(inc
../common ../common
) )
if (UNIX)
list(APPEND inc
../../..
)
endif()
include_directories(${inc}) include_directories(${inc})
add_library(libio STATIC ${src}) add_library(libio STATIC ${src})

View File

@ -41,5 +41,11 @@ set(inc
../synergy ../synergy
) )
if (UNIX)
list(APPEND inc
../../..
)
endif()
include_directories(${inc}) include_directories(${inc})
add_library(libmt STATIC ${src}) add_library(libmt STATIC ${src})

View File

@ -53,5 +53,16 @@ set(inc
../synergy ../synergy
) )
if (UNIX)
list(APPEND inc
../../..
)
endif()
include_directories(${inc}) include_directories(${inc})
add_library(libnet STATIC ${src}) add_library(libnet STATIC ${src})
if (UNIX)
target_link_libraries(libnet
libmt libio)
endif()

View File

@ -97,9 +97,20 @@ set(inc
../synergy ../synergy
) )
if (UNIX)
list(APPEND inc
../../..
)
endif()
include_directories(${inc}) include_directories(${inc})
add_library(libplatform STATIC ${src}) add_library(libplatform STATIC ${src})
if (WIN32) if (WIN32)
add_library(synrgyhk SHARED ${inc_hook} ${src_hook}) add_library(synrgyhk SHARED ${inc_hook} ${src_hook})
endif() endif()
if (UNIX)
target_link_libraries(libplatform
libsynergy)
endif()

View File

@ -57,5 +57,16 @@ set(inc
../synergy ../synergy
) )
if (UNIX)
list(APPEND inc
../../..
)
endif()
include_directories(${inc}) include_directories(${inc})
add_library(libserver STATIC ${src}) add_library(libserver STATIC ${src})
if (UNIX)
target_link_libraries(libserver
libsynergy)
endif()

View File

@ -83,5 +83,16 @@ set(inc
../synergy ../synergy
) )
if (UNIX)
list(APPEND inc
../../..
)
endif()
include_directories(${inc}) include_directories(${inc})
add_library(libsynergy STATIC ${src}) add_library(libsynergy STATIC ${src})
if (UNIX)
target_link_libraries(libsynergy
libarch libclient libnet libbase libplatform libmt libserver)
endif()

View File

@ -31,6 +31,12 @@ set(inc
../../tools/gtest/include ../../tools/gtest/include
) )
if (UNIX)
list(APPEND inc
../..
)
endif()
include_directories(${inc}) include_directories(${inc})
add_executable(unittests ${src}) add_executable(unittests ${src})
target_link_libraries(unittests target_link_libraries(unittests