forked from microsoft/vcpkg
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[qlementine-icons] Add port (microsoft#44046)
- Loading branch information
Showing
6 changed files
with
181 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
index 3173dd4..2fd1a7d 100644 | ||
--- a/CMakeLists.txt | ||
+++ b/CMakeLists.txt | ||
@@ -1,7 +1,7 @@ | ||
cmake_minimum_required(VERSION 3.17.5) | ||
|
||
# Set project information. | ||
-project("qlementine_icons" | ||
+project("qlementine-icons" | ||
LANGUAGES CXX | ||
VERSION 1.6.0.0 | ||
DESCRIPTION "Modern icon theme for Qt applications." | ||
@@ -12,6 +12,7 @@ set(CMAKE_CXX_EXTENSIONS OFF) | ||
set(CMAKE_CXX_STANDARD 17) | ||
set(CMAKE_CXX_STANDARD_REQUIRED ON) | ||
set_property(GLOBAL PROPERTY USE_FOLDERS ON) | ||
+set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake") | ||
|
||
# Find Qt. | ||
find_package(Qt6 REQUIRED COMPONENTS Core Widgets Svg) | ||
@@ -21,6 +22,6 @@ qt_standard_project_setup() | ||
add_subdirectory(sources) | ||
|
||
# Sandbox. | ||
-if(${CMAKE_PROJECT_NAME} STREQUAL ${PROJECT_NAME}) | ||
+if(QLEMENTINE_ICONS_SANDBOX) | ||
add_subdirectory(sandbox) | ||
endif() | ||
diff --git a/cmake/config.cmake.in b/cmake/config.cmake.in | ||
new file mode 100644 | ||
index 0000000..abcf8fc | ||
--- /dev/null | ||
+++ b/cmake/config.cmake.in | ||
@@ -0,0 +1,8 @@ | ||
+@PACKAGE_INIT@ | ||
+ | ||
+include("${CMAKE_CURRENT_LIST_DIR}/@[email protected]") | ||
+include(CMakeFindDependencyMacro) | ||
+ | ||
+find_dependency(Qt6 REQUIRED COMPONENTS Core Svg) | ||
+ | ||
+check_required_components(@PROJECT_NAME@) | ||
diff --git a/sources/CMakeLists.txt b/sources/CMakeLists.txt | ||
index 5fb2c18..196b21d 100644 | ||
--- a/sources/CMakeLists.txt | ||
+++ b/sources/CMakeLists.txt | ||
@@ -1,6 +1,6 @@ | ||
# Create the library. | ||
add_library(${PROJECT_NAME} STATIC) | ||
-add_library(oclero::${PROJECT_NAME} ALIAS ${PROJECT_NAME}) | ||
+include(CMakePackageConfigHelpers) | ||
|
||
file(GLOB_RECURSE QRC_FILES "resources/icons/*.qrc") | ||
file(GLOB_RECURSE HPP_FILES "include/oclero/qlementine/icons/*.hpp") | ||
@@ -16,11 +16,15 @@ target_sources(${PROJECT_NAME} | ||
target_include_directories(${PROJECT_NAME} | ||
PUBLIC | ||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include> | ||
+ $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}> | ||
PRIVATE | ||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src> | ||
) | ||
|
||
-target_link_libraries(${PROJECT_NAME} PRIVATE Qt::Core Qt::Svg) | ||
+target_link_libraries(${PROJECT_NAME} | ||
+ PUBLIC | ||
+ Qt::Core | ||
+ Qt::Svg) | ||
|
||
set_target_properties(${PROJECT_NAME} PROPERTIES | ||
LINKER_LANGUAGE CXX | ||
@@ -34,3 +38,36 @@ set_target_properties(${PROJECT_NAME} PROPERTIES | ||
) | ||
|
||
target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_17) | ||
+ | ||
+# Install target | ||
+configure_package_config_file("${CMAKE_CURRENT_SOURCE_DIR}/../cmake/config.cmake.in" | ||
+ "${CMAKE_BINARY_DIR}/cmake/${PROJECT_NAME}Config.cmake" | ||
+ INSTALL_DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}") | ||
+ | ||
+write_basic_package_version_file("${CMAKE_BINARY_DIR}/cmake/${PROJECT_NAME}ConfigVersion.cmake" | ||
+ VERSION "${PROJECT_VERSION}" | ||
+ COMPATIBILITY AnyNewerVersion) | ||
+ | ||
+install(TARGETS ${PROJECT_NAME} | ||
+ EXPORT "${PROJECT_NAME}Targets" | ||
+ LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" | ||
+ ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" | ||
+ RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" | ||
+ INCLUDES DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}") | ||
+ | ||
+install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/include/" | ||
+ DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/") | ||
+ | ||
+install(EXPORT "${PROJECT_NAME}Targets" | ||
+ FILE "${PROJECT_NAME}Targets.cmake" | ||
+ NAMESPACE unofficial::${PROJECT_NAME}:: | ||
+ DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}") | ||
+ | ||
+install(FILES | ||
+ "${CMAKE_BINARY_DIR}/cmake/${PROJECT_NAME}Config.cmake" | ||
+ "${CMAKE_BINARY_DIR}/cmake/${PROJECT_NAME}ConfigVersion.cmake" | ||
+ DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}") | ||
+ | ||
+export(EXPORT "${PROJECT_NAME}Targets" | ||
+ FILE "${CMAKE_BINARY_DIR}/cmake/${PROJECT_NAME}Targets.cmake" | ||
+ NAMESPACE unofficial::${PROJECT_NAME}::) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
vcpkg_check_linkage(ONLY_STATIC_LIBRARY) | ||
|
||
vcpkg_from_github( | ||
OUT_SOURCE_PATH SOURCE_PATH | ||
REPO oclero/qlementine-icons | ||
REF "v${VERSION}" | ||
SHA512 0b703325266d069e47d9640ed1dc38b6fcc521344678f15f75e268a3a2a574136deea25d82618b1d09c3900f38e702b1fc036f4b860b2348a933da47daefe6de | ||
PATCHES | ||
cmake.patch | ||
) | ||
|
||
vcpkg_cmake_configure( | ||
SOURCE_PATH "${SOURCE_PATH}" | ||
OPTIONS | ||
-DQLEMENTINE_ICONS_SANDBOX=OFF | ||
) | ||
|
||
vcpkg_cmake_install() | ||
|
||
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/qlementine-icons) | ||
|
||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") | ||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share") | ||
|
||
vcpkg_copy_pdbs() | ||
|
||
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE") | ||
|
||
file(COPY "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
qlementine-icons provides CMake targets: | ||
|
||
find_package(qlementine-icons CONFIG REQUIRED) | ||
target_link_libraries(main PRIVATE unofficial::qlementine-icons::qlementine-icons) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"name": "qlementine-icons", | ||
"version": "1.6.0", | ||
"description": "Modern icon set for desktop Qt applications.", | ||
"homepage": "https://github.com/oclero/qlementine-icons/", | ||
"documentation": "https://oclero.github.io/qlementine-icons/", | ||
"license": "MIT", | ||
"dependencies": [ | ||
{ | ||
"name": "qtbase", | ||
"default-features": false, | ||
"features": [ | ||
"gui" | ||
] | ||
}, | ||
"qtsvg", | ||
{ | ||
"name": "vcpkg-cmake", | ||
"host": true | ||
}, | ||
{ | ||
"name": "vcpkg-cmake-config", | ||
"host": true | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"versions": [ | ||
{ | ||
"git-tree": "e5567f1e380ac4e2b14902e792cabb38ec2721df", | ||
"version": "1.6.0", | ||
"port-version": 0 | ||
} | ||
] | ||
} |