summaryrefslogtreecommitdiffstats
path: root/dev/MinGfx/cmake/Modules/FindNanoGUI.cmake
blob: 1c27135db5fab15dc54bf25ca2002cd2668447a7 (plain) (blame)
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
find_path(NANOGUI_INCLUDE_DIR 
    nanogui/nanogui.h
  HINTS 
    ${CMAKE_INSTALL_PREFIX}/include 
    ${CMAKE_INSTALL_PREFIX}/include/nanogui
    $ENV{NANOGUI_ROOT}/include 
    $ENV{NANOGUI_ROOT}/include/nanogui 
    /usr/local/include
    /usr/local/include/nanogui
)


find_library(NANOGUI_OPT_LIBRARIES 
  NAMES 
    nanogui
  HINTS 
    ${CMAKE_INSTALL_PREFIX}/lib 
    $ENV{NANOGUI_ROOT}/lib 
    /usr/local/lib
)

          
find_library(NANOGUI_DEBUG_LIBRARIES 
  NAMES 
    nanoguid
  HINTS 
    ${CMAKE_INSTALL_PREFIX}/lib 
    $ENV{NANOGUI_ROOT}/lib 
    /usr/local/lib
)

set(NANOGUI_INCLUDE_DIRS
    ${NANOGUI_INCLUDE_DIR}
    ${NANOGUI_INCLUDE_DIR}/nanovg
)

unset(NANOGUI_LIBRARIES)
if (NANOGUI_OPT_LIBRARIES)
  list(APPEND NANOGUI_LIBRARIES optimized ${NANOGUI_OPT_LIBRARIES})
endif()

if (NANOGUI_DEBUG_LIBRARIES)
  list(APPEND NANOGUI_LIBRARIES debug ${NANOGUI_DEBUG_LIBRARIES})
endif()

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(
    NanoGUI
    DEFAULT_MSG
    NANOGUI_INCLUDE_DIRS
    NANOGUI_LIBRARIES
)

mark_as_advanced(
    NANOGUI_INCLUDE_DIR 
    NANOGUI_INCLUDE_DIRS 
    NANOGUI_OPT_LIBRARIES 
    NANOGUI_DEBUG_LIBRARIES 
    NANOGUI_LIBRARIES
)