aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorsrdusr <trevorgray@srdusr.com>2025-09-26 12:40:58 +0200
committersrdusr <trevorgray@srdusr.com>2025-09-26 12:40:58 +0200
commita996f78277d5ba5adccb0daa535bc2494350975c (patch)
tree08d594ba144f41fb14ebd2354beb2a8cda9be101 /CMakeLists.txt
parent91499edd42cc50ee0543e11e08a6b653f3475262 (diff)
downloadcerberus-a996f78277d5ba5adccb0daa535bc2494350975c.tar.gz
cerberus-a996f78277d5ba5adccb0daa535bc2494350975c.zip
Initial Commit
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt55
1 files changed, 55 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644
index 0000000..27dc406
--- /dev/null
+++ b/CMakeLists.txt
@@ -0,0 +1,55 @@
+cmake_minimum_required(VERSION 3.10)
+project(cerberus VERSION 0.1.0 LANGUAGES C)
+
+# Set C standard
+set(CMAKE_C_STANDARD 11)
+set(CMAKE_C_STANDARD_REQUIRED ON)
+
+# Set output directories
+set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
+set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
+set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
+
+# Find required packages
+find_package(OpenSSL REQUIRED)
+find_package(Threads REQUIRED)
+
+# Add include directories
+include_directories(
+ ${CMAKE_CURRENT_SOURCE_DIR}/core
+ ${OPENSSL_INCLUDE_DIR}
+)
+
+# Add library
+add_library(cerberus SHARED core/cerberus.c)
+
+# Link libraries
+target_link_libraries(cerberus
+ PRIVATE
+ OpenSSL::Crypto
+ Threads::Threads
+)
+
+# Set output name and properties
+set_target_properties(cerberus PROPERTIES
+ OUTPUT_NAME "cerberus"
+ PREFIX ""
+ SUFFIX ".so"
+)
+
+# Install rules
+install(TARGETS cerberus
+ LIBRARY DESTINATION lib
+ ARCHIVE DESTINATION lib
+ RUNTIME DESTINATION bin
+)
+
+# Install header files
+install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/core/cerberus.h DESTINATION include/cerberus/core)
+
+# Optional tests (disabled by default)
+option(BUILD_TESTS "Build tests" OFF)
+if(BUILD_TESTS AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/tests/CMakeLists.txt")
+ enable_testing()
+ add_subdirectory(tests)
+endif()