@@ -42,15 +42,24 @@ endif()
4242find_package (Boost REQUIRED COMPONENTS ${BOOST_COMPONENTS} )
4343target_link_libraries (schemagen PRIVATE ${BOOST_LIBRARIES} )
4444
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 ()
5463
5564# graphqlservice
5665add_library (graphqlservice
@@ -98,13 +107,6 @@ else()
98107 set (GRAPHQL_BUILD_TESTS OFF CACHE BOOL "GRAPHQL_BUILD_TESTS depends on BUILD_GRAPHQLJSON" FORCE)
99108endif ()
100109
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-
108110install (TARGETS
109111 graphqlpeg
110112 graphqlservice
0 commit comments