forked from microsoft/cppgraphqlgen
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
48 lines (40 loc) · 1.31 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
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
cmake_minimum_required(VERSION 3.15)
add_subdirectory(query)
add_subdirectory(schema)
add_executable(client client.cpp)
target_link_libraries(client PRIVATE
proxy_schema
proxy_client
graphqljson)
target_include_directories(client SYSTEM PRIVATE ${Boost_INCLUDE_DIR})
add_executable(server server.cpp)
target_link_libraries(server PRIVATE
star_wars
graphqljson)
target_include_directories(server SYSTEM PRIVATE ${Boost_INCLUDE_DIR})
if(MSVC)
target_compile_options(client PRIVATE "-wd4702")
target_compile_options(server PRIVATE "-wd4702")
endif()
if(WIN32 AND BUILD_SHARED_LIBS)
add_custom_command(OUTPUT copied_sample_dlls
COMMAND ${CMAKE_COMMAND} -E copy_if_different
$<TARGET_FILE:graphqlservice>
$<TARGET_FILE:graphqljson>
$<TARGET_FILE:graphqlpeg>
$<TARGET_FILE:graphqlresponse>
$<TARGET_FILE:graphqlclient>
${CMAKE_CURRENT_BINARY_DIR}
COMMAND ${CMAKE_COMMAND} -E touch copied_sample_dlls
DEPENDS
graphqlservice
graphqljson
graphqlpeg
graphqlresponse
graphqlclient)
add_custom_target(copy_proxy_sample_dlls DEPENDS copied_sample_dlls)
add_dependencies(client copy_proxy_sample_dlls)
add_dependencies(server copy_proxy_sample_dlls)
endif()