template_find_header_project.cmake 1.43 KB
Newer Older
Pierre Aubert's avatar
Pierre Aubert committed
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

##########################################################################
#                                                                        #
#         test de présence des headers de la @PROJECT_NAME_UPPER@        #
#                                                                        #
##########################################################################

@PHOENIX_PACKAGE_PEDENDENCIES@

find_path(@PROJECT_NAME_UPPER@_INCLUDE_DIR
	NAMES @headerFile@
	PATHS "${@PROJECT_NAME_UPPER@_PREFIX}/include/@projectName@" ${CMAKE_INSTALL_PREFIX}/include/@projectName@
		$ENV{HOME}/usr/include/@projectName@ ${CMAKE_INCLUDE_PATH}/@projectName@ /usr/include/@projectName@ /usr/local/include/@projectName@ 
)

if(@PROJECT_NAME_UPPER@_INCLUDE_DIR)
	message(STATUS "Found @PROJECT_NAME_UPPER@ headers : ${@PROJECT_NAME_UPPER@_INCLUDE_DIR}")
else(@PROJECT_NAME_UPPER@_INCLUDE_DIR)
	message(FATAL_ERROR "@PROJECT_NAME_UPPER@ headers not found")
endif(@PROJECT_NAME_UPPER@_INCLUDE_DIR)

include_directories(${@PROJECT_NAME_UPPER@_INCLUDE_DIR})

set(@PROJECT_NAME_UPPER@_PREFIX "${@PROJECT_NAME_UPPER@_INCLUDE_DIR}/..")

Pierre Aubert's avatar
Pierre Aubert committed
26
set(@PROJECT_NAME_UPPER@ @libraryTargetName@ @EXTRA_DEPENDENCIES_LIB@ CACHE BOOL "@PROJECT_NAME_UPPER@ library and dependencies")
Pierre Aubert's avatar
Pierre Aubert committed
27 28 29 30 31 32 33

set(@PROJECT_NAME_UPPER@_FOUND "YES" CACHE BOOL "@PROJECT_NAME_UPPER@ program found")

include_directories(${@PROJECT_NAME_UPPER@_INCLUDE_DIR} ${@PROJECT_NAME_UPPER@_INCLUDE_DIR}/../)

@EXTRA_INCLUDE_CMAKE@