@@ -3,21 +3,53 @@ cmake_minimum_required (VERSION 3.2.0 FATAL_ERROR)
3
3
# set project and version
4
4
project (taocpp-json VERSION 1.0.0 LANGUAGES CXX)
5
5
6
- # set C++ language standard
7
- set (CMAKE_CXX_STANDARD 11)
8
- set (CMAKE_CXX_STANDARD_REQUIRED ON )
9
-
10
6
# define a header-only library
11
7
add_library (taocpp-json INTERFACE )
8
+ add_library (taocpp::json ALIAS taocpp-json)
12
9
target_include_directories (taocpp-json INTERFACE
13
10
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR} /include >
14
11
$<INSTALL_INTERFACE:include >
15
12
)
16
13
14
+ # features used by taocpp/json
15
+ target_compile_features (taocpp-json INTERFACE
16
+ cxx_alias_templates
17
+ cxx_auto_type
18
+ cxx_constexpr
19
+ cxx_decltype
20
+ cxx_default_function_template_args
21
+ cxx_defaulted_functions
22
+ cxx_delegating_constructors
23
+ cxx_deleted_functions
24
+ cxx_explicit_conversions
25
+ cxx_generalized_initializers
26
+ cxx_inheriting_constructors
27
+ cxx_inline_namespaces
28
+ cxx_noexcept
29
+ cxx_nonstatic_member_init
30
+ cxx_nullptr
31
+ cxx_range_for
32
+ cxx_rvalue_references
33
+ cxx_static_assert
34
+ cxx_strong_enums
35
+ cxx_template_template_parameters
36
+ cxx_trailing_return_types
37
+ cxx_uniform_initialization
38
+ cxx_variadic_macros
39
+ cxx_variadic_templates
40
+ )
41
+
17
42
# testing
18
43
enable_testing ()
19
- add_subdirectory (src/test /json)
44
+ option (TAOCPP_JSON_BUILD_TESTS "Build test programs" ON )
45
+ if (TAOCPP_JSON_BUILD_TESTS)
46
+ add_subdirectory (src/test /json)
47
+ endif ()
48
+
49
+ # installation directories
50
+ set (TAOCPP_JSON_INSTALL_INCLUDE_DIR "include" CACHE STRING "The installation include directory" )
51
+ set (TAOCPP_JSON_INSTALL_DOC_DIR "share/doc/tao/json" CACHE STRING "The installation doc directory" )
20
52
21
53
# install
22
- install (DIRECTORY include / DESTINATION include )
23
- install (FILES LICENSE DESTINATION include /tao/json )
54
+ install (DIRECTORY include / DESTINATION ${TAOCPP_JSON_INSTALL_INCLUDE_DIR} )
55
+ install (FILES LICENSE DESTINATION ${TAOCPP_JSON_INSTALL_DOC_DIR} )
0 commit comments