From 30e4023a2edba1a1873668f270e6d2040a799c25 Mon Sep 17 00:00:00 2001 From: Andres6936 Date: Sun, 26 Dec 2021 09:21:47 -0500 Subject: [PATCH] Better Quality Test --- src/jsontestrunner/CMakeLists.txt | 31 +++++++------------------------ 1 file changed, 7 insertions(+), 24 deletions(-) diff --git a/src/jsontestrunner/CMakeLists.txt b/src/jsontestrunner/CMakeLists.txt index 1fc71ea..ca18773 100644 --- a/src/jsontestrunner/CMakeLists.txt +++ b/src/jsontestrunner/CMakeLists.txt @@ -1,28 +1,11 @@ -if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.12.0) - # The new Python3 module is much more robust than the previous PythonInterp - find_package(Python3 COMPONENTS Interpreter) - # Set variables for backwards compatibility with cmake < 3.12.0 - set(PYTHONINTERP_FOUND ${Python3_Interpreter_FOUND}) - set(PYTHON_EXECUTABLE ${Python3_EXECUTABLE}) -else() - set(Python_ADDITIONAL_VERSIONS 3.8) - find_package(PythonInterp 3) -endif() +# The new Python3 module is much more robust than the previous PythonInterp +FIND_PACKAGE(Python3 COMPONENTS Interpreter) +# Set variables for backwards compatibility with cmake < 3.12.0 +SET(PYTHONINTERP_FOUND ${Python3_Interpreter_FOUND}) +SET(PYTHON_EXECUTABLE ${Python3_EXECUTABLE}) -add_executable(jsontestrunner_exe - main.cpp -) - -if(BUILD_SHARED_LIBS) - if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.12.0) - add_compile_definitions( JSON_DLL ) - else() - add_definitions(-DJSON_DLL) - endif() - target_link_libraries(jsontestrunner_exe jsoncpp_lib) -else() - target_link_libraries(jsontestrunner_exe jsoncpp_static) -endif() +ADD_EXECUTABLE(jsontestrunner_exe main.cpp) +TARGET_LINK_LIBRARIES(jsontestrunner_exe PRIVATE jsoncpp::framework) set_target_properties(jsontestrunner_exe PROPERTIES OUTPUT_NAME jsontestrunner_exe)