@@ -3,21 +3,53 @@ cmake_minimum_required (VERSION 3.2.0 FATAL_ERROR)
33# set project and version
44project (taocpp-json VERSION 1.0.0 LANGUAGES CXX)
55
6- # set C++ language standard
7- set (CMAKE_CXX_STANDARD 11)
8- set (CMAKE_CXX_STANDARD_REQUIRED ON )
9-
106# define a header-only library
117add_library (taocpp-json INTERFACE )
8+ add_library (taocpp::json ALIAS taocpp-json)
129target_include_directories (taocpp-json INTERFACE
1310 $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR} /include >
1411 $<INSTALL_INTERFACE:include >
1512)
1613
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+
1742# testing
1843enable_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" )
2052
2153# 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