From ca9fd7a96bf83e8c166f389e67ddd826e792aaea Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Mon, 22 Sep 2025 12:29:29 -0400 Subject: [PATCH] xo-flatstring: build: install examples if XO_ENABLE_EXAMPLES --- CMakeLists.txt | 6 ++++++ example/ex1/CMakeLists.txt | 15 ++++++--------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 357c511..cd561e8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -38,6 +38,12 @@ xo_install_library4(${SELF_LIB} ${PROJECT_NAME}Targets) # provide find_package() support for projects using this library xo_export_cmake_config(${PROJECT_NAME} ${PROJECT_VERSION} ${PROJECT_NAME}Targets) +# ---------------------------------------------------------------- + +if (XO_ENABLE_EXAMPLES) + install(TARGETS flatstring_ex1) +endif() + # ---------------------------------------------------------------- # docs targets depend on all the other library/utest targets # diff --git a/example/ex1/CMakeLists.txt b/example/ex1/CMakeLists.txt index c026a15..a16109d 100644 --- a/example/ex1/CMakeLists.txt +++ b/example/ex1/CMakeLists.txt @@ -1,15 +1,12 @@ # xo-flatstring/example/ex1/CMakeLists.txt -set(SELF_EXE xo_flatstring_ex1) +set(SELF_EXE flatstring_ex1) set(SELF_SRCS ex1.cpp) -add_executable(${SELF_EXE} ${SELF_SRCS}) -xo_include_options2(${SELF_EXE}) - -# ---------------------------------------------------------------- -# dependencies.. - -xo_self_headeronly_dependency(${SELF_EXE} xo_flatstring) -#xo_dependency(${SELF_EXE} reflect) +if (XO_ENABLE_EXAMPLES) + add_executable(${SELF_EXE} ${SELF_SRCS}) + xo_include_options2(${SELF_EXE}) + xo_self_headeronly_dependency(${SELF_EXE} xo_flatstring) +endif() # end CMakeLists.txt