Skip to content

Commit c286c83

Browse files
authored
Merge pull request #89 from wravery/master
CMake fixes to skip regenerating IntrospectionSchema.* in vcpkg
2 parents 3ca273a + 8d9c3b1 commit c286c83

File tree

1 file changed

+19
-10
lines changed

1 file changed

+19
-10
lines changed

src/CMakeLists.txt

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -48,17 +48,17 @@ install(TARGETS schemagen
4848
CONFIGURATIONS Release)
4949

5050
# introspection
51-
add_custom_command(
52-
OUTPUT
53-
${CMAKE_CURRENT_BINARY_DIR}/../IntrospectionSchema.cpp
54-
${CMAKE_CURRENT_BINARY_DIR}/../include/graphqlservice/IntrospectionSchema.h
55-
COMMAND ${CMAKE_COMMAND} -E make_directory include/graphqlservice
56-
COMMAND schemagen --introspection
57-
DEPENDS schemagen
58-
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/..
59-
COMMENT "Generating IntrospectionSchema files")
60-
6151
if(GRAPHQL_UPDATE_SAMPLES)
52+
add_custom_command(
53+
OUTPUT
54+
${CMAKE_CURRENT_BINARY_DIR}/../IntrospectionSchema.cpp
55+
${CMAKE_CURRENT_BINARY_DIR}/../include/graphqlservice/IntrospectionSchema.h
56+
COMMAND ${CMAKE_COMMAND} -E make_directory include/graphqlservice
57+
COMMAND schemagen --introspection
58+
DEPENDS schemagen
59+
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/..
60+
COMMENT "Generating IntrospectionSchema files")
61+
6262
file(GLOB OLD_INTROSPECTION_FILES ${CMAKE_CURRENT_SOURCE_DIR}/../samples/introspection/*)
6363

6464
add_custom_command(
@@ -74,6 +74,15 @@ if(GRAPHQL_UPDATE_SAMPLES)
7474

7575
add_custom_target(update_introspection ALL
7676
DEPENDS updated_introspection)
77+
else()
78+
add_custom_command(
79+
OUTPUT
80+
${CMAKE_CURRENT_BINARY_DIR}/../IntrospectionSchema.cpp
81+
${CMAKE_CURRENT_BINARY_DIR}/../include/graphqlservice/IntrospectionSchema.h
82+
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/../samples/introspection/IntrospectionSchema.cpp .
83+
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/../samples/introspection/IntrospectionSchema.h include/graphqlservice
84+
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/..
85+
COMMENT "Copying IntrospectionSchema files")
7786
endif()
7887

7988
# graphqlservice

0 commit comments

Comments
 (0)