BUG: New CMake features used that break backward compatibility

We desire for jsoncpp to compile and be readily available
with older  versions of cmake.  The use of newer cmake
commands requires conditional statements so that older
strategies can be used with older versions of cmake.

Resolves: #1018
This commit is contained in:
Hans Johnson
2019-10-16 09:38:05 -05:00
committed by Hans Johnson
parent bdacfd7bc0
commit aebc7faa4f
4 changed files with 65 additions and 8 deletions

View File

@@ -10,7 +10,11 @@ add_executable( jsoncpp_test
if(BUILD_SHARED_LIBS)
if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.12.0)
add_compile_definitions( JSON_DLL )
else()
add_definitions( -DJSON_DLL )
endif()
endif()
target_link_libraries(jsoncpp_test jsoncpp_lib)