-
Notifications
You must be signed in to change notification settings - Fork 26
/
CMakeLists.txt
42 lines (34 loc) · 1.19 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
project(lv_lib_png
HOMEPAGE_URL https://github.com/lvgl/lv_lib_png
)
# Option to build as shared library (as opposed to static), default: OFF
option(BUILD_SHARED_LIBS "Build shared as library (as opposed to static)" OFF)
file(GLOB_RECURSE SOURCES *.c)
if (BUILD_SHARED_LIBS)
add_library(${CMAKE_PROJECT_NAME} SHARED ${SOURCES})
else()
add_library(${CMAKE_PROJECT_NAME} STATIC ${SOURCES})
endif()
if("${LIB_INSTALL_DIR}" STREQUAL "")
set(LIB_INSTALL_DIR "lib")
endif()
if("${INC_INSTALL_DIR}" STREQUAL "")
set(INC_INSTALL_DIR "include/lvgl/${CMAKE_PROJECT_NAME}")
endif()
file(GLOB LV_DRIVERS_PUBLIC_HEADERS
"${CMAKE_SOURCE_DIR}/lv_png.h"
"${CMAKE_SOURCE_DIR}/lodepng.h"
)
set_target_properties(${CMAKE_PROJECT_NAME} PROPERTIES
OUTPUT_NAME ${CMAKE_PROJECT_NAME}
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
PUBLIC_HEADER "${LV_DRIVERS_PUBLIC_HEADERS}"
)
install(TARGETS ${CMAKE_PROJECT_NAME}
ARCHIVE DESTINATION "${LIB_INSTALL_DIR}"
LIBRARY DESTINATION "${LIB_INSTALL_DIR}"
RUNTIME DESTINATION "${LIB_INSTALL_DIR}"
PUBLIC_HEADER DESTINATION "${INC_INSTALL_DIR}"
)