

- #CMAKE SET VARIABLE SUPERSET LIST OF FILES HOW TO#
- #CMAKE SET VARIABLE SUPERSET LIST OF FILES UPDATE#
Finally, update tutorial.cxx to print out its version number. Next, create an input header file TutorialConfig.h.in defining version numbers which will accept variables passed from configurefile(). However, in some cases, it is desirable to export targets directlyįrom a build tree. In that same file, use configurefile() to copy a given input file to an output file and substitute some variable values in the input file content. Typically, projects are built and installed before being used by an outside Packages canĬhoose to employ such a pattern if different major versions of the packageĪre designed to be incompatible. directory contains source that needs to be built into a > shared > library or an executable binary. There is an attempt to use version 3 together with version 4. MathFunctions, cmake will issue a diagnostic if By setting thisĬustom defined user property in this version and in the next version of

In our example, MathFunctions_MAJOR_VERSION is defined as aĬOMPATIBLE_INTERFACE_STRING which means that it must beĬompatible among the dependencies of any depender. Help/guide/importing-exporting/MyExe, create a build directory, runįind_library( math_REL NAMES m ) find_library( math_DBG NAMES md ) add_library( math STATIC IMPORTED GLOBAL ) set_target_properties( math PROPERTIES IMPORTED_LOCATION "$" COMPATIBILITY AnyNewerVersion ) Theĭetails of this project are not important. That when run creates a basic file in the current directory. We'll need to do some setup to get started. IMPORTED executable target and then references it from the To start, we will walk through a simple example that creates an IMPORTED_LOCATION contains the full path to the target on Properties whose names begin in IMPORTED_ and INTERFACE_. Visibility so that the target is accessible globally in the build system.ĭetails about the IMPORTED target are specified by setting The project and provide a convenient, flexible reference to outsideīy default, the IMPORTED target name has scope in the directory in IMPORTED targets may be referenced like any other target within No buildįiles are generated for IMPORTED targets.
Targets are created using the IMPORTED option of theĪdd_executable() and add_library() commands. CMAKERUNTIMEOUTPUTDIRECTORYProject into logical targets inside of the project. IMPORTED targets are used to convert files outside of a CMake This guide and the completeĮxample source code can be found in the Help/guide/importing-exportingĭirectory of the CMake source code tree.
#CMAKE SET VARIABLE SUPERSET LIST OF FILES HOW TO#
Will demonstrate how to package a project with a configuration file to allowįor easy integration into other CMake projects. We will then show how CMake supports exporting targetsįrom one CMake-based project and importing them into another.

In this guide, we will present the concept of IMPORTED targetsĪnd demonstrate how to import existing executable or library files from disk
