diff --git a/view/sharedcache/CMakeLists.txt b/view/sharedcache/CMakeLists.txt index 0f6abea22..d3083f809 100644 --- a/view/sharedcache/CMakeLists.txt +++ b/view/sharedcache/CMakeLists.txt @@ -2,11 +2,14 @@ cmake_minimum_required(VERSION 3.13 FATAL_ERROR) project(sharedcache) -if((NOT BN_API_PATH) AND (NOT BN_INTERNAL_BUILD)) - set(BN_API_PATH $ENV{BN_API_PATH} CACHE STRING "Path to Binary Ninja API source") - if(NOT BN_API_PATH) - message(FATAL_ERROR "Provide path to Binary Ninja API source in BN_API_PATH") - endif() +if(NOT BN_INTERNAL_BUILD) + find_path( + BN_API_PATH + NAMES binaryninjaapi.h + HINTS ../../.. binaryninjaapi $ENV{BN_API_PATH} + REQUIRED + ) + add_subdirectory(${BN_API_PATH} binaryninjaapi) endif() if (NOT BN_INTERNAL_BUILD) @@ -105,4 +108,4 @@ message(" ▒▒▓ ▒ ▒ ▒▓▒ ▒ ░░ ░▒ ▒ ░ Crash on Failure: ${HARD_FAIL_MODE} ░ ▒ ▒ ░ ░▒ ░ ░ ░ ▒ Slideinfo Debug Tags: ${SLIDEINFO_DEBUG_TAGS} ░ ░ ░ ░ ░ ░ ░ REFCOUNT_DEBUG: ${BN_REF_COUNT_DEBUG} -") \ No newline at end of file +")