Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
BornAgain
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mlz
BornAgain
Commits
f5f3f775
Commit
f5f3f775
authored
10 years ago
by
Wuttke, Joachim
Browse files
Options
Downloads
Patches
Plain Diff
Module cmake/modules/PreventInSourceBuilds.cmake copied from Frida.
This resolves
#827
.
parent
591d5d1e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
CMakeLists.txt
+2
-1
2 additions, 1 deletion
CMakeLists.txt
cmake/modules/PreventInSourceBuilds.cmake
+26
-0
26 additions, 0 deletions
cmake/modules/PreventInSourceBuilds.cmake
with
28 additions
and
1 deletion
CMakeLists.txt
+
2
−
1
View file @
f5f3f775
...
...
@@ -25,8 +25,9 @@ option(BORNAGAIN_CRASHHADLER "Additional machinery to send crash reports" OFF)
#--- Including macros ---
set
(
CMAKE_MODULE_PATH
${
CMAKE_SOURCE_DIR
}
/cmake/modules
)
include
(
PreventInSourceBuilds
)
include
(
BornAgainMacros
)
#AssureOutOfSourceBuilds()
include
(
SearchInstalledSoftware
)
include
(
CheckCompiler
)
include
(
BornAgainConfiguration
)
...
...
This diff is collapsed.
Click to expand it.
cmake/modules/PreventInSourceBuilds.cmake
0 → 100644
+
26
−
0
View file @
f5f3f775
# This function will prevent in-source builds
function
(
AssureOutOfSourceBuilds
)
# make sure the user doesn't play dirty with symlinks
get_filename_component
(
srcdir
"
${
CMAKE_SOURCE_DIR
}
"
REALPATH
)
get_filename_component
(
bindir
"
${
CMAKE_BINARY_DIR
}
"
REALPATH
)
# disallow in-source builds
if
(
"
${
srcdir
}
"
STREQUAL
"
${
bindir
}
"
)
message
(
"###########################################################################"
)
message
(
"We do not allow cmake to be run in the source directory."
)
message
(
"You must run cmake in a build directory."
)
message
(
"For example:"
)
message
(
" cd <source directory>"
)
message
(
" mkdir build"
)
message
(
" cd build"
)
message
(
" cmake .. # or ccmake, or cmake-gui"
)
message
(
""
)
message
(
"To clean up after this aborted in-place compilation:"
)
message
(
" rm -r CMakeCache.txt CMakeFiles/"
)
message
(
"###########################################################################"
)
message
(
FATAL_ERROR
"Quitting configuration"
)
endif
()
endfunction
()
AssureOutOfSourceBuilds
()
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment