diff --git a/CMakeLists.txt b/CMakeLists.txt index 91a901730..f79000616 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -177,6 +177,8 @@ # to find the SystemC libraries under # lib-. (default: OFF) # +# ENABLE_EXAMPLES Build examples and tests. (default: OFF) +# # Other configuration variables will be proposed by CMake depending on the OS # and detected processor, compiler, and libraries. For more information, please # refer to the CMake documentation or . @@ -325,6 +327,8 @@ option (ENABLE_LEGACY_MEM_MGMT "Use of std::malloc or posix_memalign instead of mmap to allocate coroutine stack. Breaks ASAN." OFF) +option (ENABLE_EXAMPLES "Build examples and tests." OFF) + if (NOT INSTALL_TO_LIB_BUILD_TYPE_DIR) option (INSTALL_TO_LIB_TARGET_ARCH_DIR "Install the libraries to lib- to facilitate linking applications, which build systems assume to find SystemC in lib-. (default: OFF)" OFF) else (NOT INSTALL_TO_LIB_BUILD_TYPE_DIR) @@ -682,6 +686,7 @@ message (STATUS "SystemCTLM_VERSION = ${SystemCTLM_VERSION}") message (STATUS "INSTALL_TO_LIB_BUILD_TYPE_DIR = ${INSTALL_TO_LIB_BUILD_TYPE_DIR}") message (STATUS "INSTALL_TO_LIB_TARGET_ARCH_DIR = ${INSTALL_TO_LIB_TARGET_ARCH_DIR}") message (STATUS "INSTALL_LIB_TARGET_ARCH_SYMLINK = ${INSTALL_LIB_TARGET_ARCH_SYMLINK}") +message (STATUS "ENABLE_EXAMPLES = ${ENABLE_EXAMPLES}") message (STATUS "------------------------------------------------------------------------") message (STATUS "CMAKE_CXX_STANDARD = ${CMAKE_CXX_STANDARD}") message (STATUS "CMAKE_CXX_STANDARD_REQUIRED = ${CMAKE_CXX_STANDARD_REQUIRED}") @@ -724,7 +729,9 @@ message (STATUS "=============================================================== ############################################################################### add_subdirectory (src) -add_subdirectory (examples) +if (${ENABLE_EXAMPLES}) + add_subdirectory (examples) +endif() ###############################################################################