-
Notifications
You must be signed in to change notification settings - Fork 46
/
CMakeLists.txt
41 lines (35 loc) · 1.12 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
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
cmake_minimum_required(VERSION 3.15)
add_subdirectory(schema)
add_library(star_wars STATIC
HeroData.cpp
DroidData.cpp
HumanData.cpp
QueryData.cpp
ReviewData.cpp
MutationData.cpp
StarWarsData.cpp)
target_link_libraries(star_wars PUBLIC learn_schema)
target_include_directories(star_wars INTERFACE ${CMAKE_CURRENT_SOURCE_DIR})
add_executable(learn_star_wars sample.cpp)
target_link_libraries(learn_star_wars PRIVATE
star_wars
graphqljson)
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>
${CMAKE_CURRENT_BINARY_DIR}
COMMAND ${CMAKE_COMMAND} -E touch copied_sample_dlls
DEPENDS
graphqlservice
graphqljson
graphqlpeg
graphqlresponse)
add_custom_target(copy_learn_sample_dlls DEPENDS copied_sample_dlls)
add_dependencies(learn_star_wars copy_learn_sample_dlls)
endif()