Skip to content

Commit e929aa1

Browse files
committed
cmake: finish advanced feature and package reporting
isn't this awesome? :-)
1 parent 1baaaeb commit e929aa1

File tree

1 file changed

+30
-1
lines changed

1 file changed

+30
-1
lines changed

CMakeLists.txt

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,17 @@ list(APPEND CMAKE_MODULE_PATH ${pfasst_SOURCE_DIR}/cmake)
55
include(cmake/utility_functions.cmake)
66
include(CheckCXXCompilerFlag)
77
include(ExternalProject)
8+
include(CMakeDependentOption)
9+
include(FeatureSummary)
810

911
# Set default ExternalProject root directory
1012
set_directory_properties(PROPERTIES EP_PREFIX ${CMAKE_BINARY_DIR}/3rdparty)
1113

1214
option(pfasst_DISABLE_LIBCXX "Disable use of LLVM's libc++ when compiling with Clang." ON )
1315
option(pfasst_BUILD_SHARED_LIBS "Build shared libraries." OFF)
1416
option(pfasst_BUILD_EXAMPLES "Build example programs." ON )
15-
option(pfasst_INSTALL_EXAMPLES "Install example programs." OFF)
17+
CMAKE_DEPENDENT_OPTION(pfasst_INSTALL_EXAMPLES "Install example programs." ON
18+
"pfasst_BUILD_EXAMPLES" OFF)
1619
option(pfasst_BUILD_TESTS "Build test suite for PFASST." ON )
1720
option(pfasst_WITH_MPI "Build with MPI enabled." OFF)
1821
option(pfasst_WITH_GCC_PROF "Enable excessive debugging & profiling output with GCC." OFF)
@@ -78,6 +81,27 @@ endif()
7881
# Enable all compiler warnings
7982
add_to_string_list("${CMAKE_CXX_FLAGS}" CMAKE_CXX_FLAGS "-Wall -Wextra -Wpedantic")
8083

84+
85+
# Set features from options
86+
add_feature_info(Examples
87+
pfasst_BUILD_EXAMPLES
88+
"build example programs"
89+
)
90+
add_feature_info(Tests
91+
pfasst_BUILD_TESTS
92+
"build test suite"
93+
)
94+
add_feature_info(MPI
95+
pfasst_WITH_MPI
96+
"build with MPI"
97+
)
98+
if(${CMAKE_CXX_COMPILER_ID} MATCHES GNU)
99+
add_feature_info(Profiling
100+
pfasst_WITH_GCC_PROF
101+
"build-in profiling support"
102+
)
103+
endif()
104+
81105
set(3rdparty_INCLUDES)
82106
set(3rdparty_DEPENDEND_LIBS)
83107
set(pfasst_INCLUDES)
@@ -152,3 +176,8 @@ if(${CMAKE_VERBOSE_MAKEFILE})
152176
message(STATUS "C++ link flags: ${CMAKE_CXX_LINK_FLAGS}")
153177
message(STATUS "********************************************************************************")
154178
endif()
179+
180+
feature_summary(WHAT ENABLED_FEATURES DESCRIPTION "Enabled Features:")
181+
feature_summary(WHAT DISABLED_FEATURES DESCRIPTION "Disabled Features:")
182+
feature_summary(WHAT PACKAGES_FOUND DESCRIPTION "Packages Found (or auto-added):")
183+
feature_summary(WHAT PACKAGES_NOT_FOUND DESCRIPTION "Packages Not Found:")

0 commit comments

Comments
 (0)