Add distcheck target for GCC and MinGW
This commit is contained in:
parent
60472e057f
commit
33e946b57c
|
@ -477,4 +477,16 @@ endif(FREECAD_MAINTAINERS_BUILD AND NOT WIN32)
|
||||||
--srcdir=${CMAKE_SOURCE_DIR} --bindir=${CMAKE_BINARY_DIR} --dfsg
|
--srcdir=${CMAKE_SOURCE_DIR} --bindir=${CMAKE_BINARY_DIR} --dfsg
|
||||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||||
)
|
)
|
||||||
|
if(CMAKE_COMPILER_IS_GNUCXX OR MINGW)
|
||||||
|
add_custom_target(distcheck-git
|
||||||
|
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/src/Tools/makedist.py
|
||||||
|
--srcdir=${CMAKE_SOURCE_DIR} --bindir=${CMAKE_BINARY_DIR} --check
|
||||||
|
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||||
|
)
|
||||||
|
add_custom_target(distcheckdfsg-git
|
||||||
|
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/src/Tools/makedist.py
|
||||||
|
--srcdir=${CMAKE_SOURCE_DIR} --bindir=${CMAKE_BINARY_DIR} --dfsg --check
|
||||||
|
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||||
|
)
|
||||||
|
endif(CMAKE_COMPILER_IS_GNUCXX OR MINGW)
|
||||||
|
|
||||||
|
|
|
@ -5,15 +5,16 @@
|
||||||
# Python script to make source tarballs.
|
# Python script to make source tarballs.
|
||||||
#
|
#
|
||||||
|
|
||||||
import sys, os, getopt, tarfile, gzip, time, StringIO, platform
|
import sys, os, getopt, tarfile, gzip, time, StringIO, platform, shutil
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
srcdir="."
|
srcdir="."
|
||||||
bindir="."
|
bindir="."
|
||||||
dfsg=False
|
dfsg=False
|
||||||
|
check=False
|
||||||
wta=""
|
wta=""
|
||||||
try:
|
try:
|
||||||
opts, args = getopt.getopt(sys.argv[1:], "sb:", ["srcdir=","bindir=","dfsg"])
|
opts, args = getopt.getopt(sys.argv[1:], "sb:", ["srcdir=","bindir=","dfsg", "check"])
|
||||||
except getopt.GetoptError:
|
except getopt.GetoptError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
@ -25,6 +26,8 @@ def main():
|
||||||
if o in ("--dfsg"):
|
if o in ("--dfsg"):
|
||||||
dfsg = True
|
dfsg = True
|
||||||
wta = "--worktree-attributes"
|
wta = "--worktree-attributes"
|
||||||
|
if o in ("--check"):
|
||||||
|
check = True
|
||||||
|
|
||||||
if dfsg:
|
if dfsg:
|
||||||
gitattr = open("src/.gitattributes","w")
|
gitattr = open("src/.gitattributes","w")
|
||||||
|
@ -85,6 +88,17 @@ def main():
|
||||||
if dfsg:
|
if dfsg:
|
||||||
os.remove("src/.gitattributes")
|
os.remove("src/.gitattributes")
|
||||||
print "Created " + TGZNAME
|
print "Created " + TGZNAME
|
||||||
|
# Unpack and build
|
||||||
|
if check:
|
||||||
|
archive=tarfile.open(mode='r:gz',name=TGZNAME)
|
||||||
|
archive.extractall(bindir)
|
||||||
|
builddir = os.path.join(bindir, DIRNAME)
|
||||||
|
cwd = os.getcwd()
|
||||||
|
os.chdir(builddir)
|
||||||
|
os.system("cmake .")
|
||||||
|
os.system("make")
|
||||||
|
os.chdir(cwd)
|
||||||
|
shutil.rmtree(builddir)
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
main()
|
main()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user