Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Trigger CMake reconfigure if iaito.pro changes and disallow in-source…
… builds. (#184) * Trigger CMake reconfigure if iaito.pro changes * Disallow in-source builds with CMake * CMake: move disallowing in source build to separate script
- Loading branch information
1 parent
6dd0bd1
commit 6c8adef
Showing
2 changed files
with
20 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
function(DisallowInSource) | ||
get_filename_component(SRC_DIR_REALPATH "${CMAKE_SOURCE_DIR}" REALPATH) | ||
get_filename_component(BINARY_DIR_REALPATH "${CMAKE_BINARY_DIR}" REALPATH) | ||
if(SRC_DIR_REALPATH STREQUAL BINARY_DIR_REALPATH) | ||
message(FATAL_ERROR " In-source builds are not allowed. | ||
Please create a directory and run cmake from there: | ||
mkdir build && cd build && cmake .. | ||
This process created the file CMakeCache.txt and the directory CMakeFiles in ${CMAKE_SOURCE_DIR}. | ||
Please delete them manually!") | ||
endif() | ||
endfunction() | ||
|
||
DisallowInSource() |