This repository contains a collection of CMake files that will be used to build sac2c packages. We are going to use this repository as a sub-module in the packages so that maintenance of the common part of the build system gets easier.
Individual files have the following functionality:
-
check-sac2c.cmakechecks whether we have an operational sac2c compiler. TheSAC2C_EXECvariable overrides search forsac2con the PATH. This produces theSAC2C_VERSIONvariable. -
sac2c-variables.cmakedefines a number of useful sac2c variables that are mainly coming from parsing sac2crc for a given TARGET. Also it performs some sanity checks like: chosen target is set in sac2crc, sac2c executable is set, etc. -
generate-version-vars.cmakedefined a function where generates the MAJOR, MINOR, and PATCH numbers using thegit-describetool. -
resolve-sac2c-dependencies.cmakedefines a function that for a given file runssac2c -M, checks whether external dependencies to the Tree and Mod shared libraries can be found; and generates a list of local dependencies that can be used while defining a custom target in CMake. -
generate-sac2c-dependency-targets.cmakeprovides a very similar function as is inresolve-sac2c-dependencies.cmake, with the main distinction being that instead of outputting module library file paths, it returns target names. -
generate-sac2crc-file.cmakeis a script which is used to generate a sac2crc file for a package, calledsac2crc.package.<package>. It places it into the user's home directory under.sac2crcdirectory. It is intended that the script is used as a target within the package build. -
check-sac2c-feature-support.cmakecontains a collection of macros/functions which check for supported features insac2c. The results are intended to be exposed via the generatedconfig.hfile. -
build-sac2c-module.cmakeprovides macros to create targets to build SaC modules (with dependency resolution provided byresolve-sac2c-dependencies.cmake) -
build-sac2c-progam.cmakeprovides macros to create targets to build SaC programs (with dependency resolution provided byresolve-sac2c-dependencies.cmake) -
sac2c-prog-with-versions.cmakeprovides macros to create targets to build SaC programs that make use of an external version config. Precise details of what this is is explained within the cmake file. -
misc-macros.cmakecontains a miscellaneous collection of functions and macros. Further details on what these functions do is given as comments within.