~thestr4ng3r/chiaki

ref: 796a12845684afe5c4b194d4111bcdcf5b04aca2 chiaki/cmake/FindNanopb.cmake -rw-r--r-- 440 bytes
796a1284Florian Märkl Fix fec.c extension 9 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# Provides Nanopb::nanopb and NANOPB_GENERATOR_PY

find_package(nanopb CONFIG)
find_file(NANOPB_GENERATOR_PY nanopb_generator.py PATH_SUFFIXES bin)

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Nanopb
	FOUND_VAR Nanopb_FOUND
	REQUIRED_VARS
		nanopb_FOUND
		NANOPB_GENERATOR_PY
)

if(Nanopb_FOUND)
	if(NOT TARGET Nanopb::nanopb)
		add_library(Nanopb::nanopb ALIAS nanopb::protobuf-nanopb-static)
	endif()
endif()