From 752945f8156ceddfa06aad26ebaa05054968431e Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Mon, 22 Sep 2025 12:30:00 -0400 Subject: [PATCH] xo-randomgen: build: install examples with XO_ENABLE_EXAMPLES --- xo-randomgen/CMakeLists.txt | 4 +++- xo-randomgen/example/ex1/CMakeLists.txt | 6 ++++-- xo-randomgen/example/ex2/CMakeLists.txt | 8 +++++--- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/xo-randomgen/CMakeLists.txt b/xo-randomgen/CMakeLists.txt index 49871c13..4e50d0f2 100644 --- a/xo-randomgen/CMakeLists.txt +++ b/xo-randomgen/CMakeLists.txt @@ -40,4 +40,6 @@ xo_export_cmake_config(${PROJECT_NAME} ${PROJECT_VERSION} ${PROJECT_NAME}Targets # ---------------------------------------------------------------- # install additional components -install(TARGETS randomgen_ex1 DESTINATION bin/randomgen/example) +if (XO_ENABLE_EXAMPLES) + install(TARGETS randomgen_ex1 DESTINATION bin/randomgen/example) +endif() diff --git a/xo-randomgen/example/ex1/CMakeLists.txt b/xo-randomgen/example/ex1/CMakeLists.txt index 0c809818..036b097a 100644 --- a/xo-randomgen/example/ex1/CMakeLists.txt +++ b/xo-randomgen/example/ex1/CMakeLists.txt @@ -1,2 +1,4 @@ -add_executable(randomgen_ex1 ex1.cpp) -xo_include_options2(randomgen_ex1) +if (XO_ENABLE_EXAMPLES) + add_executable(randomgen_ex1 ex1.cpp) + xo_include_options2(randomgen_ex1) +endif() diff --git a/xo-randomgen/example/ex2/CMakeLists.txt b/xo-randomgen/example/ex2/CMakeLists.txt index 877fae36..3f614530 100644 --- a/xo-randomgen/example/ex2/CMakeLists.txt +++ b/xo-randomgen/example/ex2/CMakeLists.txt @@ -1,3 +1,5 @@ -add_executable(randomgen_ex2 ex2.cpp) -xo_include_options2(randomgen_ex2) -xo_dependency(randomgen_ex2 indentlog) +if (XO_ENABLE_EXAMPLES) + add_executable(randomgen_ex2 ex2.cpp) + xo_include_options2(randomgen_ex2) + xo_dependency(randomgen_ex2 indentlog) +endif()