Skip to content

Commit 977fb9d

Browse files
committed
Make specifying the CMake components optional.
1 parent 4d29ae1 commit 977fb9d

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

cmake/pcre2-config.cmake.in

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,13 @@
77
# -----------------
88
# To make use of the static library instead of the shared one, one needs
99
# to set the variable PCRE2_USE_STATIC_LIBS to ON before calling find_package.
10+
#
11+
# The following components are supported: 8BIT, 16BIT, 32BIT and POSIX.
12+
# They used to be required but not anymore; all available targets will
13+
# be defined regardless of the requested components.
1014
# Example:
1115
# set(PCRE2_USE_STATIC_LIBS ON)
12-
# find_package(PCRE2 CONFIG COMPONENTS 8BIT)
16+
# find_package(PCRE2 CONFIG)
1317
#
1418
# This will define the following variables:
1519
#
@@ -51,13 +55,6 @@ _pcre2_add_component_target(16BIT 16)
5155
_pcre2_add_component_target(32BIT 32)
5256
_pcre2_add_component_target(POSIX posix)
5357

54-
# Check if at least one component has been specified.
55-
list(LENGTH PCRE2_FIND_COMPONENTS PCRE2_NCOMPONENTS)
56-
if (PCRE2_NCOMPONENTS LESS 1)
57-
message(FATAL_ERROR "No components have been specified. This is not allowed. Please, specify at least one component.")
58-
endif ()
59-
unset(PCRE2_NCOMPONENTS)
60-
6158
# When POSIX component has been specified make sure that also 8BIT component is specified.
6259
set(PCRE2_8BIT_COMPONENT FALSE)
6360
set(PCRE2_POSIX_COMPONENT FALSE)

0 commit comments

Comments
 (0)