Skip to content

Commit 488e6a1

Browse files
author
Huang-Ming Huang
committed
2 parents 373a8f7 + c32fbe0 commit 488e6a1

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

CMakeLists.txt

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ set(INSTALL_LIB_DIR lib CACHE PATH "Installation directory for libraries")
3636
set(INSTALL_BIN_DIR bin CACHE PATH "Installation directory for executables")
3737
set(INSTALL_INCLUDE_DIR include CACHE PATH "Installation directory for header files")
3838
set(INSTALL_DATA_DIR share CACHE PATH "Installation directory for data files")
39+
# flag to enable/disable building examples and/or tests
40+
set(BUILD_EXAMPLES ON CACHE BOOL "build mFAST examples" )
41+
set(BUILD_TESTS ON CACHE BOOL "build mFAST unit tests" )
3942

4043
if (${CMAKE_SYSTEM_NAME} STREQUAL "Emscripten")
4144
if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
@@ -89,6 +92,12 @@ endif (NOT BUILD_FAST_TYPE_GEN)
8992
include_directories(${Boost_INCLUDE_DIR})
9093

9194

95+
################################################################################
96+
## Setting up tinyxml2 Library
97+
################################
98+
99+
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/tinyxml2)
100+
92101
################################################################################
93102

94103

@@ -185,9 +194,11 @@ endfunction (FASTTYPEGEN_TARGET)
185194
# Includes Catch in the project:
186195
#add_subdirectory(${EXT_PROJECTS_DIR}/catch)
187196
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/catch/include ${COMMON_INCLUDES})
188-
enable_testing()
189197

190-
add_subdirectory (tests)
198+
if (BUILD_TESTS)
199+
enable_testing()
200+
add_subdirectory (tests)
201+
endif (BUILD_TESTS)
191202

192203
if (BUILD_SHARED_LIBS)
193204
set(MFAST_LIBRARIES "${MFAST_SHARED_LIBRARIES}")
@@ -198,7 +209,9 @@ else (BUILD_SHARED_LIBS)
198209
set(MFAST_LIBRARIES "${MFAST_STATIC_LIBRARIES}")
199210
endif (BUILD_SHARED_LIBS)
200211

201-
add_subdirectory (examples)
212+
if (BUILD_EXAMPLES)
213+
add_subdirectory (examples)
214+
endif (BUILD_EXAMPLES)
202215

203216

204217
# Setting up dist target

0 commit comments

Comments
 (0)