-CMAKE_MINIMUM_REQUIRED(VERSION 3.25.1)
+cmake_minimum_required(VERSION 3.25.1)
-SET(CMAKE_C_COMPILER gcc)
-MESSAGE(STATUS "CMAKE_C_COMPILER: ${CMAKE_C_COMPILER}")
+set(CMAKE_C_COMPILER gcc)
+message(STATUS "CMAKE_C_COMPILER: ${CMAKE_C_COMPILER}")
-PROJECT("kds-s2000w-net")
+project(kds-s2000w-net)
-SET(CMAKE_BUILD_TYPE "Release" CACHE STRING "release")
+set(CMAKE_BUILD_TYPE Release
+ CACHE STRING "build type [Debug|Release]")
-IF(CMAKE_BUILD_TYPE STREQUAL "Release")
- SET(CMAKE_C_FLAGS "-std=c99 -fPIC -Wall -Wextra -Wno-unused-parameter -Werror -pedantic" CACHE STRING "compiler flags" FORCE)
-ENDIF()
+if(CMAKE_BUILD_TYPE STREQUAL Release)
+ set(CMAKE_C_FLAGS "-std=c99 -fPIC -Wall -Wextra -Wno-unused-parameter -Werror -pedantic"
+ CACHE STRING "release compiler flags" FORCE)
+endif()
-IF(CMAKE_BUILD_TYPE STREQUAL "Debug")
- SET(CMAKE_C_FLAGS "-std=c99 -fPIC -Wall -Wextra -Wno-unused-parameter -pedantic -g" CACHE STRING "debug compiler flags" FORCE)
-ENDIF()
+if(CMAKE_BUILD_TYPE STREQUAL Debug)
+ SET(CMAKE_C_FLAGS "-std=c99 -fPIC -Wall -Wextra -Wno-unused-parameter -pedantic -g"
+ CACHE STRING "debug compiler flags" FORCE)
+endif()
-IF (RUN_TESTS)
- SET(CMAKE_BUILD_TYPE "Debug" CACHE STRING "debug" FORCE)
- SET(CMAKE_C_FLAGS "-std=c99 -fPIC \
+if(RUN_TESTS)
+ set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "debug" FORCE)
+ set(CMAKE_C_FLAGS "-std=c99 -fPIC \
-fprofile-arcs \
-ftest-coverage \
-Wall \
--wrap,kds_s2000w_client_set_option,\
--wrap,kds_s2000w_client_get_capabilities,\
--wrap,kds_s2000w_image_converter_to_pnm"
-CACHE STRING "test coverage compiler flags" FORCE)
-ENDIF()
+ CACHE STRING "test coverage compiler flags" FORCE)
+endif()
-MESSAGE(STATUS "CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
-MESSAGE(STATUS "CMAKE_C_FLAGS: ${CMAKE_C_FLAGS}")
+message(STATUS "CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
+message(STATUS "CMAKE_C_FLAGS: ${CMAKE_C_FLAGS}")
-ADD_SUBDIRECTORY(src)
+add_subdirectory(src)
-OPTION(RUN_TESTS "Enable tests" OFF)
-MESSAGE(STATUS "RUN_TESTS: ${RUN_TESTS}")
-IF(RUN_TESTS)
- ADD_SUBDIRECTORY(tests)
-ENDIF()
\ No newline at end of file
+option(RUN_TESTS "Enable tests" OFF)
+message(STATUS "RUN_TESTS: ${RUN_TESTS}")
+if(RUN_TESTS)
+ add_subdirectory(tests)
+endif()
\ No newline at end of file