aboutsummaryrefslogtreecommitdiffstats
path: root/nihil.cli/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'nihil.cli/CMakeLists.txt')
-rw-r--r--nihil.cli/CMakeLists.txt40
1 files changed, 40 insertions, 0 deletions
diff --git a/nihil.cli/CMakeLists.txt b/nihil.cli/CMakeLists.txt
new file mode 100644
index 0000000..b05ed3a
--- /dev/null
+++ b/nihil.cli/CMakeLists.txt
@@ -0,0 +1,40 @@
+# This source code is released into the public domain.
+
+add_library(nihil.cli STATIC)
+target_link_libraries(nihil.cli PRIVATE nihil.util)
+target_sources(nihil.cli
+ PUBLIC FILE_SET modules TYPE CXX_MODULES FILES
+ nihil.cli.ccm
+
+ command.ccm
+ command_tree.ccm
+ command_node.ccm
+ dispatch_command.ccm
+ registry.ccm
+ usage_error.ccm
+
+ PRIVATE
+ command.cc
+ command_tree.cc
+ command_node.cc
+ dispatch_command.cc
+ registry.cc
+)
+
+if(NIHIL_TESTS)
+ enable_testing()
+
+ add_executable(nihil.cli.test
+ test.cc
+ )
+ target_link_libraries(nihil.cli.test PRIVATE
+ nihil.cli
+ Catch2::Catch2WithMain
+ )
+
+ find_package(Catch2 REQUIRED)
+
+ include(CTest)
+ include(Catch)
+ catch_discover_tests(nihil.cli.test)
+endif()