diff --git a/CMakeLists.txt b/CMakeLists.txt index 945b87755aee0f22ff06bfe7305c153f001a8c78..64cc1d9875da89d1e1db05f2f7687d2cc415e679 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,26 +14,24 @@ configure_file( "${CMAKE_CURRENT_SOURCE_DIR}/json/vtkjsoncpp_config.h.in" "${CMAKE_CURRENT_BINARY_DIR}/json/vtkjsoncpp_config.h") -vtk_add_library(vtkjsoncpp ${sources} ${headers}) - -if (NOT VTK_INSTALL_NO_DEVELOPMENT) - install(FILES - ${headers} - DESTINATION "${VTK_INSTALL_INCLUDE_DIR}/vtkjsoncpp/json" - COMPONENT Development) -endif() - +vtk_module_add_module(VTK::jsoncpp + SOURCES ${sources} + HEADERS ${headers} + HEADERS_SUBDIR vtkjsoncpp/json) if (VTK_REQUIRE_LARGE_FILE_SUPPORT) - target_compile_definitions(vtkjsoncpp + target_compile_definitions(jsoncpp PRIVATE _LARGEFILE_SOURCE _LARGEFILE64_SOURCE _LARGE_FILES _FILE_OFFSET_BITS=64) endif () -target_include_directories(vtkjsoncpp +target_include_directories(jsoncpp PUBLIC "$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/json>") -set_target_properties(vtkjsoncpp +target_compile_features(jsoncpp + PUBLIC + cxx_std_11) +set_target_properties(jsoncpp PROPERTIES DEFINE_SYMBOL JSON_DLL_BUILD) diff --git a/json/json-forwards.h b/json/json-forwards.h index 3dc2c6ef59832f89322e431ac5ab6168decc35cb..3c98214032b954b5559dfced2482657dbfc29329 100644 --- a/json/json-forwards.h +++ b/json/json-forwards.h @@ -125,6 +125,8 @@ license you like. #endif #endif +#include "vtkjsoncpp_config.h" + #ifdef JSON_IN_CPPTL #define JSON_API CPPTL_API #elif defined(JSON_DLL_BUILD) diff --git a/json/json.h b/json/json.h index 7ee83de7a673dcc904c5cbdb0b636738a2a7252a..990f16d3157d2b5a41784f0aec8db1ab635a9900 100644 --- a/json/json.h +++ b/json/json.h @@ -158,6 +158,8 @@ license you like. #endif #endif +#include "vtkjsoncpp_config.h" + #ifdef JSON_IN_CPPTL #define JSON_API CPPTL_API #elif defined(JSON_DLL_BUILD)