@@ -9,10 +9,14 @@ if(WIN32)
9
9
SET (CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS TRUE )
10
10
endif ()
11
11
12
+ add_library (graphqlpeg GraphQLTree.cpp )
12
13
add_library (graphqlservice GraphQLService.cpp Introspection.cpp IntrospectionSchema.cpp )
13
14
add_executable (schemagen SchemaGenerator.cpp )
14
15
15
- find_library (GRAPHQLPARSER graphqlparser )
16
+ find_package (pegtl CONFIG REQUIRED )
17
+
18
+ target_include_directories (graphqlpeg INTERFACE $< BUILD_INTERFACE:${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} > $< INSTALL_INTERFACE:include> )
19
+ target_link_libraries (graphqlpeg taocpp::pegtl )
16
20
17
21
find_package (cpprestsdk REQUIRED )
18
22
set (CPPRESTSDK cpprestsdk::cpprest )
@@ -23,8 +27,8 @@ if(UNIX)
23
27
endif ()
24
28
25
29
target_include_directories (graphqlservice INTERFACE $< BUILD_INTERFACE:${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} > $< INSTALL_INTERFACE:include> )
26
- target_link_libraries (graphqlservice ${CPPRESTSDK} ${GRAPHQLPARSER} )
27
- target_link_libraries (schemagen ${CPPRESTSDK} ${GRAPHQLPARSER} )
30
+ target_link_libraries (graphqlservice ${CPPRESTSDK} graphqlpeg )
31
+ target_link_libraries (schemagen ${CPPRESTSDK} graphqlpeg )
28
32
29
33
add_custom_command (
30
34
OUTPUT IntrospectionSchema.cpp IntrospectionSchema.h
@@ -34,6 +38,7 @@ add_custom_command(
34
38
)
35
39
36
40
if (UNIX )
41
+ target_compile_options (graphqlpeg PRIVATE -std=c++11 )
37
42
target_compile_options (graphqlservice PRIVATE -std=c++11 )
38
43
target_compile_options (schemagen PRIVATE -std=c++11 )
39
44
endif ()
@@ -56,15 +61,14 @@ if(BUILD_TESTS OR UPDATE_SAMPLES)
56
61
57
62
target_link_libraries (todaygraphql
58
63
${CPPRESTSDK}
59
- ${GRAPHQLPARSER}
60
64
graphqlservice )
61
65
target_include_directories (todaygraphql SYSTEM PUBLIC ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR} )
62
66
63
67
add_executable (test_today test_today.cpp )
64
68
65
69
target_link_libraries (test_today
66
70
${CPPRESTSDK}
67
- ${GRAPHQLPARSER}
71
+ graphqlpeg
68
72
graphqlservice
69
73
todaygraphql )
70
74
target_include_directories (test_today SYSTEM PUBLIC ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR} )
@@ -74,7 +78,7 @@ if(BUILD_TESTS OR UPDATE_SAMPLES)
74
78
find_package (GTest REQUIRED )
75
79
target_link_libraries (tests
76
80
${CPPRESTSDK}
77
- ${GRAPHQLPARSER}
81
+ graphqlpeg
78
82
graphqlservice
79
83
todaygraphql
80
84
GTest::GTest
@@ -96,18 +100,18 @@ if(BUILD_TESTS OR UPDATE_SAMPLES)
96
100
endif ()
97
101
endif ()
98
102
99
- install (TARGETS graphqlservice schemagen
103
+ install (TARGETS graphqlpeg graphqlservice schemagen
100
104
EXPORT cppgraphqlgen-config
101
105
RUNTIME DESTINATION bin
102
106
ARCHIVE DESTINATION lib
103
107
LIBRARY DESTINATION lib )
104
108
105
- install (FILES GraphQLService.h Introspection.h IntrospectionSchema.h
109
+ install (FILES GraphQLService.h GraphQLTree.h Introspection.h IntrospectionSchema.h
106
110
DESTINATION include /graphqlservice )
107
111
108
112
if (WIN32 )
109
113
set (GRAPHQLSERVICE_DIR $< TARGET_FILE_DIR:graphqlservice> )
110
- install (FILES ${GRAPHQLSERVICE_DIR} /graphqlservice.lib
114
+ install (FILES ${GRAPHQLSERVICE_DIR} /graphqlservice.lib ${GRAPHQLSERVICE_DIR} /graphqlpeg.lib
111
115
DESTINATION lib )
112
116
endif ()
113
117
0 commit comments