-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathCMakeLists.txt
37 lines (30 loc) · 1.32 KB
/
CMakeLists.txt
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
cmake_minimum_required(VERSION 3.5)
project(libcamera)
# set default build type
# https://blog.kitware.com/cmake-and-the-default-build-type/
if((NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) OR (CMAKE_BUILD_TYPE STREQUAL "None"))
set(default_build_type "Release")
message(STATUS "Setting build type to '${default_build_type}' as none was specified.")
set(CMAKE_BUILD_TYPE "${default_build_type}" CACHE
STRING "Choose the type of build." FORCE)
# Set the possible values of build type for cmake-gui
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release")
endif()
string(TOLOWER ${CMAKE_BUILD_TYPE} MESON_BUILD_TYPE)
if(NOT NJOBS)
set(NJOBS 0)
endif()
find_package(OpenSSL REQUIRED)
include(ExternalProject)
ExternalProject_Add(libcamera_source
GIT_REPOSITORY https://git.libcamera.org/libcamera/libcamera.git
GIT_TAG v0.0.4
GIT_SHALLOW ON
CONFIGURE_COMMAND meson setup build ../libcamera_source --prefix ${CMAKE_INSTALL_PREFIX} --libdir lib --buildtype ${MESON_BUILD_TYPE} --auto-features=disabled
-Dpipelines=all
-Dcam=enabled
BUILD_COMMAND meson compile -C build --jobs ${NJOBS}
INSTALL_COMMAND meson install -C build
)
add_library(libcamera SHARED IMPORTED)
add_dependencies(libcamera libcamera_source)