CetMake

include(CetMake)

Legacy Cetbuildtools/UPS module, retained temporarily for provision of the cet_script function used under the hood by CetTest.

Use of scripts (e.g. Shell, Python, Perl) for testing of the package or by its clients should prefer explicit use under the following guidelines

  • If the script is not generated (e.g. via configure_file), then it should have at least user execute permissions. Tests may run the script by passing the full path, e.g. ${PROJECT_SOURCE_DIR}/scripts/myscript.sh. If the script is required by runtime clients, use the install(PROGRAMS ...) form of the CMake command to install it in the appropriate location with needed execute permissions.
  • If the script is generated, either via configure_file or otherwise, then the preceeding guide can be followed post-generation. In this case, the only change is to refer to the script in tests and install commands via its configured path, e.g. ${PROJECT_BINARY_DIR}/scripts/myscript.sh.
cet_script
cet_script(<script-names> ...
           [DEPENDENCIES <deps>]
           [GENERATED]
           [REMOVE_EXTENSIONS])

Copy the named scripts to CMAKE_RUNTIME_OUTPUT_DIRECTORY for the build.

If the GENERATED option is used, the script will be copied from CMAKE_CURRENT_BINARY_DIR (after being made by a configure_file command, for example); otherwise it will be copied from CMAKE_CURRENT_SOURCE_DIR.

If REMOVE_EXTENSIONS is specified, extensions will be removed from script names when they are installed.

NOTE: If you wish to use one of these scripts in a CUSTOM_COMMAND, list its name in the DEPENDS clause of the CUSTOM_COMMAND to ensure it gets re-run if the script chagees.