1
1
cmake_minimum_required (VERSION 2.8 FATAL_ERROR)
2
2
project (clsocket)
3
3
4
- SET (CLSOCKET_HEADERS
4
+ set (CLSOCKET_HEADERS
5
5
src/ActiveSocket.h
6
6
src/Host.h
7
7
src/PassiveSocket.h
8
8
src/SimpleSocket.h
9
9
src/StatTimer.h
10
10
)
11
11
12
- SET (CLSOCKET_SOURCES
12
+ set (CLSOCKET_SOURCES
13
13
src/SimpleSocket.cpp
14
14
src/ActiveSocket.cpp
15
15
src/PassiveSocket.cpp
16
16
)
17
17
18
- OPTION (BUILD_SHARED_LIBS "Build libs as shared" ON )
18
+ option (BUILD_SHARED_LIBS "Build libs as shared" ON )
19
19
if (DEFINED CLSOCKET_SHARED)
20
20
message (FATAL_ERROR "The CLSOCKET_SHARED option is deprecated, instead use BUILD_SHARED_LIBS." )
21
21
endif ()
@@ -25,7 +25,7 @@ endif()
25
25
26
26
# make the lib
27
27
# add headers so that they appear in IDEs
28
- ADD_LIBRARY (clsocket ${CLSOCKET_SOURCES} ${CLSOCKET_HEADERS} )
28
+ add_library (clsocket ${CLSOCKET_SOURCES} ${CLSOCKET_HEADERS} )
29
29
target_include_directories (clsocket PUBLIC src)
30
30
if (WIN32 )
31
31
target_link_libraries (clsocket PRIVATE Ws2_32)
@@ -36,17 +36,17 @@ install(TARGETS clsocket DESTINATION lib)
36
36
install (FILES ${CLSOCKET_HEADERS} DESTINATION include )
37
37
38
38
if (UNIX )
39
- OPTION (CLSOCKET_EXAMPLES "Build the examples" OFF )
39
+ option (CLSOCKET_EXAMPLES "Build the examples" OFF )
40
40
41
41
if (CLSOCKET_EXAMPLES)
42
- ADD_EXECUTABLE (clsocket-example examples/RecvAsync.cpp)
42
+ add_executable (clsocket-example examples/RecvAsync.cpp)
43
43
target_link_libraries (clsocket-example clsocket pthread)
44
44
install (TARGETS clsocket-example DESTINATION bin)
45
45
46
- ADD_EXECUTABLE (querydaytime-example examples/QueryDayTime.cpp)
46
+ add_executable (querydaytime-example examples/QueryDayTime.cpp)
47
47
target_link_libraries (querydaytime-example clsocket)
48
48
49
- ADD_EXECUTABLE (echoserver-example examples/EchoServer.cpp)
49
+ add_executable (echoserver-example examples/EchoServer.cpp)
50
50
target_link_libraries (echoserver-example clsocket)
51
51
endif ()
52
52
endif ()
0 commit comments