File: FindTypeSafe.cmake

package info (click to toggle)
librepcb 1.2.0%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 58,488 kB
  • sloc: cpp: 267,986; python: 12,100; ansic: 6,899; xml: 234; sh: 215; makefile: 115; perl: 73
file content (21 lines) | stat: -rw-r--r-- 551 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
set(TYPE_SAFE_SUBMODULE_BASEPATH "${PROJECT_SOURCE_DIR}/libs/type_safe")
if(EXISTS "${TYPE_SAFE_SUBMODULE_BASEPATH}")
  message(STATUS "Using vendored TypeSafe")

  # Include local submodule
  add_subdirectory(
    "${TYPE_SAFE_SUBMODULE_BASEPATH}" "${CMAKE_BINARY_DIR}/libs/type_safe"
    EXCLUDE_FROM_ALL
  )

  # Alias static lib to namespaced variant
  add_library(TypeSafe::TypeSafe ALIAS type_safe)

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

message(
  FATAL_ERROR
    "Did not find TypeSafe library submodule, did you clone recursively?"
)