diff options
author | pommicket <pommicket@gmail.com> | 2025-09-16 14:17:38 -0400 |
---|---|---|
committer | pommicket <pommicket@gmail.com> | 2025-09-16 14:17:38 -0400 |
commit | 76f68d6c93b55f9cd96a369bf2e5785ed16fa184 (patch) | |
tree | ddd657b9036fe80696e9c2e2f596ca91ce863680 /CMakeLists.txt | |
parent | 9f817b370e55c24db5dee3f6948d2d95df7c3207 (diff) |
More work on C++ library
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 5a24f75..ff27660 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -28,6 +28,25 @@ add_executable(example_all_functions examples/all_functions.c) target_include_directories(example_all_functions PRIVATE .) target_link_libraries(example_all_functions pom) + # Installation install(TARGETS pom pom-shared DESTINATION lib) install(FILES pom.h DESTINATION include) + +if (BUILD_CXX) + + # C++ library + add_library(pom++ STATIC cpp/pom.cpp) + add_library(pom++-shared SHARED cpp/pom.cpp) + set_target_properties(pom++-shared PROPERTIES OUTPUT_NAME pom++) + target_include_directories(pom++ PRIVATE .) + target_include_directories(pom++-shared PRIVATE .) + target_link_libraries(pom++ PRIVATE pom) + target_link_libraries(pom++-shared PRIVATE pom-shared) + + # C++ Examples + add_executable(example++_read_conf cpp/examples/read_conf.cpp) + target_include_directories(example++_read_conf PRIVATE cpp) + target_link_libraries(example++_read_conf pom++) + +endif() |