We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5c38a0c commit 4f6f18eCopy full SHA for 4f6f18e
cmake/FindObjectBoxGenerator.cmake
@@ -422,6 +422,12 @@ function (add_obx_schema)
422
set(prev_cppfile ${cppfile})
423
list(APPEND sources ${cppfile} ${hppfile})
424
endforeach()
425
+
426
+ if (NOT TARGET ${ARG_TARGET})
427
+ # Fail fast with a nice error message if the target does not exist.
428
+ # Otherwise, it would fail on target_sources() with a not so straight-forward error message.
429
+ message(FATAL_ERROR "add_obx_schema(): the given target \"${ARG_TARGET}\" was not found. Make sure to define it before calling add_obx_schema().")
430
+ endif()
431
target_sources(${ARG_TARGET} PRIVATE ${sources})
432
if (NOT ARG_INSOURCE)
433
target_include_directories(${ARG_TARGET} PRIVATE ${OBX_GEN_OUTPUT_DIR_HEADERS})
0 commit comments