28 lines
928 B
CMake
28 lines
928 B
CMake
# SPDX-FileCopyrightText: 2022 Matteo Settenvini <matteo.settenvini@montecristosoftware.eu>
|
|
# SPDX-License-Identifier: CC0-1.0
|
|
|
|
cmake_minimum_required(VERSION 3.23)
|
|
|
|
project(nss_malcontent
|
|
DESCRIPTION ""
|
|
VERSION 0.1.0
|
|
LANGUAGES C)
|
|
|
|
include(FetchContent)
|
|
FetchContent_Declare(
|
|
Corrosion
|
|
GIT_REPOSITORY https://github.com/corrosion-rs/corrosion.git
|
|
GIT_TAG v0.2.1
|
|
)
|
|
|
|
# set(Rust_TOOLCHAIN nightly)
|
|
FetchContent_MakeAvailable(Corrosion)
|
|
corrosion_import_crate(MANIFEST_PATH Cargo.toml)
|
|
|
|
set(sonamever 2) # mandated by NSS 3
|
|
get_property(corrosion_install_libraries TARGET nss_malcontent PROPERTY INTERFACE_LINK_LIBRARIES)
|
|
string(TOUPPER ${CMAKE_BUILD_TYPE} config_type_upper)
|
|
get_property(location TARGET ${corrosion_install_libraries} PROPERTY "IMPORTED_LOCATION_${config_type_upper}")
|
|
cmake_path(GET location FILENAME lib_basename)
|
|
install(FILES ${location} TYPE LIB RENAME "${lib_basename}.${sonamever}")
|