From efcea3a80da7c4479d5fe168435ecc9fd06bdc72 Mon Sep 17 00:00:00 2001 From: John Turner Date: Sun, 14 Sep 2025 00:16:10 -0400 Subject: Squashed 'subprojects/boost-sqlite/' content from commit 3378e35 git-subtree-dir: subprojects/boost-sqlite git-subtree-split: 3378e353705271e569cf4ba15c467b840a39798c --- example/CMakeLists.txt | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 example/CMakeLists.txt (limited to 'example/CMakeLists.txt') diff --git a/example/CMakeLists.txt b/example/CMakeLists.txt new file mode 100644 index 0000000..480ed7e --- /dev/null +++ b/example/CMakeLists.txt @@ -0,0 +1,20 @@ + +file(GLOB_RECURSE ALL_EXAMPLES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +file(GLOB_RECURSE ALL_EXAMPLES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) + +foreach(SRC ${ALL_EXAMPLES}) + get_filename_component(NAME ${SRC} NAME_WLE ) + + if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${NAME}.sql) + add_library(boost_sqlite_example_${NAME} SHARED ${SRC}) + target_link_libraries(boost_sqlite_example_${NAME} PUBLIC Boost::sqlite_ext Boost::url) + target_compile_definitions(boost_sqlite_example_${NAME} PUBLIC BOOST_SQLITE_SEPARATE_COMPILATION=1) + set_property(TARGET boost_sqlite_example_${NAME} PROPERTY PREFIX "") + set_target_properties(boost_sqlite_example_${NAME} PROPERTIES OUTPUT_NAME ${NAME} POSITION_INDEPENDENT_CODE ON) + else() + add_executable(boost_sqlite_example_${NAME} ${SRC} ) + target_link_libraries(boost_sqlite_example_${NAME} PUBLIC Boost::sqlite) + target_compile_definitions(boost_sqlite_example_${NAME} PUBLIC BOOST_SQLITE_SEPARATE_COMPILATION=1) + endif() +endforeach() + -- cgit v1.2.3