Skip to content

Commit

Permalink
distcheck: Use cmake --build instead of make
Browse files Browse the repository at this point in the history
  • Loading branch information
jorisv committed Oct 30, 2024
1 parent 46ef3c6 commit a846a4a
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions distcheck.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ macro(DISTCHECK_SETUP)
"${CMAKE_BINARY_DIR}"
)

set(BUILD_CMD ${CMAKE_COMMAND} --build ${PROJECT_BINARY_DIR} --target)
if(NOT TARGET distcheck)
add_custom_target(distcheck COMMENT "Checking generated tarball...")
endif()
Expand Down Expand Up @@ -124,22 +125,22 @@ macro(DISTCHECK_SETUP)
cmake .. ||
(echo "ERROR: the cmake configuration failed." && false)
&&
make ${DISTCHECK_MAKEFLAGS} ||
${BUILD_CMD} ${DISTCHECK_MAKEFLAGS} all ||
(echo "ERROR: the compilation failed." && false)
&&
make test ||
${BUILD_CMD} test ||
(echo "ERROR: the test suite failed." && false)
&&
make install ||
${BUILD_CMD} install ||
(echo "ERROR: the install target failed." && false)
&&
make uninstall ||
${BUILD_CMD} uninstall ||
(echo "ERROR: the uninstall target failed." && false)
&&
test `find ${INSTDIR} -type f | wc -l` -eq 0 ||
(echo "ERROR: the uninstall target does not work." && false)
&&
make clean || (echo "ERROR: the clean target failed." && false)
${BUILD_CMD} clean || (echo "ERROR: the clean target failed." && false)
&&
cd ${CMAKE_BINARY_DIR}/${PROJECT_NAME}${PROJECT_SUFFIX}-${PROJECT_VERSION} &&
chmod u+w . _build _inst &&
Expand Down

0 comments on commit a846a4a

Please sign in to comment.