-CMAKE_MINIMUM_REQUIRED(VERSION 3.25.1)
+cmake_minimum_required(VERSION 3.25.1)
-FIND_PACKAGE(CMOCKA REQUIRED)
-FIND_PROGRAM(CPPCHECK cppcheck REQUIRED)
+find_package(CMOCKA REQUIRED)
+find_program(CPPCHECK cppcheck REQUIRED)
-MESSAGE(STATUS "find ${CMOCKA_LIBRARY}")
-MESSAGE(STATUS "find ${CPPCHECK}")
+message(STATUS "find ${CMOCKA_LIBRARY}")
+message(STATUS "find ${CPPCHECK}")
-ADD_EXECUTABLE("kds_s2000w_net_get_opt_tests"
+add_executable("kds_s2000w_net_get_opt_tests"
"kds_s2000w_net_get_opt_tests.c"
"kds_s2000w_client_mock.c")
-ADD_DEPENDENCIES("kds_s2000w_net_get_opt_tests" sane-kds_s2000w_net-static)
-TARGET_LINK_LIBRARIES("kds_s2000w_net_get_opt_tests"
+add_dependencies("kds_s2000w_net_get_opt_tests" sane-kds_s2000w_net-static)
+target_link_libraries("kds_s2000w_net_get_opt_tests"
${CMOCKA_LIBRARY}
sane-kds_s2000w_net-static)
-ADD_EXECUTABLE("kds_s2000w_net_set_opt_tests"
+add_executable("kds_s2000w_net_set_opt_tests"
"kds_s2000w_net_set_opt_tests.c"
"kds_s2000w_client_mock.c")
-ADD_DEPENDENCIES("kds_s2000w_net_set_opt_tests" sane-kds_s2000w_net-static)
-TARGET_LINK_LIBRARIES("kds_s2000w_net_set_opt_tests"
+add_dependencies("kds_s2000w_net_set_opt_tests" sane-kds_s2000w_net-static)
+target_link_libraries("kds_s2000w_net_set_opt_tests"
${CMOCKA_LIBRARY}
sane-kds_s2000w_net-static)
-ADD_EXECUTABLE("kds_s2000w_net_read_tests"
+add_executable("kds_s2000w_net_read_tests"
"kds_s2000w_net_read_tests.c"
"kds_s2000w_client_mock.c")
-ADD_DEPENDENCIES("kds_s2000w_net_read_tests" sane-kds_s2000w_net-static)
-TARGET_LINK_LIBRARIES("kds_s2000w_net_read_tests"
+add_dependencies("kds_s2000w_net_read_tests" sane-kds_s2000w_net-static)
+target_link_libraries("kds_s2000w_net_read_tests"
${CMOCKA_LIBRARY}
sane-kds_s2000w_net-static)
-ADD_EXECUTABLE("kds_s2000w_net_tests"
+add_executable("kds_s2000w_net_tests"
"kds_s2000w_net_tests.c"
"kds_s2000w_client_mock.c")
-ADD_DEPENDENCIES("kds_s2000w_net_tests" sane-kds_s2000w_net-static)
-TARGET_LINK_LIBRARIES("kds_s2000w_net_tests"
+add_dependencies("kds_s2000w_net_tests" sane-kds_s2000w_net-static)
+target_link_libraries("kds_s2000w_net_tests"
${CMOCKA_LIBRARY}
sane-kds_s2000w_net-static)
-ADD_EXECUTABLE("kds_s2000w_read_config_tests"
+add_executable("kds_s2000w_read_config_tests"
"kds_s2000w_read_config_tests.c"
"kds_s2000w_client_mock.c")
-ADD_DEPENDENCIES("kds_s2000w_read_config_tests" sane-kds_s2000w_net-static)
-TARGET_LINK_LIBRARIES("kds_s2000w_read_config_tests"
+add_dependencies("kds_s2000w_read_config_tests" sane-kds_s2000w_net-static)
+target_link_libraries("kds_s2000w_read_config_tests"
${CMOCKA_LIBRARY}
sane-kds_s2000w_net-static)
-ADD_EXECUTABLE("kds_s2000w_image_converter_tests"
+add_executable("kds_s2000w_image_converter_tests"
"kds_s2000w_image_converter_tests.c"
"kds_s2000w_client_mock.c")
-ADD_DEPENDENCIES("kds_s2000w_image_converter_tests" sane-kds_s2000w_net-static)
-TARGET_LINK_LIBRARIES("kds_s2000w_image_converter_tests"
+add_dependencies("kds_s2000w_image_converter_tests" sane-kds_s2000w_net-static)
+target_link_libraries("kds_s2000w_image_converter_tests"
${CMOCKA_LIBRARY}
sane-kds_s2000w_net-static)
-ADD_EXECUTABLE("kds_s2000w_option_descriptor_tests"
+add_executable("kds_s2000w_option_descriptor_tests"
"kds_s2000w_option_descriptor_tests.c"
"kds_s2000w_client_mock.c")
-ADD_DEPENDENCIES("kds_s2000w_option_descriptor_tests" sane-kds_s2000w_net-static)
-TARGET_LINK_LIBRARIES("kds_s2000w_option_descriptor_tests"
+add_dependencies("kds_s2000w_option_descriptor_tests" sane-kds_s2000w_net-static)
+target_link_libraries("kds_s2000w_option_descriptor_tests"
${CMOCKA_LIBRARY}
sane-kds_s2000w_net-static)
-ADD_EXECUTABLE("kds_s2000w_image_type_check_tests"
+add_executable("kds_s2000w_image_type_check_tests"
"kds_s2000w_image_type_check_tests.c"
"kds_s2000w_client_mock.c")
-ADD_DEPENDENCIES("kds_s2000w_image_type_check_tests" sane-kds_s2000w_net-static)
-TARGET_LINK_LIBRARIES("kds_s2000w_image_type_check_tests"
+add_dependencies("kds_s2000w_image_type_check_tests" sane-kds_s2000w_net-static)
+target_link_libraries("kds_s2000w_image_type_check_tests"
${CMOCKA_LIBRARY}
sane-kds_s2000w_net-static)
-ADD_EXECUTABLE("kds_s2000w_pixel_converter_tests"
+add_executable("kds_s2000w_pixel_converter_tests"
"kds_s2000w_pixel_converter_tests.c"
"kds_s2000w_client_mock.c")
-ADD_DEPENDENCIES("kds_s2000w_pixel_converter_tests" sane-kds_s2000w_net-static)
-TARGET_LINK_LIBRARIES("kds_s2000w_pixel_converter_tests"
+add_dependencies("kds_s2000w_pixel_converter_tests" sane-kds_s2000w_net-static)
+target_link_libraries("kds_s2000w_pixel_converter_tests"
${CMOCKA_LIBRARY}
sane-kds_s2000w_net-static)
-ADD_CUSTOM_TARGET("runningtests"
+add_custom_target("runningtests"
ALL ./kds_s2000w_read_config_tests
COMMAND ./kds_s2000w_option_descriptor_tests
COMMAND ./kds_s2000w_net_get_opt_tests
"kds_s2000w_image_converter_tests"
"kds_s2000w_pixel_converter_tests")
-ADD_CUSTOM_TARGET("cppcheck"
+add_custom_target("cppcheck"
ALL ${CPPCHECK} --check-level=exhaustive
--enable=warning,style
--inline-suppr
${CMAKE_SOURCE_DIR}/tests
DEPENDS runningtests)
-ADD_CUSTOM_TARGET("generate_gcov_coverage"
+add_custom_target("generate_gcov_coverage"
ALL gcov ${CMAKE_BINARY_DIR}/src/CMakeFiles/sane-kds_s2000w_net-static.dir/*.c.o
DEPENDS "runningtests")
-ADD_CUSTOM_TARGET("generate_lcov_coverage"
+add_custom_target("generate_lcov_coverage"
ALL lcov --capture
--directory ${CMAKE_BINARY_DIR}/src/CMakeFiles/sane-kds_s2000w_net-static.dir
--exclude "include*"
--output-file ${CMAKE_BINARY_DIR}/coverage.info
DEPENDS "generate_gcov_coverage")
-ADD_CUSTOM_TARGET("generate_html_coverage"
+add_custom_target("generate_html_coverage"
ALL genhtml ${CMAKE_BINARY_DIR}/coverage.info --output-directory ${CMAKE_BINARY_DIR}/coverage
DEPENDS "generate_lcov_coverage")
\ No newline at end of file