-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
36 lines (26 loc) · 1.01 KB
/
CMakeLists.txt
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
30
31
32
33
34
35
36
cmake_minimum_required(VERSION 2.8)
project(libdetectproxy)
set (HEADERS detectproxy/detectproxy.hpp)
set (SRCS detectproxy/detectproxy.cpp)
# Build both shared and static libs
add_library(detectproxy SHARED ${SRCS} ${HEADERS})
set_target_properties (detectproxy PROPERTIES DEBUG_POSTFIX "-d")
set_target_properties(detectproxy PROPERTIES COMPILE_DEFINITIONS LIBDETECTPROXY_DYN_LINK)
add_library(detectproxy-static ${SRCS} ${HEADERS})
set_target_properties(detectproxy-static PROPERTIES DEBUG_POSTFIX "-d")
set_target_properties(detectproxy-static PROPERTIES OUTPUT_NAME "detectproxy")
if(MSVC)
set_target_properties(detectproxy-static PROPERTIES PREFIX "lib")
endif()
install(TARGETS detectproxy detectproxy-static
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
)
install(FILES ${HEADERS}
DESTINATION include/detectproxy
)
include_directories(.)
add_executable(test_1 test/test_1.cpp)
target_link_libraries(test_1 detectproxy-static)
add_executable(test_2 test/test_2.cpp)