Skip to content

Commit

Permalink
Merge pull request #791 from remram44/build-in-source
Browse files Browse the repository at this point in the history
lgtm
  • Loading branch information
David Lonie committed Oct 13, 2014
2 parents 0e373e4 + edab5bb commit a0946be
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@ endif()
project(cdat)

# Disable in source build of any kind
STRING(REGEX MATCH "^${cdat_SOURCE_DIR}/" BUILDINSOURCE "${cdat_BINARY_DIR}/")
STRING(LENGTH "${cdat_SOURCE_DIR}/" source_len)
STRING(SUBSTRING "${cdat_BINARY_DIR}/" 0 "${source_len}" source_match)
STRING(COMPARE EQUAL "${cdat_SOURCE_DIR}/" "${source_match}" BUILDINSOURCE)
if (BUILDINSOURCE)
set(msg "[ERROR] CDAT requires an out of source Build.")
set(msg "${msg} Run 'git clean -dfx' to restore source dir.")
set(msg "${msg}\nRun 'git clean -dfx' to restore source dir.")
message(FATAL_ERROR "${msg}")
endif()

Expand Down

0 comments on commit a0946be

Please sign in to comment.