1
0
Fork 0

Read CPACK ignore files from .gitignore

This commit is contained in:
Erik Hofman 2011-11-20 10:28:20 +01:00
parent 2e2accfe06
commit 5381aafe6d

View file

@ -20,6 +20,7 @@ string(STRIP ${versionFile} FLIGHTGEAR_VERSION)
#packaging
# split version string into components, note CMAKE_MATCH_0 is the entire regexp match
file(READ .gitignore CPACK_SOURCE_IGNORE_FILES)
string(REGEX MATCH "([0-9]+)\\.([0-9]+)\\.([0-9]+)" CPACK_PACKAGE_VERSION ${FLIGHTGEAR_VERSION} )
set(CPACK_PACKAGE_VERSION_MAJOR ${CMAKE_MATCH_1})
set(CPACK_PACKAGE_VERSION_MINOR ${CMAKE_MATCH_2})
@ -29,8 +30,8 @@ SET(CPACK_RESOURCE_FILE_README "${PROJECT_SOURCE_DIR}/README")
set(CPACK_SOURCE_GENERATOR TBZ2 ZIP)
set(CPACK_SOURCE_PACKAGE_FILE_NAME "flightgear-${FLIGHTGEAR_VERSION}" CACHE INTERNAL "tarball basename")
set(CPACK_SOURCE_IGNORE_FILES
"^${PROJECT_SOURCE_DIR}/.git;\\\\.gitignore;Makefile.am;~$;${CPACK_SOURCE_IGNORE_FILES}")
#set(CPACK_SOURCE_IGNORE_FILES
# "^${PROJECT_SOURCE_DIR}/.git;\\\\.gitignore;Makefile.am;~$;${CPACK_SOURCE_IGNORE_FILES}")
include (CPack)