Commit 41d2a296 authored by Pierre Aubert's avatar Pierre Aubert
Browse files

Make the find appears only the first time cmake is called

parent 285908e6
Pipeline #118980 passed with stages
in 6 minutes and 10 seconds
...@@ -7,6 +7,14 @@ ...@@ -7,6 +7,14 @@
@PHOENIX_PACKAGE_PEDENDENCIES@ @PHOENIX_PACKAGE_PEDENDENCIES@
if(@PROJECT_NAME_UPPER@_FOUND)
link_directories(${@PROJECT_NAME_UPPER@_LIBRARY_DIR})
include_directories(${@PROJECT_NAME_UPPER@_INCLUDE_DIR} ${@PROJECT_NAME_UPPER@_INCLUDE_DIR}/../)
@EXTRA_INCLUDE_CMAKE@
return()
endif()
find_path(@PROJECT_NAME_UPPER@_INCLUDE_DIR find_path(@PROJECT_NAME_UPPER@_INCLUDE_DIR
NAMES @headerFile@ NAMES @headerFile@
PATHS "${@PROJECT_NAME_UPPER@_PREFIX}/include/@projectName@" ${CMAKE_INSTALL_PREFIX}/include/@projectName@ PATHS "${@PROJECT_NAME_UPPER@_PREFIX}/include/@projectName@" ${CMAKE_INSTALL_PREFIX}/include/@projectName@
......
...@@ -7,6 +7,14 @@ ...@@ -7,6 +7,14 @@
@PHOENIX_PACKAGE_PEDENDENCIES@ @PHOENIX_PACKAGE_PEDENDENCIES@
if(@PROJECT_NAME_UPPER@_FOUND)
link_directories(${@PROJECT_NAME_UPPER@_LIBRARY_DIR})
include_directories(${@PROJECT_NAME_UPPER@_INCLUDE_DIR} ${@PROJECT_NAME_UPPER@_INCLUDE_DIR}/../)
@EXTRA_INCLUDE_CMAKE@
return()
endif()
find_path(@PROJECT_NAME_UPPER@_INCLUDE_DIR find_path(@PROJECT_NAME_UPPER@_INCLUDE_DIR
NAMES @headerFile@ NAMES @headerFile@
PATHS "${@PROJECT_NAME_UPPER@_PREFIX}/include/@projectName@" ${CMAKE_INSTALL_PREFIX}/include/@projectName@ PATHS "${@PROJECT_NAME_UPPER@_PREFIX}/include/@projectName@" ${CMAKE_INSTALL_PREFIX}/include/@projectName@
...@@ -15,6 +23,7 @@ find_path(@PROJECT_NAME_UPPER@_INCLUDE_DIR ...@@ -15,6 +23,7 @@ find_path(@PROJECT_NAME_UPPER@_INCLUDE_DIR
if(@PROJECT_NAME_UPPER@_INCLUDE_DIR) if(@PROJECT_NAME_UPPER@_INCLUDE_DIR)
message(STATUS "Found @PROJECT_NAME_UPPER@ headers : ${@PROJECT_NAME_UPPER@_INCLUDE_DIR}") message(STATUS "Found @PROJECT_NAME_UPPER@ headers : ${@PROJECT_NAME_UPPER@_INCLUDE_DIR}")
set(@PROJECT_NAME_UPPER@_INCLUDE_DIR "${@PROJECT_NAME_UPPER@_INCLUDE_DIR}" CACHE STRING "@PROJECT_NAME_UPPER@ include directory")
else(@PROJECT_NAME_UPPER@_INCLUDE_DIR) else(@PROJECT_NAME_UPPER@_INCLUDE_DIR)
message(FATAL_ERROR "@PROJECT_NAME_UPPER@ headers not found") message(FATAL_ERROR "@PROJECT_NAME_UPPER@ headers not found")
endif(@PROJECT_NAME_UPPER@_INCLUDE_DIR) endif(@PROJECT_NAME_UPPER@_INCLUDE_DIR)
...@@ -39,6 +48,7 @@ find_path(@PROJECT_NAME_UPPER@_LIBRARY_DIR ...@@ -39,6 +48,7 @@ find_path(@PROJECT_NAME_UPPER@_LIBRARY_DIR
if(@PROJECT_NAME_UPPER@_LIBRARY_DIR) if(@PROJECT_NAME_UPPER@_LIBRARY_DIR)
message(STATUS "Found lib @PROJECT_NAME_UPPER@ : ${@PROJECT_NAME_UPPER@_LIBRARY_DIR}") message(STATUS "Found lib @PROJECT_NAME_UPPER@ : ${@PROJECT_NAME_UPPER@_LIBRARY_DIR}")
set(@PROJECT_NAME_UPPER@_LIBRARY_DIR "${@PROJECT_NAME_UPPER@_LIBRARY_DIR}" CACHE STRING "@PROJECT_NAME_UPPER@ library directory")
else(@PROJECT_NAME_UPPER@_LIBRARY_DIR) else(@PROJECT_NAME_UPPER@_LIBRARY_DIR)
message(FATAL_ERROR "lib @PROJECT_NAME_UPPER@ not found") message(FATAL_ERROR "lib @PROJECT_NAME_UPPER@ not found")
endif(@PROJECT_NAME_UPPER@_LIBRARY_DIR) endif(@PROJECT_NAME_UPPER@_LIBRARY_DIR)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment