File: FindHoedown.cmake

package info (click to toggle)
librepcb 1.2.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 58,484 kB
  • sloc: cpp: 267,986; python: 12,100; ansic: 6,899; xml: 234; sh: 215; makefile: 115; perl: 73
file content (31 lines) | stat: -rw-r--r-- 872 bytes parent folder | download | duplicates (2)
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
set(HOEDOWN_SUBMODULE_BASEPATH "${PROJECT_SOURCE_DIR}/libs/hoedown")
if(EXISTS "${HOEDOWN_SUBMODULE_BASEPATH}"
   AND NOT UNBUNDLE_HOEDOWN
   AND NOT UNBUNDLE_ALL
)
  message(STATUS "Using vendored Hoedown")

  # Add library
  add_subdirectory(
    "${HOEDOWN_SUBMODULE_BASEPATH}" "${CMAKE_BINARY_DIR}/libs/hoedown"
    EXCLUDE_FROM_ALL
  )

  # Stop here, we're done
  return()
endif()

# Otherwise, try to find shared library on the system via pkg-config
find_package(PkgConfig QUIET)
if(PKGCONFIG_FOUND)
  pkg_check_modules(Hoedown GLOBAL IMPORTED_TARGET hoedown)
endif()
if(Hoedown_FOUND)
  message(STATUS "Using system Hoedown (via pkg-config)")
  add_library(Hoedown::Hoedown ALIAS PkgConfig::Hoedown)
  return()
endif()

message(FATAL_ERROR "Did not find Hoedown system library via pkg-config")

# Here we could search for the library manually, using find_path etc