Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # SPDX-License-Identifier: Unlicense
- # include( CMakePrintHelpers REQUIRED )
- # *INDENT-OFF*
- # `abort_if_in_source` prints a fatal error message to stderr and exits the
- # make if attempting to build in the source directory.
- function( abort_if_in_source_build )
- # Require out-of-source builds
- file( TO_CMAKE_PATH "${PROJECT_BINARY_DIR}/CMakeLists.txt" LOC_PATH )
- if( EXISTS "${LOC_PATH}" )
- message( FATAL_ERROR
- "You cannot build in a source directory (or any directory with a CMakeLists.txt file). Please make a build subdirectory. Feel free to remove CMakeCache.txt and CMakeFiles." )
- endif()
- endfunction()
- # `print_all_variables` prints all the currently defined variables and their
- # values. The variables are printed in alphabetical order.
- function( print_all_variables )
- get_cmake_property( _vars VARIABLES )
- list( SORT _vars )
- foreach( _varName ${_vars} )
- message( STATUS "${_varName}=${${_varName}}" )
- endforeach()
- endfunction()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement