Build specific example using -DBUILD_EXAMPLE cmake flag (#3921)

This commit is contained in:
Benji 2024-04-17 13:26:18 -04:00 committed by GitHub
commit c1fd98591d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 22 additions and 4 deletions

View file

@ -59,7 +59,10 @@ if(NOT TARGET uninstall)
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)
endif()
if (${BUILD_EXAMPLES})
if (NOT ${BUILD_EXAMPLE} STREQUAL "")
MESSAGE(STATUS "Building example '${BUILD_EXAMPLE}'")
add_subdirectory(examples)
elseif (${BUILD_EXAMPLES})
MESSAGE(STATUS "Building examples is enabled")
add_subdirectory(examples)
endif()