FindOpenSP¶
在 3.25 版被加入.
Finds the OpenSP library:
find_package(OpenSP [<version>] [...])
OpenSP is an open-source implementation of the SGML (Standard Generalized Markup Language) parser.
Imported Targets¶
This module provides the following Imported Targets:
OpenSP::OpenSPTarget encapsulating the OpenSP library usage requirements, available only if the OpenSP is found.
結果變數¶
該模組定義了以下變數:
OpenSP_FOUNDBoolean indicating whether (the requested version of) OpenSP is available.
OpenSP_VERSIONThe version of found OpenSP.
OpenSP_VERSION_MAJORThe major version of OpenSP.
OpenSP_VERSION_MINORThe minor version of OpenSP.
OpenSP_VERSION_PATCHThe patch version of OpenSP.
OpenSP_INCLUDE_DIRSThe include directories containing headers needed to use the OpenSP library.
OpenSP_LIBRARIESLibraries required to link against to use OpenSP. These can be passed to the
target_link_libraries()command when not using theOpenSP::OpenSPimported target.
快取變數¶
The following cache variables may also be set:
OpenSP_INCLUDE_DIRThe OpenSP include directory.
OpenSP_LIBRARYThe absolute path of the
osplibrary.OpenSP_MULTI_BYTETrue if
SP_MULTI_BYTEwas found to be defined in OpenSP'sconfig.hheader file, which indicates that the OpenSP library was compiled with support for multi-byte characters. The consuming target needs to define theSP_MULTI_BYTEpreprocessor macro to match this value in order to avoid issues with character decoding.
範例¶
Finding the OpenSP library and linking it to a project target:
find_package(OpenSP)
target_link_libraries(project_target PRIVATE OpenSP::OpenSP)