summaryrefslogtreecommitdiffstats
path: root/tools/lint/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'tools/lint/CMakeLists.txt')
-rw-r--r--tools/lint/CMakeLists.txt48
1 files changed, 48 insertions, 0 deletions
diff --git a/tools/lint/CMakeLists.txt b/tools/lint/CMakeLists.txt
new file mode 100644
index 0000000..059305e
--- /dev/null
+++ b/tools/lint/CMakeLists.txt
@@ -0,0 +1,48 @@
+# yanglint
+set(lintsrc
+ main_ni.c
+ cmd.c
+ cmd_add.c
+ cmd_clear.c
+ cmd_data.c
+ cmd_list.c
+ cmd_feature.c
+ cmd_load.c
+ cmd_print.c
+ cmd_searchpath.c
+ cmd_extdata.c
+ cmd_help.c
+ cmd_verb.c
+ cmd_debug.c
+ yl_opt.c
+ yl_schema_features.c
+ common.c
+)
+
+if(ENABLE_YANGLINT_INTERACTIVE)
+ set(lintsrc ${lintsrc}
+ main.c
+ completion.c
+ configuration.c
+ linenoise/linenoise.c)
+else()
+ set(lintsrc ${lintsrc}
+ main_ni_only.c)
+endif()
+
+set(format_sources
+ ${format_sources}
+ ${CMAKE_CURRENT_SOURCE_DIR}/*.c
+ ${CMAKE_CURRENT_SOURCE_DIR}/*.h
+ PARENT_SCOPE)
+
+add_executable(yanglint ${lintsrc} ${compatsrc})
+target_link_libraries(yanglint yang)
+install(TARGETS yanglint DESTINATION ${CMAKE_INSTALL_BINDIR})
+install(FILES ${PROJECT_SOURCE_DIR}/tools/lint/yanglint.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
+target_include_directories(yanglint BEFORE PRIVATE ${PROJECT_BINARY_DIR})
+
+if(WIN32)
+ target_include_directories(yanglint PRIVATE ${GETOPT_INCLUDE_DIR})
+ target_link_libraries(yanglint ${GETOPT_LIBRARY})
+endif()