-
Notifications
You must be signed in to change notification settings - Fork 132
/
CMakeLists.txt
42 lines (35 loc) · 2.03 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
cmake_minimum_required (VERSION 3.16)
project(OpenOCD LANGUAGES C)
include(cmake/OpenOCDSetup.cmake)
include(cmake/BuildOptions.cmake)
include(cmake/configure.cmake)
add_executable(openocd)
include(cmake/jimtcl.cmake)
add_subdirectory(src)
# Propogate config.h which is auto-generated into the root directory.
target_include_directories(openocd PUBLIC ${CMAKE_CURRENT_LIST_DIR})
target_link_libraries(openocd PRIVATE openocd_main libjimtcl)
install(TARGETS openocd DESTINATION ${bindir})
install(DIRECTORY tcl/ DESTINATION ${pkgdatadir}/scripts)
install(FILES contrib/60-openocd.rules DESTINATION ${pkgdatadir}/contrib)
install(DIRECTORY contrib/libdcc DESTINATION ${pkgdatadir}/contrib)
install(FILES tools/esp_detect_config.py DESTINATION ${pkgdatadir}/espressif/tools)
install(FILES contrib/loaders/flash/espressif/esp32c6/inc/stub_flash_idf_binary_code.inc DESTINATION ${pkgdatadir}/espressif/stub_bins/esp32c6)
install(FILES contrib/loaders/flash/espressif/esp32c6/inc/stub_flash_idf_binary_data.inc DESTINATION ${pkgdatadir}/espressif/stub_bins/esp32c6)
install(FILES contrib/loaders/flash/espressif/esp32c6/stub_flash_idf_image.h DESTINATION ${pkgdatadir}/espressif/stub_bins/esp32c6)
install(FILES contrib/loaders/flash/espressif/esp32h2/inc/stub_flash_idf_binary_code.inc DESTINATION ${pkgdatadir}/espressif/stub_bins/esp32h2)
install(FILES contrib/loaders/flash/espressif/esp32h2/inc/stub_flash_idf_binary_data.inc DESTINATION ${pkgdatadir}/espressif/stub_bins/esp32h2)
install(FILES contrib/loaders/flash/espressif/esp32h2/stub_flash_idf_image.h DESTINATION ${pkgdatadir}/espressif/stub_bins/esp32h2)
get_property(ulink_firmware TARGET ocdjtagdrivers PROPERTY ULINK_FIRMWARE)
if(BUILD_JLINK)
install(FILES ${ulink_firmware} DESTINATION ${pkgdatadir}/OpenULINK)
endif()
#TODO can be added to the ADDITIONAL_CLEAN_FILES properties
if(BUILD_GCOV)
add_custom_target(gcov-clean
COMMAND ${CMAKE_MAKE_PROGRAM} clean
COMMAND find . -name "*.gcno" -type f -delete
COMMAND find . -name "*.gcda" -type f -delete
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
)
endif()