xo-flatstring: build: install examples if XO_ENABLE_EXAMPLES

This commit is contained in:
Roland Conybeare 2025-09-22 12:29:29 -04:00
commit ca9fd7a96b
2 changed files with 12 additions and 9 deletions

View file

@ -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
#

View file

@ -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