@@ -42,15 +42,24 @@ endif()
42
42
find_package (Boost REQUIRED COMPONENTS ${BOOST_COMPONENTS} )
43
43
target_link_libraries (schemagen PRIVATE ${BOOST_LIBRARIES} )
44
44
45
- add_custom_command (
46
- OUTPUT
47
- ${CMAKE_BINARY_DIR} /IntrospectionSchema.cpp
48
- ${CMAKE_BINARY_DIR} /include/graphqlservice/IntrospectionSchema.h
49
- COMMAND schemagen --introspection
50
- DEPENDS schemagen
51
- WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
52
- COMMENT "Generating IntrospectionSchema files"
53
- )
45
+ if (GRAPHQL_UPDATE_SAMPLES )
46
+ add_custom_command (
47
+ OUTPUT
48
+ ${CMAKE_BINARY_DIR} /IntrospectionSchema.cpp
49
+ ${CMAKE_BINARY_DIR} /include/graphqlservice/IntrospectionSchema.h
50
+ COMMAND schemagen --introspection
51
+ DEPENDS schemagen
52
+ WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
53
+ COMMENT "Generating IntrospectionSchema files" )
54
+
55
+ install (FILES
56
+ ${CMAKE_BINARY_DIR} /include/graphqlservice/IntrospectionSchema.h
57
+ ${CMAKE_BINARY_DIR} /IntrospectionSchema.cpp
58
+ DESTINATION ${CMAKE_SOURCE_DIR} /samples/introspection )
59
+ else ()
60
+ file (COPY ${CMAKE_SOURCE_DIR} /samples/introspection/IntrospectionSchema.cpp DESTINATION ${CMAKE_BINARY_DIR} )
61
+ file (COPY ${CMAKE_SOURCE_DIR} /samples/introspection/IntrospectionSchema.h DESTINATION ${CMAKE_BINARY_DIR} /include/graphqlservice )
62
+ endif ()
54
63
55
64
# graphqlservice
56
65
add_library (graphqlservice
@@ -98,13 +107,6 @@ else()
98
107
set (GRAPHQL_BUILD_TESTS OFF CACHE BOOL "GRAPHQL_BUILD_TESTS depends on BUILD_GRAPHQLJSON" FORCE )
99
108
endif ()
100
109
101
- if (GRAPHQL_UPDATE_SAMPLES )
102
- install (FILES
103
- ${CMAKE_BINARY_DIR} /include/graphqlservice/IntrospectionSchema.h
104
- ${CMAKE_BINARY_DIR} /IntrospectionSchema.cpp
105
- DESTINATION ${CMAKE_SOURCE_DIR} /samples/introspection )
106
- endif ()
107
-
108
110
install (TARGETS
109
111
graphqlpeg
110
112
graphqlservice
0 commit comments