Skip to content

Commit

Permalink
Build examples as an option (#30)
Browse files Browse the repository at this point in the history
* build: add option for enabling examples to be built

* chore: formatting

* docs: add generation for building examples

* chore: formatting

* on push

* build: add option for enabling examples to be built

* chore: formatting

* docs: add generation for building examples

* chore: formatting

Co-authored-by: darife <darife@jlg.com>
Co-authored-by: Erik Erlandson <eerlands@redhat.com>
  • Loading branch information
3 people committed Mar 13, 2022
1 parent 566128d commit 5b00cc4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 4 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
cmake_minimum_required(VERSION 3.0)
project(st_tree VERSION 1.0.6)

option(BUILD_EXAMPLES "Build the examples." OFF)
option(ENABLE_TESTS "Enable the tests. Requires boost." ON)

include(GNUInstallDirs)
Expand All @@ -15,7 +16,9 @@ ENDIF()
add_subdirectory(include)

# tutorial examples
add_subdirectory(examples)
if(BUILD_EXAMPLES)
add_subdirectory(examples)
endif()

# testing programs
if(ENABLE_TESTS)
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ Quick start:
$ cd /path/to/st_tree
$ cmake .

# generate makefiles to build examples from cmake
$ cd /path/to/st_tree
$ cmake . -DBUILD_EXAMPLES=ON

# make examples and tests:
$ make

Expand Down

0 comments on commit 5b00cc4

Please sign in to comment.