-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
69 lines (56 loc) · 2.34 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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
cmake_minimum_required (VERSION 3.2)
project (Fesapi_ETP_Client_Example)
add_executable (etpClientExample "")
# ============================================================================
# include directories
# ============================================================================
target_include_directories(etpClientExample PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
target_include_directories(etpClientExample PRIVATE ${FESAPI_ROOT_DIR}/src/)
target_include_directories(etpClientExample PRIVATE ${AVRO_INCLUDE_DIR})
target_include_directories(etpClientExample PRIVATE ${Boost_INCLUDE_DIR})
if (WITH_ETP_SSL)
target_compile_definitions(etpClientExample PRIVATE WITH_ETP_SSL)
if (NOT TARGET OpenSSL::SSL OR NOT TARGET OpenSSL::Crypto)
find_package(OpenSSL REQUIRED)
endif()
target_include_directories(etpClientExample PRIVATE ${OPENSSL_INCLUDE_DIR})
target_link_libraries(etpClientExample PRIVATE OpenSSL::SSL OpenSSL::Crypto)
endif ()
# ============================================================================
# COMMON
# ============================================================================
file (GLOB ALL_CPP_FILES ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp)
# organizing sources and headers in the Visual Studio Project
if (WIN32)
file (GLOB ALL_H_FILES ${CMAKE_CURRENT_SOURCE_DIR}/*.h)
source_group ("src" FILES ${ALL_CPP_FILES} ${ALL_H_FILES})
endif (WIN32)
if (WITH_ETP_SSL)
file (GLOB SSL_CPP_FILES ${CMAKE_CURRENT_SOURCE_DIR}/ssl/*.cpp)
set (ALL_CPP_FILES
${ALL_CPP_FILES}
${SSL_CPP_FILES}
)
if (WIN32)
file (GLOB SSL_H_FILES ${CMAKE_CURRENT_SOURCE_DIR}/ssl/*.h)
set (ALL_H_FILES
${ALL_H_FILES}
${SSL_H_FILES}
)
source_group ("src\\ssl" FILES ${SSL_CPP_FILES} ${SSL_H_FILES})
endif (WIN32)
endif ()
target_sources(etpClientExample PRIVATE ${ALL_CPP_FILES} ${ALL_H_FILES})
target_compile_definitions(etpClientExample PRIVATE BOOST_ALL_NO_LIB)
add_dependencies (etpClientExample ${CPP_LIBRARY_NAME})
target_link_libraries (etpClientExample PRIVATE ${CPP_LIBRARY_NAME} ${Boost_SYSTEM_LIBRARY} ${CMAKE_THREAD_LIBS_INIT} ${AVRO_LIBRARY_RELEASE})
if (WIN32)
target_link_libraries (etpClientExample PRIVATE bcrypt.lib)
set_target_properties (etpClientExample PROPERTIES
LINK_FLAGS "/INCREMENTAL:NO"
RUNTIME_OUTPUT_DIRECTORY ${FESAPI_BINARY_DIR})
endif (WIN32)
install (
TARGETS etpClientExample
DESTINATION ${CMAKE_INSTALL_PREFIX}
)