summaryrefslogtreecommitdiffstats
path: root/tests/Network/CMakeLists.txt
blob: 9d0dcdc245ba5c3bf669cb7b7876db67b7796017 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
cmake_minimum_required (VERSION 2.6) 

enable_testing()

include_directories(${CMAKE_SOURCE_DIR}/src/)
include_directories(${CMAKE_SOURCE_DIR}/lib/libevent/include)

add_definitions(-DTEST_GLOBALS=1)
add_library(Network
	${CMAKE_SOURCE_DIR}/src/OSSupport/Network.cpp
	${CMAKE_SOURCE_DIR}/src/OSSupport/CriticalSection.cpp
	${CMAKE_SOURCE_DIR}/src/OSSupport/Event.cpp
	${CMAKE_SOURCE_DIR}/src/StringUtils.cpp
)

target_link_libraries(Network event_core event_extra)
if (MSVC)
	target_link_libraries(Network ws2_32.lib)
endif()

add_executable(Google-exe Google.cpp)
target_link_libraries(Google-exe Network)
add_test(NAME Google-test COMMAND Google-exe)

add_executable(EchoServer EchoServer.cpp)
target_link_libraries(EchoServer Network)

add_executable(NameLookup NameLookup.cpp)
target_link_libraries(NameLookup Network)