diff options
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 13 |
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() |