summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt25
1 files changed, 24 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6431b09..d9776cd 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.2)
project(honeysuckle
- VERSION 1.0.0
+ VERSION 0.1.0
DESCRIPTION "A C library to make writing lua bindings simple")
find_package(Lua51 REQUIRED)
@@ -25,6 +25,7 @@ set_target_properties(honeysuckle PROPERTIES
VERSION ${PROJECT_VERSION}
PUBLIC_HEADER src/honeysuckle.h)
+
# optionally build the tests
set(TEST_ROOT ${CMAKE_SOURCE_DIR}/src/tests)
set(TEST_SOURCES
@@ -47,6 +48,28 @@ set_target_properties(test PROPERTIES
CMAKE_C_FLAGS "-Wall -Wextra -Werror -Wfatal-errors -Wpedantic")
target_link_libraries(test ${LUA_LIBRARIES} honeysuckle)
+
+# optionally build the examples
+set(EX_ROOT ${CMAKE_SOURCE_DIR}/examples)
+
+add_executable(example_table_creation EXCLUDE_FROM_ALL
+ ${EX_ROOT}/table_creation/table_creation.c)
+set_target_properties(example_table_creation PROPERTIES
+ C_STANDARD 99
+ CMAKE_C_FLAGS "-Wall -Wextra -Werror -Wfatal-errors -Wpedantic")
+target_link_libraries(example_table_creation ${LUA_LIBRARIES} honeysuckle)
+
+add_executable(example_argument_parsing EXCLUDE_FROM_ALL
+ ${EX_ROOT}/argument_parsing/argument_parsing.c)
+set_target_properties(example_argument_parsing PROPERTIES
+ C_STANDARD 99
+ CMAKE_C_FLAGS "-Wall -Wextra -Werror -Wfatal-errors -Wpedantic")
+target_link_libraries(example_argument_parsing ${LUA_LIBRARIES} honeysuckle)
+
+add_custom_target(examples)
+add_dependencies(examples example_table_creation example_argument_parsing)
+
+
include(GNUInstallDirs)
install(TARGETS honeysuckle