Skip to content

Commit 2ec4427

Browse files
committed
Add optional builds of tests and docs
Similar to the present BUILD_EXAMPLES this commit introduces options for test and doc builds Signed-off-by: Justin Lecher <[email protected]>
1 parent bc99fa6 commit 2ec4427

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

CMakeLists.txt

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ option(BUILD_PYTHON_BINDINGS "Build Python bindings" ON)
5454
option(BUILD_MATLAB_BINDINGS "Build Matlab bindings" ON)
5555
option(BUILD_CUDA_LIB "Build CUDA library" OFF)
5656
option(BUILD_EXAMPLES "Build examples" ON)
57+
option(BUILD_TESTS "Build tests" ON)
58+
option(BUILD_DOC "Build documentation" ON)
5759
option(USE_OPENMP "Use OpenMP multi-threading" ON)
5860
option(USE_MPI "Use MPI" OFF)
5961

@@ -158,8 +160,12 @@ add_subdirectory( src )
158160
if (BUILD_EXAMPLES)
159161
add_subdirectory( examples )
160162
endif(BUILD_EXAMPLES)
161-
add_subdirectory( test )
162-
add_subdirectory( doc )
163+
if (BUILD_TESTS)
164+
add_subdirectory( test )
165+
endif (BUILD_TESTS)
166+
if (BUILD_DOC)
167+
add_subdirectory( doc )
168+
endif (BUILD_DOC)
163169

164170

165171
# CPACK options
@@ -202,6 +208,9 @@ include(CPack)
202208
message(STATUS "Install prefix: ${CMAKE_INSTALL_PREFIX}")
203209
message(STATUS "Build type: ${CMAKE_BUILD_TYPE}")
204210
message(STATUS "Building C bindings: ${BUILD_C_BINDINGS}")
211+
message(STATUS "Building examples: ${BUILD_EXAMPLES}")
212+
message(STATUS "Building tests: ${BUILD_TESTS}")
213+
message(STATUS "Building documentation: ${BUILD_DOC}")
205214
message(STATUS "Building python bindings: ${BUILD_PYTHON_BINDINGS}")
206215
message(STATUS "Building matlab bindings: ${BUILD_MATLAB_BINDINGS}")
207216
message(STATUS "Building CUDA library: ${BUILD_CUDA_LIB}")

0 commit comments

Comments
 (0)