wasm-micro-runtime/build-scripts/package.cmake
peter-tatrai f2ef9ee62e
Cmake improvements (#4076)
- Utilizes the standard CMake variable BUILD_SHARED_LIBS to simplify the CMake configuration.
- Allows the use of a single library definition for both static and
  shared library cases, improving maintainability and readability of the CMake configuration.
- Install vmlib public header files
- Installs the public header files for the vmlib target to the include/iwasm directory.
- Install cmake package
- Adds the necessary CMake configuration files (iwasmConfig.cmake and iwasmConfigVersion.cmake).
- Configures the installation of these files to the appropriate directory (lib/cmake/iwasm).
- Ensures compatibility with the same major version.
- Improve windows product-mini CMakeLists.txt
- Fix missing symbols when linking windows product-mini with shared vmlib
- Improve Darwin product-mini CMakeLists.txt

---------

Signed-off-by: Peter Tatrai <peter.tatrai.ext@siemens.com>
2025-02-21 15:29:49 +08:00

29 lines
948 B
CMake

# Copyright (C) 2019 Intel Corporation. All rights reserved.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
function(install_iwasm_package)
install (EXPORT iwasmTargets
FILE iwasmTargets.cmake
NAMESPACE iwasm::
DESTINATION lib/cmake/iwasm
)
include (CMakePackageConfigHelpers)
configure_package_config_file (${CMAKE_CURRENT_FUNCTION_LIST_DIR}/iwasmConfig.cmake.in
"${CMAKE_CURRENT_BINARY_DIR}/iwasmConfig.cmake"
INSTALL_DESTINATION lib/cmake/iwasm
)
write_basic_package_version_file(
"${CMAKE_CURRENT_BINARY_DIR}/iwasmConfigVersion.cmake"
VERSION ${WAMR_VERSION_MAJOR}.${WAMR_VERSION_MINOR}.${WAMR_VERSION_PATCH}
COMPATIBILITY SameMajorVersion
)
install (FILES
"${CMAKE_CURRENT_BINARY_DIR}/iwasmConfig.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/iwasmConfigVersion.cmake"
DESTINATION lib/cmake/iwasm
)
endfunction()