Skip to content

Commit cd08341

Browse files
committed
Enable building as a sub-directory
1 parent c9ea320 commit cd08341

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ endfunction()
1212

1313
# graphqlpeg
1414
add_library(graphqlpeg GraphQLTree.cpp)
15+
add_library(cppgraphqlgen::graphqlpeg ALIAS graphqlpeg)
1516
target_link_libraries(graphqlpeg PUBLIC taocpp::pegtl)
1617
target_include_directories(graphqlpeg PUBLIC
1718
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../include>
@@ -27,6 +28,7 @@ endif()
2728

2829
# graphqlresponse
2930
add_library(graphqlresponse GraphQLResponse.cpp)
31+
add_library(cppgraphqlgen::graphqlresponse ALIAS graphqlresponse)
3032
target_include_directories(graphqlresponse PUBLIC
3133
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../include>
3234
$<INSTALL_INTERFACE:${GRAPHQL_INSTALL_INCLUDE_DIR}>)
@@ -40,6 +42,7 @@ endif()
4042
# schemagen
4143
if(GRAPHQL_BUILD_SCHEMAGEN)
4244
add_executable(schemagen SchemaGenerator.cpp)
45+
add_executable(cppgraphqlgen::schemagen ALIAS schemagen)
4346
target_link_libraries(schemagen PRIVATE
4447
graphqlpeg
4548
graphqlresponse)
@@ -108,6 +111,7 @@ add_library(graphqlservice
108111
Introspection.cpp
109112
Validation.cpp
110113
${CMAKE_CURRENT_BINARY_DIR}/../IntrospectionSchema.cpp)
114+
add_library(cppgraphqlgen::graphqlservice ALIAS graphqlservice)
111115
target_link_libraries(graphqlservice PUBLIC
112116
graphqlpeg
113117
Threads::Threads)
@@ -134,6 +138,7 @@ if(GRAPHQL_USE_RAPIDJSON)
134138

135139
set(BUILD_GRAPHQLJSON ON)
136140
add_library(graphqljson JSONResponse.cpp)
141+
add_library(cppgraphqlgen::graphqljson ALIAS graphqljson)
137142
target_link_libraries(graphqljson PUBLIC graphqlresponse)
138143
target_include_directories(graphqljson SYSTEM PRIVATE ${RAPIDJSON_INCLUDE_DIRS})
139144

0 commit comments

Comments
 (0)