File tree Expand file tree Collapse file tree 5 files changed +44
-7
lines changed Expand file tree Collapse file tree 5 files changed +44
-7
lines changed Original file line number Diff line number Diff line change
1
+ cmake_minimum_required (VERSION 3.20 )
2
+ project (find -libintl C )
3
+
4
+ set (OUTFILE "${CMAKE_CURRENT_BINARY_DIR} /detected_intl.cmake" CACHE FILEPATH "Where to store results" )
5
+
6
+ find_package (Intl )
7
+ find_file (LIBINTL_H NAMES libintl.h PATHS ${Intl_INCLUDE_DIRS} )
8
+
9
+ string (CONFIGURE [[
10
+ set(VCPKG_DETECTED_Intl_FOUND "@Intl_FOUND@")
11
+ set(VCPKG_DETECTED_Intl_IS_BUILT_IN "@Intl_IS_BUILT_IN@")
12
+ set(VCPKG_DETECTED_Intl_INCLUDE_DIRS "@Intl_INCLUDE_DIRS@")
13
+ set(VCPKG_DETECTED_LIBINTL_H "@LIBINTL_H@")
14
+ ]] detected_intl @ONLY ESCAPE_QUOTES )
15
+
16
+ file (WRITE "${OUTFILE} " "${detected_intl} " )
Original file line number Diff line number Diff line change 1
- if (VCPKG_TARGET_IS_LINUX )
2
- set (VCPKG_POLICY_EMPTY_PACKAGE enabled )
3
- if (NOT EXISTS "/usr/include/libintl.h" )
1
+ if (VCPKG_TARGET_IS_LINUX AND NOT X_VCPKG_FORCE_VCPKG_GETTEXT_LIBINTL )
2
+ set (detection_results "${CURRENT_BUILDTREES_DIR} /detected-intl-${TARGET_TRIPLET} .cmake.log" )
3
+ file (REMOVE "${detection_results} " )
4
+ block (SCOPE_FOR VARIABLES )
5
+ set (VCPKG_BUILD_TYPE release )
6
+ vcpkg_cmake_configure (SOURCE_PATH "${CURRENT_PORT_DIR} /detect" OPTIONS "-DOUTFILE=${detection_results} " )
7
+ endblock ()
8
+ include ("${detection_results} " )
9
+ message (STATUS "libintl header: ${VCPKG_DETECTED_LIBINTL_H} " )
10
+ if (NOT VCPKG_DETECTED_LIBINTL_H )
4
11
message (FATAL_ERROR
5
- "When targeting Linux, `libintl.h` is expected to come from the C Runtime Library (glibc). "
6
- "Please use \" sudo apt-get install libc-dev\" or the equivalent to install development files."
12
+ "When targeting Linux, `libintl.h` is expected to come from a system package. "
13
+ "Please use the following commands or the equivalent to install development files.\n "
14
+ "On Debian and Ubuntu derivatives: \" sudo apt-get install libc-dev\"\n "
15
+ "On Alpine: \" apk add gettext-dev\"\n "
7
16
)
8
17
endif ()
18
+
19
+ set (VCPKG_POLICY_EMPTY_PACKAGE enabled )
9
20
file (COPY "${CMAKE_CURRENT_LIST_DIR} /usage" DESTINATION "${CURRENT_PACKAGES_DIR} /share/${PORT} " )
10
21
return ()
11
22
endif ()
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " gettext-libintl" ,
3
3
"version" : " 0.22.5" ,
4
- "port-version" : 1 ,
4
+ "port-version" : 2 ,
5
5
"description" : " The libintl C library from GNU gettext-runtime." ,
6
6
"homepage" : " https://www.gnu.org/software/gettext/" ,
7
7
"license" : " LGPL-2.1-or-later" ,
10
10
{
11
11
"name" : " libiconv" ,
12
12
"platform" : " !linux"
13
+ },
14
+ {
15
+ "name" : " vcpkg-cmake" ,
16
+ "host" : true ,
17
+ "platform" : " linux"
13
18
}
14
19
]
15
20
}
Original file line number Diff line number Diff line change 3022
3022
},
3023
3023
"gettext-libintl" : {
3024
3024
"baseline" : " 0.22.5" ,
3025
- "port-version" : 1
3025
+ "port-version" : 2
3026
3026
},
3027
3027
"gettimeofday" : {
3028
3028
"baseline" : " 2017-10-14" ,
Original file line number Diff line number Diff line change 1
1
{
2
2
"versions" : [
3
+ {
4
+ "git-tree" : " f41e983c85004eb6ee8d290ecb2465832fce8c00" ,
5
+ "version" : " 0.22.5" ,
6
+ "port-version" : 2
7
+ },
3
8
{
4
9
"git-tree" : " ac89519d5ec11430978a4e45619befb7a1c4a062" ,
5
10
"version" : " 0.22.5" ,
You can’t perform that action at this time.
0 commit comments