[mujs] Update to 1.3.2 and add export CMake-config (#29543)

* New version with find_package.

* Update database.

* Update ports/mujs/portfile.cmake

Co-authored-by: Lily Wang <94091114+LilyWangLL@users.noreply.github.com>

* Update ports/mujs/portfile.cmake

Co-authored-by: Lily Wang <94091114+LilyWangLL@users.noreply.github.com>

* Update ports/mujs/portfile.cmake

Co-authored-by: Lily Wang <94091114+LilyWangLL@users.noreply.github.com>

* Update ports/mujs/vcpkg.json

Co-authored-by: Lily Wang <94091114+LilyWangLL@users.noreply.github.com>

* Update ports/mujs/portfile.cmake

Co-authored-by: Lily Wang <94091114+LilyWangLL@users.noreply.github.com>

* Update ports/mujs/vcpkg.json

Co-authored-by: Lily Wang <94091114+LilyWangLL@users.noreply.github.com>

* Update database.

* Automatic versioning and db update.

* Modify port version in portfile.cmake

* x-add-version

* Update mujs.json

* Modify TARGETS_EXPORT_NAME

* x-add-version

---------

Co-authored-by: Lily Wang <94091114+LilyWangLL@users.noreply.github.com>
Co-authored-by: Lily Wang <494550702@qq.com>
This commit is contained in:
as-shura 2023-02-13 16:57:54 +01:00 committed by GitHub
parent 2137cb6c6a
commit 89f522a548
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 69 additions and 18 deletions

View File

@ -1,24 +1,48 @@
cmake_minimum_required(VERSION 3.9)
project(mujs)
project(mujs VERSION 1.3.2)
if(MSVC)
add_compile_options(/W3 /wd4005 /wd4996 /wd4018 -D_CRT_SECURE_NO_WARNINGS)
endif()
file(GLOB libmujs_sources js*.c utf*.c regexp.c)
file(GLOB mujs_sources js*.c utf*.c regexp.c)
include_directories(.)
add_library(mujs ${mujs_sources})
add_library(libmujs ${libmujs_sources})
target_include_directories(mujs PUBLIC "$<INSTALL_INTERFACE:include>")
# Add CMake find_package() integration
set(CONFIG_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}")
set(PROJECT_CONFIG "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake")
set(TARGETS_EXPORT_NAME "unofficial-${PROJECT_NAME}Targets")
set(NAMESPACE "unofficial::mujs::")
install(
TARGETS libmujs
TARGETS mujs
EXPORT ${TARGETS_EXPORT_NAME}
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
)
export(TARGETS mujs NAMESPACE ${NAMESPACE} FILE mujsTargets.cmake)
include(CMakePackageConfigHelpers)
write_basic_package_version_file(
mujsConfigVersion.cmake
VERSION ${PACKAGE_VERSION}
COMPATIBILITY AnyNewerVersion
)
configure_package_config_file("mujsConfig.cmake.in" "${PROJECT_CONFIG}" INSTALL_DESTINATION "${CONFIG_INSTALL_DIR}")
install(FILES "${PROJECT_CONFIG}" DESTINATION "${CONFIG_INSTALL_DIR}")
install(EXPORT ${TARGETS_EXPORT_NAME}
NAMESPACE ${NAMESPACE}
DESTINATION "${CONFIG_INSTALL_DIR}")
if(NOT DISABLE_INSTALL_HEADERS)
install(FILES mujs.h DESTINATION include)
endif()

View File

@ -0,0 +1,8 @@
@PACKAGE_INIT@
include(CMakeFindDependencyMacro)
# Any extra setup
# Add the targets file
include("${CMAKE_CURRENT_LIST_DIR}/@TARGETS_EXPORT_NAME@.cmake")

View File

@ -3,20 +3,24 @@ vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO ccxvii/mujs
REF c86267d8b2b5f9a6ae318dc69886109eee0c7b61
SHA512 927b000cd6a28b785d510917445a5a39a4dbaf0e13eab920cf83c7838b111b8a0542cfab0110f8493dc65b88a48261deb6ba7a871cbe77fb46119b536a69d470
REF "${VERSION}"
SHA512 ccffb04171f7ecec2cfa6f0e59859acc911836370a648e4c6703db174631ce316413a64ebf4b32eea3d3b09221ff01861cda91f4b1b9bebf495168f26f90daf5
HEAD_REF master
)
file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})
file(COPY "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt" DESTINATION "${SOURCE_PATH}")
file(COPY "${CMAKE_CURRENT_LIST_DIR}/mujsConfig.cmake.in" DESTINATION "${SOURCE_PATH}")
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
OPTIONS_DEBUG -DDISABLE_INSTALL_HEADERS=ON -DDISABLE_INSTALL_TOOLS=ON
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS_DEBUG
-DDISABLE_INSTALL_HEADERS=ON
-DDISABLE_INSTALL_TOOLS=ON
)
vcpkg_install_cmake()
vcpkg_cmake_install()
vcpkg_fixup_pkgconfig()
vcpkg_cmake_config_fixup(PACKAGE_NAME mujs CONFIG_PATH lib/cmake/mujs)
vcpkg_copy_pdbs()
file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/mujs RENAME copyright)
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/COPYING")

View File

@ -1,7 +1,17 @@
{
"name": "mujs",
"version-string": "2018-07-30",
"port-version": 2,
"version": "1.3.2",
"description": "An embeddable Javascript interpreter in C",
"homepage": "https://github.com/ccxvii/mujs"
"homepage": "https://github.com/ccxvii/mujs",
"license": "ISC",
"dependencies": [
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}
]
}

View File

@ -5229,8 +5229,8 @@
"port-version": 3
},
"mujs": {
"baseline": "2018-07-30",
"port-version": 2
"baseline": "1.3.2",
"port-version": 0
},
"munit": {
"baseline": "2019-04-06",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "9c67a4a21c48b6ad43918a526e539cf90d822e1a",
"version": "1.3.2",
"port-version": 0
},
{
"git-tree": "b08453227e8770baadeb826bb3cd711815e6a865",
"version-string": "2018-07-30",