Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dont build examples when BUILD_EXAMPLES off #294

Merged
merged 1 commit into from
Nov 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion libs/confman/testing/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
add_subdirectory(examples)
if(BUILD_EXAMPLES)
add_subdirectory(examples)
endif()
add_subdirectory(mocks)
add_subdirectory(stubs)
add_subdirectory(tests)
2 changes: 2 additions & 0 deletions libs/dbus_util/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,6 @@ target_link_libraries(dbus_util_test PRIVATE Boost::ut tfc::logger tfc::base tfc

add_test(NAME dbus_util_test COMMAND dbus_util_test)

if(BUILD_EXAMPLES)
add_subdirectory(examples)
endif()
4 changes: 3 additions & 1 deletion libs/ipc/testing/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
add_subdirectory(examples)
if(BUILD_EXAMPLES)
add_subdirectory(examples)
endif()
add_subdirectory(tests)
add_subdirectory(mocks)
4 changes: 3 additions & 1 deletion libs/logger/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,6 @@ add_test(
logging_test
)

add_subdirectory(examples)
if(BUILD_EXAMPLES)
add_subdirectory(examples)
endif()
4 changes: 3 additions & 1 deletion libs/motor/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,6 @@ add_test(
COMMAND
motor_impl_test
)
add_subdirectory(example)
if(BUILD_EXAMPLES)
add_subdirectory(example)
endif()
4 changes: 3 additions & 1 deletion libs/mqtt-sparkplug/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,6 @@ target_link_libraries(sparkplug_proto
target_include_directories(sparkplug_proto PUBLIC ${CMAKE_CURRENT_BINARY_DIR})
protobuf_generate(TARGET sparkplug_proto LANGUAGE cpp)

add_subdirectory(example)
if(BUILD_EXAMPLES)
add_subdirectory(examples)
endif()
4 changes: 3 additions & 1 deletion libs/operation_mode/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
add_subdirectory(example)
if(BUILD_EXAMPLES)
add_subdirectory(example)
endif()
15 changes: 3 additions & 12 deletions libs/progbase/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,6 @@ target_link_libraries(progbase_options_test Boost::ut Boost::program_options tfc

add_test(NAME progbase_options_test COMMAND progbase_options_test)

# Add examples to tests so that they definitely compile
add_executable(progbase_example_base examples/example_base.cpp)
target_link_libraries(progbase_example_base tfc::base Boost::program_options)
add_test(
NAME
progbase_example_base
COMMAND
progbase_example_base
)

# Tell doxygen where to find this example
add_example_to_docs(progbase_example_base)
if(BUILD_EXAMPLES)
add_subdirectory(examples)
endif()
12 changes: 12 additions & 0 deletions libs/progbase/tests/examples/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Add examples to tests so that they definitely compile
add_executable(progbase_example_base example_base.cpp)
target_link_libraries(progbase_example_base tfc::base Boost::program_options)
add_test(
NAME
progbase_example_base
COMMAND
progbase_example_base
jbbjarnason marked this conversation as resolved.
Show resolved Hide resolved
)

# Tell doxygen where to find this example
add_example_to_docs(progbase_example_base)