Skip to content

Commit 8ee9461

Browse files
committed
Remove warning when disabling dist target
1 parent 771ef17 commit 8ee9461

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

CMakeLists.txt

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -72,17 +72,19 @@ endif()
7272
# We therefore wrap package_source in our own dist target.
7373

7474
if("${MOZART_BUILD_DIR}/" MATCHES "${MOZART_DIR}/.*")
75-
message(WARNING "You are compiling inside the source tree. Generating source tarballs will not work correctly.")
75+
message(STATUS "Building inside the source tree: 'dist' target disabled")
76+
else()
77+
message(STATUS "Building outside the source tree: 'dist' target enabled")
78+
add_custom_target(dist COMMAND ${CMAKE_MAKE_PROGRAM} package_source)
79+
configure_file(cmake_local/MozartConfigVersion.cmake.in
80+
${CMAKE_CURRENT_BINARY_DIR}/cmake_local/MozartConfigVersion.cmake @ONLY)
81+
define_property(GLOBAL PROPERTY SRCS_INSTALLED_DIRS
82+
BRIEF_DOCS "List of source files"
83+
FULL_DOCS "List of source/dest pairs of path to be included in the source archive")
84+
set_property(GLOBAL APPEND PROPERTY SRCS_INSTALLED_DIRS
85+
"${CMAKE_CURRENT_SOURCE_DIR}" "/"
86+
"${CMAKE_CURRENT_BINARY_DIR}/cmake_local/" "/cmake_local/")
7687
endif()
77-
add_custom_target(dist COMMAND ${CMAKE_MAKE_PROGRAM} package_source)
78-
configure_file(cmake_local/MozartConfigVersion.cmake.in
79-
${CMAKE_CURRENT_BINARY_DIR}/cmake_local/MozartConfigVersion.cmake @ONLY)
80-
define_property(GLOBAL PROPERTY SRCS_INSTALLED_DIRS
81-
BRIEF_DOCS "List of source files"
82-
FULL_DOCS "List of source/dest pairs of path to be included in the source archive")
83-
set_property(GLOBAL APPEND PROPERTY SRCS_INSTALLED_DIRS
84-
"${CMAKE_CURRENT_SOURCE_DIR}" "/"
85-
"${CMAKE_CURRENT_BINARY_DIR}/cmake_local/" "/cmake_local/")
8688

8789
# The subdirectories which contain the real thing
8890

0 commit comments

Comments
 (0)