Files
swift-mirror/cmake/modules/SwiftConfig.cmake.in
AlexDenisov a5f2f76716 CMake: expose Swift version through CMakeConfig.cmake (#67152)
Rationale: we are using Swift compiler as a library in a downstream project and having these exposed would streamline version detection for our use case.
Additionally, this PR makes CMake config a bit more uniform with LLVM/Clang configs.
2023-07-22 13:12:15 -07:00

35 lines
1.1 KiB
CMake

# This file provides information and services to the final user.
@SWIFT_CONFIG_CODE@
set(SWIFT_VERSION_MAJOR @SWIFT_VERSION_MAJOR@)
set(SWIFT_VERSION_MINOR @SWIFT_VERSION_MINOR@)
set(SWIFT_VERSION_PATCH @SWIFT_VERSION_PATCHLEVEL@)
set(SWIFT_VERSION @SWIFT_VERSION@)
set(SWIFT_MAIN_SRC_DIR @SWIFT_SOURCE_DIR@)
set(SWIFT_INCLUDE_DIRS "@SWIFT_INCLUDE_DIRS@")
set(SWIFT_LIBRARY_DIRS "@SWIFT_LIBRARY_DIRS@")
# These variables are duplicated, but they must match the LLVM variables of the
# same name. The variables ending in "S" could some day become lists, and are
# preserved for convention and compatibility.
set(SWIFT_INCLUDE_DIR "@SWIFT_INCLUDE_DIRS@")
set(SWIFT_LIBRARY_DIR "@SWIFT_LIBRARY_DIRS@")
set(SWIFT_CMAKE_DIR "@SWIFT_CMAKE_DIR@")
set(SWIFT_BINARY_DIR "@SWIFT_BINARY_DIR@")
set(BOOTSTRAPPING_MODE "@BOOTSTRAPPING_MODE@")
set(CMARK_TARGETS_FILE @SWIFT_PATH_TO_CMARK_BUILD@/src/cmarkTargets.cmake)
if(NOT TARGET libcmark_static AND EXISTS ${CMARK_TARGETS_FILE})
include(${CMARK_TARGETS_FILE})
endif()
if(NOT TARGET swift)
set(SWIFT_EXPORTED_TARGETS "@SWIFT_CONFIG_EXPORTS@")
include("@SWIFT_EXPORTS_FILE@")
endif()