X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=extra%2FFindNanopb.cmake;h=9afb21d0b1f1ccf4c04358e8723ca093c1c0040c;hb=bc2c47ef77a29e7efdaf088b9a0f7bf15a53c976;hp=7734a937b393748affc29cc9a4c22b4b156889cd;hpb=a97617bb41d2e03c670467a0d053b4d2eaae8dad;p=apps%2Fagl-service-can-low-level.git diff --git a/extra/FindNanopb.cmake b/extra/FindNanopb.cmake index 7734a937..9afb21d0 100644 --- a/extra/FindNanopb.cmake +++ b/extra/FindNanopb.cmake @@ -1,10 +1,6 @@ # This is an example script for use with CMake projects for locating and configuring # the nanopb library. # -# The following varialbes have to be set: -# -# NANOPB_SRC_ROOT_FOLDER - Path to nanopb source folder -# # The following variables can be set and are optional: # # @@ -217,6 +213,12 @@ if(NOT DEFINED NANOPB_GENERATE_CPP_APPEND_PATH) set(NANOPB_GENERATE_CPP_APPEND_PATH TRUE) endif() +# Make a really good guess regarding location of NANOPB_SRC_ROOT_FOLDER +if(NOT DEFINED NANOPB_SRC_ROOT_FOLDER) + get_filename_component(NANOPB_SRC_ROOT_FOLDER + ${CMAKE_CURRENT_LIST_DIR}/.. ABSOLUTE) +endif() + # Find the include directory find_path(NANOPB_INCLUDE_DIRS pb.h