-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathCMakeLists.txt
44 lines (37 loc) · 1.07 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
38
39
40
41
42
43
44
cmake_minimum_required(VERSION 3.22.1)
project(fudge)
# libfudge
option(PTP_USE_LIBUSB "" OFF)
option(PTP_DEFAULT_LOGGING "" OFF)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../lib ${CMAKE_CURRENT_BINARY_DIR}/lib)
# libjpeg-turbo
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../third_party/android-libjpeg-turbo ${CMAKE_CURRENT_BINARY_DIR}/libjpeg)
add_library(fudge SHARED
main.c
backend.c
scripts.c
camlib.c
usb.c
liveview.c
android.c
)
# Define BUILD_TYPE_RELEASE for release builds
if(${CMAKE_BUILD_TYPE} STREQUAL "Release" OR ${CMAKE_BUILD_TYPE} STREQUAL "RelWithDebInfo")
target_compile_definitions(fudge PUBLIC BUILD_TYPE_RELEASE=1)
endif()
target_compile_options(fudge
PRIVATE -Wall -Wshadow -Wcast-qual -Wpedantic -Werror=incompatible-pointer-types -Werror=deprecated-declarations
)
find_library(log-lib log)
find_library(android-lib android)
find_library(egl-lib EGL)
find_library(glesv2-lib GLESv2)
find_library(glesv1-lib GLESv1_CM)
target_link_libraries(fudge PRIVATE libfudge
libjpeg-turbo
${log-lib}
${android-lib}
${egl-lib}
${glesv2-lib}
${glesv1-lib}
)