summaryrefslogtreecommitdiff
path: root/cmake/FindWaffle.cmake
blob: c463004b3f5a86d470166de635fa15eea4111d75 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# - try to find Waffle include dirs and library

if (ANDROID)
    set (Android_root_path "$ENV{OUT}")
	if (Android_root_path)
		set (Waffle_INC_SEARCH_PATH "$ENV{OUT}/obj/include/waffle-1"
			"$ENV{OUT}/obj/lib"
			"$ENV{ANDROID_BUILD_TOP}/external/waffle"
		)

		set (Waffle_LIB_SEARCH_PATH "$ENV{OUT}/obj/lib")
	endif ()

	find_path (Waffle_INCLUDE_DIRS waffle.h
		PATHS ${Waffle_INC_SEARCH_PATH}
		DOC "The directory where waffle.h resides"
		NO_CMAKE_FIND_ROOT_PATH NO_DEFAULT_PATH
		)

	find_library (Waffle_LIBRARIES waffle-1
		PATHS ${Waffle_LIB_SEARCH_PATH}
		DOC "The directory where libwaffle-1 resides"
		NO_CMAKE_FIND_ROOT_PATH NO_DEFAULT_PATH
		)
else ()
	find_package (PkgConfig)
	if (PKG_CONFIG_FOUND)
		pkg_search_module (Waffle waffle-1)
	endif ()
endif ()

include (FindPackageHandleStandardArgs)
find_package_handle_standard_args (Waffle DEFAULT_MSG Waffle_LIBRARIES Waffle_INCLUDE_DIRS)