@@ -15,6 +15,7 @@ add_executable(schemagen GraphQLTree.cpp SchemaGenerator.cpp)
15
15
target_link_libraries (schemagen PRIVATE taocpp::pegtl )
16
16
target_include_directories (schemagen SYSTEM PUBLIC ${RAPIDJSON_INCLUDE_DIRS} )
17
17
target_include_directories (schemagen PRIVATE ${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} )
18
+ set_property (TARGET schemagen PROPERTY CXX_STANDARD 11 )
18
19
19
20
add_custom_command (
20
21
OUTPUT IntrospectionSchema.cpp IntrospectionSchema.h
@@ -34,11 +35,7 @@ target_link_libraries(graphqlservice PRIVATE taocpp::pegtl)
34
35
target_include_directories (graphqlservice SYSTEM PUBLIC ${RAPIDJSON_INCLUDE_DIRS} )
35
36
target_include_directories (graphqlservice SYSTEM INTERFACE $< INSTALL_INTERFACE:include> )
36
37
target_include_directories (graphqlservice PRIVATE ${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} )
37
-
38
- if (UNIX )
39
- target_compile_options (graphqlservice PRIVATE -std=c++11 )
40
- target_compile_options (schemagen PRIVATE -std=c++11 )
41
- endif ()
38
+ set_property (TARGET graphqlservice PROPERTY CXX_STANDARD 11 )
42
39
43
40
option (BUILD_TESTS "Build the tests and sample schema library." ON )
44
41
option (UPDATE_SAMPLES "Regenerate the sample schema sources whether or not we're building the tests and the sample library." ON )
@@ -59,6 +56,7 @@ if(BUILD_TESTS OR UPDATE_SAMPLES)
59
56
graphqlservice )
60
57
target_include_directories (todaygraphql SYSTEM PRIVATE ${RAPIDJSON_INCLUDE_DIRS} )
61
58
target_include_directories (todaygraphql PRIVATE ${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} )
59
+ set_property (TARGET todaygraphql PROPERTY CXX_STANDARD 11 )
62
60
63
61
add_executable (test_today
64
62
test_today.cpp )
@@ -67,6 +65,7 @@ if(BUILD_TESTS OR UPDATE_SAMPLES)
67
65
todaygraphql )
68
66
target_include_directories (test_today SYSTEM PRIVATE ${RAPIDJSON_INCLUDE_DIRS} )
69
67
target_include_directories (test_today PRIVATE ${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} )
68
+ set_property (TARGET test_today PROPERTY CXX_STANDARD 11 )
70
69
71
70
find_package (GTest REQUIRED )
72
71
@@ -79,6 +78,7 @@ if(BUILD_TESTS OR UPDATE_SAMPLES)
79
78
GTest::Main )
80
79
target_include_directories (tests SYSTEM PRIVATE ${RAPIDJSON_INCLUDE_DIRS} )
81
80
target_include_directories (tests PRIVATE ${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} )
81
+ set_property (TARGET tests PROPERTY CXX_STANDARD 11 )
82
82
83
83
enable_testing ()
84
84
add_test (NAME TodayServiceCase
@@ -90,12 +90,6 @@ if(BUILD_TESTS OR UPDATE_SAMPLES)
90
90
add_test (NAME PegtlCase
91
91
COMMAND tests --gtest_filter=PegtlCase.*
92
92
WORKING_DIRECTORY $< TARGET_FILE_DIR:tests> )
93
-
94
- if (UNIX )
95
- target_compile_options (todaygraphql PRIVATE -std=c++11 )
96
- target_compile_options (test_today PRIVATE -std=c++11 )
97
- target_compile_options (tests PRIVATE -std=c++11 )
98
- endif ()
99
93
endif ()
100
94
101
95
if (UPDATE_SAMPLES )
0 commit comments