# Its GPL/LGPL, so they do not have to agree to a license for mere usage, but some installers require this...
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/COPYING")
set(CPACK_RESOURCE_FILE_README "${CMAKE_SOURCE_DIR}/admin/InstallInfo.txt")
-set(CPACK_SOURCE_IGNORE_FILES "\\\\.isreposource$;\\\\.git/;\\\\.gitignore$")
+set(CPACK_SOURCE_IGNORE_FILES "\\\\.isreposource$;\\\\.git/;\\\\.gitignore$;\\\\.gitattributes;")
set(CPACK_PROJECT_CONFIG_FILE "${CMAKE_SOURCE_DIR}/CPackInit.cmake")
-set(CPACK_SOURCE_INSTALLED_DIRECTORIES "${CMAKE_SOURCE_DIR};/;${CMAKE_BINARY_DIR}/src/programs/completion;src/programs/completion;${CMAKE_BINARY_DIR}/share/man/man1;share/man/man1;${CMAKE_BINARY_DIR}/share/man/man7;share/man/man7;${CMAKE_BINARY_DIR}/share/html/final;share/html/final")
+# CPack source archives include only the directories we list here.
+# This variable is a list of pairs of names of source and destination
+# directories. Most of these are used for content GROMACS generates as
+# part of the configuration or build.
+set(CPACK_SOURCE_INSTALLED_DIRECTORIES "${CMAKE_SOURCE_DIR};/;${CMAKE_BINARY_DIR}/src/programs/completion;src/programs/completion;${CMAKE_BINARY_DIR}/share/man/man1;share/man/man1;${CMAKE_BINARY_DIR}/share/man/man7;share/man/man7;${CMAKE_BINARY_DIR}/share/html/final;share/html/final;${CMAKE_BINARY_DIR}/install-guide/final;/")
set(CPACK_PACKAGE_CONTACT "gmx-users@gromacs.org")
#must come after all cpack settings!
if(CPACK_SOURCE_PACKAGE_FILE_NAME) #building source package
get_filename_component(CMAKE_BINARY_DIR ${CPACK_OUTPUT_CONFIG_FILE} PATH)
if (NOT EXISTS "${CMAKE_BINARY_DIR}/share/man/man1/gmx-view.1" OR
- NOT EXISTS "${CMAKE_BINARY_DIR}/INSTALL" OR
- NOT EXISTS "${CMAKE_BINARY_DIR}/share/html/final/online.html")
+ NOT EXISTS "${CMAKE_BINARY_DIR}/install-guide/final/INSTALL" OR
+ NOT EXISTS "${CMAKE_BINARY_DIR}/share/html/final/online.html" OR
+ NOT EXISTS "${CMAKE_BINARY_DIR}/src/programs/completion/gmx-completion.bash" OR
+ NOT EXISTS "${CMAKE_BINARY_DIR}/share/html/final/programs/gmx-view.html")
message(FATAL_ERROR
- "To create a complete source package all man and HTML pages need "
- "to be generated, and the INSTALL file generated. "
- "Run 'make man html' to build these parts. You can also set "
- "GMX_BUILD_HELP=ON to automatically build the HTML parts. "
- "The latter also requires you to execute 'make install-guide'.")
+ "To create a complete source package, bash completions, "
+ "man and HTML pages, and INSTALL need to be generated. "
+ "Run 'make completion man html install-guide' to build "
+ "these parts. You can also configure with "
+ "GMX_BUILD_HELP=ON to automatically build the HTML parts.")
endif()
endif()
VERBATIM
)
- # Make the INSTALL file for CPack for the tarball
+ # Make the INSTALL file for CPack for the tarball. This gets put
+ # into the tarball via the CPack rules in the top-level
+ # CMakeLists.txt
add_custom_command(
- OUTPUT ${CMAKE_BINARY_DIR}/INSTALL
- COMMAND pandoc -t plain -o ../INSTALL install-guide.md
+ OUTPUT final/INSTALL
+ COMMAND ${CMAKE_COMMAND} -E make_directory final
+ COMMAND pandoc -t plain -o final/INSTALL install-guide.md
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/install-guide.md
VERBATIM
)
add_custom_target(install-guide
DEPENDS
${CMAKE_CURRENT_BINARY_DIR}/install-guide.html
- ${CMAKE_BINARY_DIR}/INSTALL
+ final/INSTALL
VERBATIM
)
endif()