Radek Krejci | cb293a3 | 2020-11-13 15:36:29 +0100 | [diff] [blame] | 1 | # yanglint |
Radek Krejci | cb293a3 | 2020-11-13 15:36:29 +0100 | [diff] [blame] | 2 | set(lintsrc |
Radek Krejci | cb293a3 | 2020-11-13 15:36:29 +0100 | [diff] [blame] | 3 | main_ni.c |
Radek Krejci | e9f13b1 | 2020-11-09 17:42:04 +0100 | [diff] [blame] | 4 | cmd.c |
| 5 | cmd_add.c |
| 6 | cmd_clear.c |
| 7 | cmd_data.c |
| 8 | cmd_list.c |
Michal Vasko | 538be42 | 2021-10-19 14:06:59 +0200 | [diff] [blame] | 9 | cmd_feature.c |
Radek Krejci | e9f13b1 | 2020-11-09 17:42:04 +0100 | [diff] [blame] | 10 | cmd_load.c |
| 11 | cmd_print.c |
| 12 | cmd_searchpath.c |
aPiecek | 647f62e | 2023-05-18 10:55:58 +0200 | [diff] [blame] | 13 | cmd_extdata.c |
aPiecek | a83b8e0 | 2023-06-07 15:25:16 +0200 | [diff] [blame] | 14 | cmd_help.c |
| 15 | cmd_verb.c |
| 16 | cmd_debug.c |
| 17 | yl_opt.c |
aPiecek | d8f002f | 2023-06-21 10:40:41 +0200 | [diff] [blame] | 18 | yl_schema_features.c |
Radek Krejci | e9f13b1 | 2020-11-09 17:42:04 +0100 | [diff] [blame] | 19 | common.c |
Jan Kundrát | 2e3f935 | 2021-12-11 02:16:27 +0100 | [diff] [blame] | 20 | ) |
Michal Vasko | 4363428 | 2024-04-02 13:51:45 +0200 | [diff] [blame] | 21 | |
| 22 | if(ENABLE_YANGLINT_INTERACTIVE) |
Jan Kundrát | 2e3f935 | 2021-12-11 02:16:27 +0100 | [diff] [blame] | 23 | set(lintsrc ${lintsrc} |
| 24 | main.c |
| 25 | completion.c |
| 26 | configuration.c |
| 27 | linenoise/linenoise.c) |
| 28 | else() |
| 29 | set(lintsrc ${lintsrc} |
| 30 | main_ni_only.c) |
| 31 | endif() |
Radek Krejci | cb293a3 | 2020-11-13 15:36:29 +0100 | [diff] [blame] | 32 | |
| 33 | set(format_sources |
| 34 | ${format_sources} |
| 35 | ${CMAKE_CURRENT_SOURCE_DIR}/*.c |
| 36 | ${CMAKE_CURRENT_SOURCE_DIR}/*.h |
| 37 | PARENT_SCOPE) |
Michal Vasko | b3b3afc | 2020-11-25 09:52:26 +0100 | [diff] [blame] | 38 | |
Michal Vasko | 1b0b9a1 | 2021-05-06 08:38:34 +0200 | [diff] [blame] | 39 | add_executable(yanglint ${lintsrc} ${compatsrc}) |
Radek Krejci | cb293a3 | 2020-11-13 15:36:29 +0100 | [diff] [blame] | 40 | target_link_libraries(yanglint yang) |
| 41 | install(TARGETS yanglint DESTINATION ${CMAKE_INSTALL_BINDIR}) |
| 42 | install(FILES ${PROJECT_SOURCE_DIR}/tools/lint/yanglint.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1) |
| 43 | target_include_directories(yanglint BEFORE PRIVATE ${PROJECT_BINARY_DIR}) |
| 44 | |
Jan Kundrát | f0bd0b6 | 2021-12-11 02:23:51 +0100 | [diff] [blame] | 45 | if(WIN32) |
Jan Kundrát | f0bd0b6 | 2021-12-11 02:23:51 +0100 | [diff] [blame] | 46 | target_include_directories(yanglint PRIVATE ${GETOPT_INCLUDE_DIR}) |
| 47 | target_link_libraries(yanglint ${GETOPT_LIBRARY}) |
| 48 | endif() |