-
Notifications
You must be signed in to change notification settings - Fork 56
/
Copy pathCMakeLists.txt
29 lines (21 loc) · 991 Bytes
/
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
cmake_minimum_required(VERSION 3.10...3.27)
include(GNUInstallDirs)
#set project name
project(dtmerge)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Werror")
if (CMAKE_COMPILER_IS_GNUCC)
add_definitions (-ffunction-sections)
endif ()
add_library (dtovl STATIC dtoverlay.c)
target_link_libraries(dtovl fdt)
add_executable(dtmerge dtmerge.c)
target_link_libraries(dtmerge dtovl)
install(TARGETS dtmerge RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
install(FILES dtmerge.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
add_executable(dtoverlay dtoverlay_main.c utils.c)
target_link_libraries(dtoverlay dtovl)
install(TARGETS dtoverlay RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
install(FILES dtoverlay.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
add_custom_command(TARGET dtoverlay POST_BUILD COMMAND ln;-sf;dtoverlay;dtparam)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/dtparam DESTINATION ${CMAKE_INSTALL_BINDIR})
install(FILES dtparam.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)