# Check whether a framework is present in the current system SDK. # If yes, put it into RES_VAR, but not as an absolute path to avoid link errors when switching SDK at build time. macro(find_apple_system_fwk RES_VAR NAME) find_library(${NAME}_FULL_PATH ${NAME}) mark_as_advanced(${NAME}_FULL_PATH) if (${NAME}_FULL_PATH) set(${RES_VAR} "-framework ${NAME}") else() set(${RES_VAR} "${NAME}-NOTFOUND") endif() endmacro(find_apple_system_fwk) macro(find_apple_fwk RES_VAR NAME PATH) find_library(FRAMEWORK_${NAME} NAMES ${NAME} PATHS ${PATH} PATH_SUFFIXES Frameworks NO_DEFAULT_PATH) if( ${FRAMEWORK_${NAME}} STREQUAL FRAMEWORK_${NAME}-NOTFOUND) MESSAGE(ERROR ": Framework ${NAME} not found") else() set(${RES_VAR}_INCLUDE_DIR FRAMEWORK_${NAME}/Headers) set(${RES_VAR}_LIBS "-framework ${NAME}") set(${RES_VAR}_FOUND TRUE) MESSAGE(STATUS "Framework ${NAME} found at ${FRAMEWORK_${NAME}}") endif() endmacro(find_apple_fwk)