summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt50
1 files changed, 50 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644
index 0000000..b135103
--- /dev/null
+++ b/CMakeLists.txt
@@ -0,0 +1,50 @@
+cmake_minimum_required(VERSION 3.19...3.27)
+
+if(${CMAKE_VERSION} VERSION_LESS 3.12)
+ cmake_policy(VERSION ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION})
+endif()
+
+project(libfud
+ VERSION 1.0.0
+ DESCRIPTION "The Standard Library Extended and Exception Free"
+ LANGUAGES CXX C)
+
+set(CXX_CPPCHECK "project=build/compile_commands.json;enable=information;force")
+
+set(CMAKE_EXPORT_COMPILE_COMMANDS true)
+
+add_library(libfud SHARED
+ source/libfud.cpp
+ source/c_file.cpp
+ source/string.cpp
+ source/utf8.cpp
+ source/utf8_iterator.cpp
+ )
+
+target_compile_options(libfud PRIVATE ${FUD_WARNINGS})
+
+target_include_directories(libfud PUBLIC include)
+
+set_target_properties(
+ libfud PROPERTIES
+ CXX_STANDARD 20
+ C_STANDARD 23
+ CXX_EXTENSIONS OFF
+ C_EXTENSIONS OFF
+ CXX_STANDARD_REQUIRED ON)
+
+if (FUD_TEST)
+add_subdirectory(test)
+add_subdirectory(examples)
+endif ()
+
+if (FUD_DOC)
+ find_package(Doxygen
+ REQUIRED dot
+ OPTIONAL_COMPONENTS mscgen dia)
+
+ doxygen_add_docs(docs
+ include
+ # CONFIG_FILE "Doxyfile"
+ )
+endif()