Commit aea4486c authored by Vadim Pisarevsky's avatar Vadim Pisarevsky

made "make package_source" work on Mac too.

parent bd2185db
...@@ -1499,9 +1499,15 @@ set(BUILD_PACKAGE ON CACHE BOOL "Enables 'make package_source' command") ...@@ -1499,9 +1499,15 @@ set(BUILD_PACKAGE ON CACHE BOOL "Enables 'make package_source' command")
if(BUILD_PACKAGE) if(BUILD_PACKAGE)
set(TARBALL_NAME "${CMAKE_PROJECT_NAME}-${OPENCV_VERSION_MAJOR}.${OPENCV_VERSION_MINOR}.${OPENCV_VERSION_PATCH}") set(TARBALL_NAME "${CMAKE_PROJECT_NAME}-${OPENCV_VERSION_MAJOR}.${OPENCV_VERSION_MINOR}.${OPENCV_VERSION_PATCH}")
if (NOT WIN32) if (NOT WIN32)
if(APPLE)
set(TAR_CMD gnutar)
else()
set(TAR_CMD tar)
endif()
set(TAR_TRANSFORM "\"s,^,${TARBALL_NAME}/,\"")
add_custom_target(package_source add_custom_target(package_source
#TODO: maybe we should not remove dll's #TODO: maybe we should not remove dll's
COMMAND tar --transform 's,^,${TARBALL_NAME}/,S' -cjpf ${CMAKE_CURRENT_BINARY_DIR}/${TARBALL_NAME}.tar.bz2 --exclude-vcs --exclude="*.pyc" --exclude="*.vcproj" --exclude="*/lib/*" --exclude="*.dll" ./ COMMAND ${TAR_CMD} --transform ${TAR_TRANSFORM} -cjpf ${CMAKE_CURRENT_BINARY_DIR}/${TARBALL_NAME}.tar.bz2 --exclude=".svn" --exclude="*.pyc" --exclude="*.vcproj" --exclude="*/lib/*" --exclude="*.dll" ./
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
else() else()
add_custom_target(package_source add_custom_target(package_source
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment