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