mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-28 19:25:27 +08:00
67b8c01d07
* [elements] Add new port * [elements] Only static library Co-authored-by: Lily Wang <94091114+LilyWangLL@users.noreply.github.com> * [elements] Update installation commands Co-authored-by: Lily Wang <94091114+LilyWangLL@users.noreply.github.com> * [elements] Use vcpkg_install_copyright command Co-authored-by: Lily Wang <94091114+LilyWangLL@users.noreply.github.com> * [elements] Update installation commands Co-authored-by: Lily Wang <94091114+LilyWangLL@users.noreply.github.com> * [elements] Remove outdated flags * [elements] Update portfile * Update version database Co-authored-by: Lily Wang <94091114+LilyWangLL@users.noreply.github.com>
57 lines
2.3 KiB
Diff
57 lines
2.3 KiB
Diff
diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt
|
|
index e8179fbe..f3ac5ddf 100644
|
|
--- a/lib/CMakeLists.txt
|
|
+++ b/lib/CMakeLists.txt
|
|
@@ -215,13 +215,13 @@ endif()
|
|
# Cairo
|
|
|
|
if (MSVC)
|
|
- target_include_directories(elements PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/external/cairo/include)
|
|
+ find_path(Cairo_INCLUDE_DIR cairo/cairo.h)
|
|
+ list(APPEND Cairo_INCLUDE_DIRS ${Cairo_INCLUDE_DIR})
|
|
+ list(APPEND Cairo_INCLUDE_DIRS ${Cairo_INCLUDE_DIR}/cairo)
|
|
+ target_include_directories(elements PUBLIC ${Cairo_INCLUDE_DIRS})
|
|
|
|
- if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
|
- target_link_libraries(elements PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/external/cairo/lib/x64/cairo.lib)
|
|
- else()
|
|
- target_link_libraries(elements PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/external/cairo/lib/x86/cairo.lib)
|
|
- endif()
|
|
+ find_library(Cairo_LIBRARY cairo)
|
|
+ target_link_libraries(elements PUBLIC ${Cairo_LIBRARY})
|
|
elseif (APPLE)
|
|
# TODO: add a min version specifiction
|
|
pkg_check_modules(cairo REQUIRED IMPORTED_TARGET cairo)
|
|
@@ -240,13 +240,8 @@ endif()
|
|
# Fontconfig
|
|
|
|
if (MSVC)
|
|
- target_include_directories(elements PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/external/fontconfig/include)
|
|
-
|
|
- if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
|
- target_link_libraries(elements PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/external/fontconfig/x64/fontconfig.lib)
|
|
- else()
|
|
- target_link_libraries(elements PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/external/fontconfig/x86/fontconfig.lib)
|
|
- endif()
|
|
+ find_package(Fontconfig REQUIRED)
|
|
+ target_link_libraries(elements PUBLIC Fontconfig::Fontconfig)
|
|
elseif (APPLE)
|
|
pkg_check_modules(fontconfig REQUIRED IMPORTED_TARGET fontconfig)
|
|
target_include_directories(elements PUBLIC ${fontconfig_INCLUDE_DIRS})
|
|
@@ -261,13 +256,8 @@ endif()
|
|
# Freetype
|
|
|
|
if (MSVC)
|
|
- target_include_directories(elements PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/external/freetype/include)
|
|
-
|
|
- if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
|
- target_link_libraries(elements PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/external/freetype/win64/freetype.lib)
|
|
- else()
|
|
- target_link_libraries(elements PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/external/freetype/win32/freetype.lib)
|
|
- endif()
|
|
+ find_package(Freetype REQUIRED)
|
|
+ target_link_libraries(elements PUBLIC Freetype::Freetype)
|
|
elseif (APPLE)
|
|
pkg_check_modules(freetype2 REQUIRED IMPORTED_TARGET freetype2)
|
|
target_include_directories(elements PUBLIC ${freetype2_INCLUDE_DIRS})
|