Skip to content

Commit 3077fd4

Browse files
authored
Merge pull request #1746 from kbenzie/benie/cmake-examples-opt
[CMake] Add option to disable building examples
2 parents b13c5e1 + 1d2c60f commit 3077fd4

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

CMakeLists.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ set(CMAKE_CXX_STANDARD 17)
2525
set(CMAKE_CXX_STANDARD_REQUIRED YES)
2626

2727
# Build Options
28+
option(UR_BUILD_EXAMPLES "Build example applications." ON)
2829
option(UR_BUILD_TESTS "Build unit tests." ON)
2930
option(UR_BUILD_TOOLS "build ur tools" ON)
3031
option(UR_FORMAT_CPP_STYLE "format code style of C++ sources" OFF)
@@ -258,7 +259,9 @@ install(
258259
EXPORT ${PROJECT_NAME}-targets)
259260

260261
add_subdirectory(source)
261-
add_subdirectory(examples)
262+
if(UR_BUILD_EXAMPLES)
263+
add_subdirectory(examples)
264+
endif()
262265
if(UR_BUILD_TESTS)
263266
add_subdirectory(test)
264267
endif()

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ List of options provided by CMake:
118118

119119
| Name | Description | Values | Default |
120120
| - | - | - | - |
121+
| UR_BUILD_EXAMPLES | Build example applications | ON/OFF | ON |
121122
| UR_BUILD_TESTS | Build the tests | ON/OFF | ON |
122123
| UR_BUILD_TOOLS | Build tools | ON/OFF | ON |
123124
| UR_FORMAT_CPP_STYLE | Format code style | ON/OFF | OFF |

0 commit comments

Comments
 (0)