From 62bb1ffdee060819657161e260e75e3e1df017ac Mon Sep 17 00:00:00 2001 From: pommicket Date: Tue, 16 Sep 2025 17:08:19 -0400 Subject: C++ library fixes --- CMakeLists.txt | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'CMakeLists.txt') 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() -- cgit v1.2.3