I'm current making a installer for a large project, where it requires to get the most up-to-date tables from database. Till now the Database dump was done manually, now i want it to be done automatically when i generate the installer. Since there is already a script doing the dump process, i am wondering if it is possible to tell CPack (or CMake) to run this script first before generating the installer? For instance, there is a rule in the CMakeList:
install(
FILES "../db/structures.sql"
DESTINATION ${INSTALL_DB}
CONFIGURATIONS Release
RENAME "create.sql"
)
The Sql-Dump file "structures.sql" can automatically being created using another script called "make_db_dump.pl" (So in the command line it should be called using "perl make_db_dump.pl
"). And i want the make_db_dump.pl to be automatically called and file generated before generating the installer. Is that possible?
For the environment: im using VS 2019 together with CMake under windows.
And the workflow is:CMake -> VS Project -> generating installer
structures.sql
as part of your build process (usingadd_custom_target
/add_custom_command
). So the file will exist at the time the installer packs it. Note, that installation process is just "take this file and put it into the installation directory". Creation of the file intended to be installed is responsibility of the build process.