summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorpommicket <pommicket@gmail.com>2025-09-16 17:08:19 -0400
committerpommicket <pommicket@gmail.com>2025-09-16 17:08:19 -0400
commit62bb1ffdee060819657161e260e75e3e1df017ac (patch)
treed47eba6dda1528850c869e067944cdfa009198f9 /CMakeLists.txt
parent7ededc16f36099acbfac457f8e4e268879b0ce62 (diff)
C++ library fixes
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt13
1 files changed, 12 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ff27660..4a44c39 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,6 +1,8 @@
cmake_minimum_required(VERSION 3.0...3.31)
project(pom)
+option(LIBPOM_CXX "Build C++ library" ON)
+
if (MSVC)
add_compile_options(/W4)
else()
@@ -33,7 +35,7 @@ target_link_libraries(example_all_functions pom)
install(TARGETS pom pom-shared DESTINATION lib)
install(FILES pom.h DESTINATION include)
-if (BUILD_CXX)
+if (LIBPOM_CXX)
# C++ library
add_library(pom++ STATIC cpp/pom.cpp)
@@ -49,4 +51,13 @@ if (BUILD_CXX)
target_include_directories(example++_read_conf PRIVATE cpp)
target_link_libraries(example++_read_conf pom++)
+ # C++ Examples
+ add_executable(example++_all_functions cpp/examples/all_functions.cpp)
+ target_include_directories(example++_all_functions PRIVATE cpp)
+ target_link_libraries(example++_all_functions pom++)
+
+ # Installation
+ install(TARGETS pom++ pom++-shared DESTINATION lib)
+ install(FILES cpp/pom.hpp DESTINATION include)
+
endif()