refabd.blogg.se

Cmake add executable
Cmake add executable









When using CMake 3.19 or later, finalization will occur at the end of the current directory scope. If using a CMake version earlier than 3.19, finalization will be performed immediately as part of the call. In the following simple case, finalization is handled automatically. In general, MANUAL_FINALIZATION should not be needed unless the project has to support CMake 3.18 or earlier.

Instead other targets created by addlibrary() or addexecutable() may reference the objects using an expression of the form as a source, where objlib is the object library name.

#CMAKE ADD EXECUTABLE ARCHIVE#

Regardless of the CMake version, the MANUAL_FINALIZATION keyword can be given to indicate that you will explicitly call qt_finalize_target() yourself instead at some later time. An object library compiles source files but does not archive or link their object files into a library. In that case, finalization is performed immediately before this command returns. When using CMake versions earlier than 3.19, automatic deferral isn't supported. This gives the caller an opportunity to modify properties of the created target before it is finalized. When using CMake 3.19 or later, finalization is automatically deferred to the end of the current directory scope. You might need to also call the qt_finalize_project() command at the end of top-level CMakeLists.txt to correctly resolve the dependencies between project targets.įinalization can occur either as part of this call or be deferred to sometime after this command returns (but it should still be in the same directory scope). The finalization processing is implemented by the qt_finalize_target() command. The steps to perform depend on the platform and on various properties of the target. FinalizationĪfter a target is created, further processing or finalization steps are commonly needed. Since all Qt applications need to link to the Qt::Core library, this is done for you as a convenience.

  • Various _VISIBILITY_PRESET target properties will be set to default to ensure that the main() function is visible in the resultant binary.
  • The SUFFIX target property will be set to give the library file name an architecture-specific suffix.
  • Some target properties will also be set for Android: On Android, a MODULE library will be created and any WIN32 or MACOSX_BUNDLE options will be ignored. All arguments will be passed through to the standard CMake add_executable() command, except MANUAL_FINALIZATION (if present).

    cmake add executable cmake add executable cmake add executable

    On all platforms except Android, an executable target will be created. These files contain logic to set build options, resolve external project dependencies, and add executable and library targets. Handle finalization of the CMake target.Link the target to the Qt::Core library.Create a CMake target of the appropriate type for the target platform.This command performs the following tasks: It supports the same set of arguments as this command. If versionless commands are disabled, use qt6_add_executable() instead.









    Cmake add executable