Skip to content

Commit 9c72552

Browse files
committed
fix: allow options without prefix but issue a deprecation warning
1 parent e4b3f85 commit 9c72552

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

CMakeLists.txt

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,23 @@ option(NODESETLOADER_ENABLE_BUILD_INTO_OPEN62541 "make nodesetLoader part of the
1515
option(NODESETLOADER_ENABLE_DATATYPEIMPORT_TEST "run tests for importing datatypes" off)
1616
option(NODESETLOADER_CALC_COVERAGE "calculate code coverage" off)
1717

18+
# deprecated options without project prefix
19+
if(DEFINED ENABLE_BACKEND_STDOUT)
20+
message(WARNING "ENABLE_BACKEND_STDOUT is deprecated. Use NODESETLOADER_ENABLE_BACKEND_STDOUT instead.")
21+
set(NODESETLOADER_ENABLE_BACKEND_STDOUT ${ENABLE_BACKEND_STDOUT} CACHE BOOL "backend for stdout" FORCE)
22+
endif()
23+
if(DEFINED ENABLE_BUILD_INTO_OPEN62541)
24+
message(WARNING "ENABLE_BUILD_INTO_OPEN62541 is deprecated. Use NODESETLOADER_ENABLE_BUILD_INTO_OPEN62541 instead.")
25+
set(NODESETLOADER_ENABLE_BUILD_INTO_OPEN62541 ${ENABLE_BUILD_INTO_OPEN62541} CACHE BOOL "make nodesetLoader part of the open62541 library" FORCE)
26+
endif()
27+
1828
# TODO: Include integration tests after support for XML Data
1929
# Encoding has been added to the open62541 >= 1.3.2.
2030
# Currently, the integration tests will fail for
2131
# open62541 v1.3.2 and disable successful CI build.
2232
set(NODESETLOADER_ENABLE_INTEGRATION_TEST off)
2333

2434
if(${NODESETLOADER_ENABLE_BUILD_INTO_OPEN62541})
25-
2635
# Disble code coverage, since this will be covered within open62541
2736
set(NODESETLOADER_CALC_COVERAGE off)
2837

0 commit comments

Comments
 (0)