From b8af211f9a3647687c7e45c0fd04b0768df87ffe Mon Sep 17 00:00:00 2001 From: Glenn Smith Date: Tue, 1 Feb 2022 16:34:18 -0500 Subject: Fancier CMake: find scripts, out-of-tree example builds --- examples/workflows/objectivec/CMakeLists.txt | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'examples/workflows/objectivec') diff --git a/examples/workflows/objectivec/CMakeLists.txt b/examples/workflows/objectivec/CMakeLists.txt index f5f8ea5e..a4c0198a 100644 --- a/examples/workflows/objectivec/CMakeLists.txt +++ b/examples/workflows/objectivec/CMakeLists.txt @@ -9,6 +9,17 @@ file(GLOB SOURCES add_library(workflow_objectivec SHARED ${SOURCES}) +if(NOT BN_API_BUILD_EXAMPLES) + # Out-of-tree build + find_path( + BN_API_DIR + NAMES binaryninjaapi.h + HINTS ../../.. binaryninjaapi $ENV{BN_API_DIR} + REQUIRED + ) + add_subdirectory(${BN_API_DIR} api) +endif() + target_link_libraries(workflow_objectivec binaryninjaapi) set_target_properties(workflow_objectivec PROPERTIES -- cgit v1.3.1