diff options
| author | Thomas Vanbesien <tvanbesi@proton.me> | 2026-02-17 14:27:51 +0100 |
|---|---|---|
| committer | Thomas Vanbesien <tvanbesi@proton.me> | 2026-02-17 14:28:55 +0100 |
| commit | ff1e0c9ba8e6c42457b34bfbac2bda1dbbffb91b (patch) | |
| tree | e56d8abd98005c66588c7903c27879ad34791db0 | |
| parent | 79b631a2572748606431fd4e3c1ee38a47cad5a9 (diff) | |
| download | BobinkCOpcUa-ff1e0c9ba8e6c42457b34bfbac2bda1dbbffb91b.tar.gz BobinkCOpcUa-ff1e0c9ba8e6c42457b34bfbac2bda1dbbffb91b.zip | |
Fix CMakeLists.txt header comment to survive cmake-format
| -rw-r--r-- | CMakeLists.txt | 85 | ||||
| -rw-r--r-- | cmake/BuildDeps.cmake | 14 |
2 files changed, 44 insertions, 55 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 36c5167..78f661d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,14 +1,14 @@ # ====================================== -# OPC UA Discovery — Top-level build +# OPC UA Discovery — Top-level build # ====================================== # -# Builds three programs that demonstrate OPC UA discovery: -# ServerLDS — Local Discovery Server -# ServerRegister — Server that registers with the LDS -# ClientFindServers — Client that queries the LDS +# Builds three programs that demonstrate OPC UA discovery. ServerLDS runs a +# Local Discovery Server. ServerRegister periodically registers itself with the +# LDS. ClientFindServers queries the LDS for registered servers and their +# endpoints. # -# All programs link against DiscoveryCommon (shared helpers and -# config parser) which in turn depends on open62541. +# All programs link against DiscoveryCommon (shared helpers and config parser) +# which in turn depends on open62541. cmake_minimum_required(VERSION 4.0) project(OpcUaDiscovery C) @@ -19,11 +19,11 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON) include(cmake/BuildDeps.cmake) # ====================================== -# Libraries and executables +# Libraries and executables # ====================================== -# Shared helpers (file loading, security factories, config parser) -# used by all three programs. +# Shared helpers (file loading, security factories, config parser) used by all +# three programs. add_library(DiscoveryCommon STATIC src/common.c src/config.c) target_link_libraries(DiscoveryCommon open62541::open62541) @@ -40,53 +40,42 @@ add_executable(ServerRegister src/server_register.c) target_link_libraries(ServerRegister DiscoveryCommon) # ====================================== -# Documentation +# Documentation # ====================================== -# Builds the open62541 HTML documentation via Sphinx. -# Requires python3-sphinx, python3-sphinx-rtd-theme, graphviz. +# Builds the open62541 HTML documentation via Sphinx. Requires python3-sphinx, +# python3-sphinx-rtd-theme, graphviz. option(BUILD_DOC "Build open62541 HTML documentation" OFF) if(BUILD_DOC) - add_custom_target(doc + add_custom_target( + doc COMMAND ${CMAKE_COMMAND} --build "${OPEN62541_BUILD_DIR}" --target doc COMMENT "Building open62541 HTML documentation" VERBATIM) endif() # ====================================== -# Integration tests +# Integration tests # ====================================== # -# Each test exercises a combination of security mode/policy and -# authentication method. _test_names and _test_policies are -# parallel lists: the Nth name uses the Nth policy. Each name -# corresponds to a config directory under tests/ containing -# server_lds.conf, server_register.conf, client_find_servers.conf. - -enable_testing () - -set (_test_script "${CMAKE_SOURCE_DIR}/tests/run_test.sh") - -set (_test_names - none_anon - none_user - basic256sha256_anon - basic256sha256_user - aes128_anon - aes128_user) - -set (_test_policies - None - None - Basic256Sha256 - Basic256Sha256 - Aes128_Sha256_RsaOaep - Aes128_Sha256_RsaOaep) - -foreach (_name _policy IN ZIP_LISTS _test_names _test_policies) - add_test (NAME "${_name}" - COMMAND bash "${_test_script}" "tests/${_name}" "${_policy}") - set_tests_properties ("${_name}" PROPERTIES - WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}" - TIMEOUT 30) -endforeach () +# Each test exercises a combination of security mode/policy and authentication +# method. _test_names and _test_policies are parallel lists: the Nth name uses +# the Nth policy. Each name corresponds to a config directory under tests/ +# containing server_lds.conf, server_register.conf, client_find_servers.conf. + +enable_testing() + +set(_test_script "${CMAKE_SOURCE_DIR}/tests/run_test.sh") + +set(_test_names none_anon none_user basic256sha256_anon basic256sha256_user + aes128_anon aes128_user) + +set(_test_policies None None Basic256Sha256 Basic256Sha256 + Aes128_Sha256_RsaOaep Aes128_Sha256_RsaOaep) + +foreach(_name _policy IN ZIP_LISTS _test_names _test_policies) + add_test(NAME "${_name}" COMMAND bash "${_test_script}" "tests/${_name}" + "${_policy}") + set_tests_properties("${_name}" PROPERTIES WORKING_DIRECTORY + "${CMAKE_SOURCE_DIR}" TIMEOUT 30) +endforeach() diff --git a/cmake/BuildDeps.cmake b/cmake/BuildDeps.cmake index 1f64e1f..ddc3d34 100644 --- a/cmake/BuildDeps.cmake +++ b/cmake/BuildDeps.cmake @@ -1,12 +1,11 @@ # ====================================== -# BuildDeps.cmake +# BuildDeps.cmake # ====================================== # -# Configures, builds, and installs the open62541 library into a -# local prefix under the build tree. Skips the build when the -# installed shared library already exists. After installation, -# open62541 is imported via find_package so downstream targets -# can link against open62541::open62541. +# Configures, builds, and installs the open62541 library into a local prefix +# under the build tree. Skips the build when the installed shared library +# already exists. After installation, open62541 is imported via find_package so +# downstream targets can link against open62541::open62541. set(OPEN62541_SOURCE_DIR "${CMAKE_SOURCE_DIR}/deps/open62541") set(OPEN62541_BUILD_DIR "${CMAKE_BINARY_DIR}/deps/open62541") @@ -55,4 +54,5 @@ else() message(STATUS "open62541 already built, skipping") endif() -find_package(open62541 REQUIRED PATHS "${OPEN62541_INSTALL_DIR}" NO_DEFAULT_PATH) +find_package(open62541 REQUIRED PATHS "${OPEN62541_INSTALL_DIR}" + NO_DEFAULT_PATH) |
