CMakeFindPackageTemplate.ftl 1.79 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# Automatically generated file
#
# - Try to find ${viewModel.packageName}
# Once done this will define
#  ${viewModel.packageName}_FOUND - System has ${viewModel.packageName}
#  ${viewModel.packageName}_INCLUDE_DIRS - The ${viewModel.packageName} include directories
#  ${viewModel.packageName}_LIBRARY_DIRS - The library directories needed to use ${viewModel.packageName}
#  ${viewModel.packageName}_LIBRARIES    - The libraries needed to use ${viewModel.packageName}

<#if viewModel.findPath>
find_path(${viewModel.packageName}_INCLUDE_DIR
        NAMES ${viewModel.includeName}
        PATH_SUFFIXES "include"
        PATHS
        <#list viewModel.includePaths as var>
16
        "${var}"
17
        </#list>
18
        HINTS $ENV{${viewModel.packageName}_HOME}
19
20
21
22
23
        )
</#if>
<#if viewModel.findLibrary>
find_library(${viewModel.packageName}_LIBRARY
        NAMES ${viewModel.libName}
24
        PATH_SUFFIXES "lib" "lib64" "lib/x86_64-linux-gnu" "examples/lib_win64" "build" "Release"
25
26
        PATHS
        <#list viewModel.libPaths as var>
27
        "${var}"
28
        </#list>
29
        HINTS $ENV{${viewModel.packageName}_HOME}
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
        )
</#if>

include(FindPackageHandleStandardArgs)
# if all listed variables are TRUE
find_package_handle_standard_args(
  ${viewModel.packageName}
  DEFAULT_MSG
  <#if viewModel.findPath>${viewModel.packageName}_INCLUDE_DIR</#if>
  <#if viewModel.findLibrary>${viewModel.packageName}_LIBRARY</#if>
  )

mark_as_advanced(
  <#if viewModel.findPath>${viewModel.packageName}_INCLUDE_DIR</#if>
  <#if viewModel.findLibrary>${viewModel.packageName}_LIBRARY</#if>
  )

<#if viewModel.findPath>set(${viewModel.packageName}_INCLUDE_DIRS ${r"${"}${viewModel.packageName}${r"_INCLUDE_DIR}"})</#if>
<#if viewModel.findLibrary>set(${viewModel.packageName}_LIBRARIES ${r"${"}${viewModel.packageName}${r"_LIBRARY}"})</#if>