Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fatal error if we detect an in-source build #1214

Merged
merged 2 commits into from
Sep 28, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,17 @@
# Set the minimum version of CMake that's required
cmake_minimum_required(VERSION 3.12)

# make sure the source and binary directories are different
# this is here to prevent so-called "in-source" builds where the root directory of the source
# is also the root directory of the build
get_filename_component(srcdir "${CMAKE_SOURCE_DIR}" REALPATH)
get_filename_component(bindir "${CMAKE_BINARY_DIR}" REALPATH)
if ("${srcdir}" STREQUAL "${bindir}")
message(FATAL_ERROR "ldmx-sw does not support in-source builds.
Call 'ldmx cmake ..' from within a 'build/' subdirectory or
Tell cmake to use a different build directory with 'ldmx cmake -B build -S .'")
endif()

# Set the project name
project(LDMX_SW VERSION 3.1.1
DESCRIPTION "The Light Dark Matter eXperiment simulation and reconstruction framework."
Expand Down