summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt26
1 files changed, 26 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644
index 0000000..4dcfccd
--- /dev/null
+++ b/CMakeLists.txt
@@ -0,0 +1,26 @@
+cmake_minimum_required(VERSION 3.2)
+project(honeysuckle
+ VERSION 1.0.0
+ DESCRIPTION "A C library to make writing lua bindings simple")
+
+set(CMAKE_C_FLAGS "-Wall -Wextra -Werror -Wfatal-errors -Wpedantic")
+
+find_package(Lua51 REQUIRED)
+include_directories(${LUA_INCLUDE_DIR})
+
+# build and link the library
+add_library(honeysuckle src/honeysuckle.c)
+target_link_libraries(honeysuckle ${LUA_LIBRARIES})
+set_target_properties(honeysuckle PROPERTIES
+ VERSION ${PROJECT_VERSION}
+ PUBLIC_HEADER src/honeysuckle.h)
+
+# optionally build the tests
+add_executable(test EXCLUDE_FROM_ALL src/test.c)
+target_link_libraries(test ${LUA_LIBRARIES} honeysuckle)
+
+include(GNUInstallDirs)
+
+install(TARGETS honeysuckle
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})