Skip to content

Commit 31e18bf

Browse files
committed
Add warning for builds within source tree
1 parent 62fbe1f commit 31e18bf

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,9 @@ endif()
7171
# CMake does not allow to add dependencies to "builtin" targets like package_source.
7272
# We therefore wrap package_source in our own dist target.
7373

74+
if("${MOZART_BUILD_DIR}/" MATCHES "${MOZART_DIR}/.*")
75+
message(WARNING "You are compiling inside the source tree. Generating source tarballs will not work correctly.")
76+
endif()
7477
add_custom_target(dist COMMAND ${CMAKE_MAKE_PROGRAM} package_source)
7578
configure_file(cmake_local/MozartConfigVersion.cmake.in
7679
${CMAKE_CURRENT_BINARY_DIR}/cmake_local/MozartConfigVersion.cmake @ONLY)

0 commit comments

Comments
 (0)