Skip to content

Commit 192c949

Browse files
committed
WL#16321: Let CMake configuration script handle debug-only installs -- post push fix
Add handling of `jdbc` component; now that our package handles components.
1 parent cf828d4 commit 192c949

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

mysql-concpp-config.cmake.in

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,9 @@
4646
# Also, the following variables are set:
4747
#
4848
# - Xxx_FOUND
49-
# - Xxx_DEBUG_FOUND, Xxx_debug_FOUND -- (1)
50-
# - Xxx_RELEASE_FOUND, Xxx_release_FOUND -- (1)
49+
# - Xxx_JDBC_FOUND, Xxx_jdbc_FOUND -- (1a)
50+
# - Xxx_DEBUG_FOUND, Xxx_debug_FOUND -- (1b)
51+
# - Xxx_RELEASE_FOUND, Xxx_release_FOUND -- (1b)
5152
# - Xxx_VERSION, Xxx_VERSION_CC
5253
# - Xxx_ROOT_DIR -- (2)
5354
# - Xxx_RUNTIME_LIBRARY_DIRS, Xxx_RUNTIME_LIBRARY_DIR -- (2,3)
@@ -58,7 +59,11 @@
5859
# In these variable names Xxx is either `MYSQL_CONCPP` or `mysql-concpp`,
5960
# CC is version component: one of `MAJOR`, `MINOR` or `PATCH`.
6061
#
61-
# Note (1): These are set to true if debug/release libraries are available
62+
# Note (1a): Set to true if the classic JDBC connector libraries were found and
63+
# the -jdbc targets are defined. It must be the case if `REQUIRE jdbc` clause
64+
# was used in the cmake `find_package()` command.
65+
#
66+
# Note (1b): These are set to true if debug/release libraries are available
6267
# (see below).
6368
#
6469
# Note (2): Set only in case of a monolithic install (TGZ, ZIP, MSI).
@@ -357,7 +362,11 @@ macro(main)
357362
add_library(mysql::concpp${suffix} ALIAS mysql::concpp-xdevapi${suffix})
358363
endif()
359364

360-
endforeach()
365+
if(TARGET mysql::concpp-jdbc${suffix})
366+
set(MYSQL_CONCPP_JDBC_FOUND 1)
367+
endif()
368+
369+
endforeach()
361370

362371

363372
# Build the NOT_FOUND message.
@@ -388,6 +397,7 @@ macro(main)
388397
# Note: The _FOUND variable name expected by FPHSA for component CCC
389398
# is mysql-concpp_CCC_FOUND
390399

400+
set(mysql-concpp_jdbc_FOUND ${MYSQL_CONCPP_JDBC_FOUND})
391401
set(mysql-concpp_debug_FOUND ${MYSQL_CONCPP_DEBUG_FOUND})
392402
set(mysql-concpp_release_FOUND ${MYSQL_CONCPP_RELEASE_FOUND})
393403

@@ -403,6 +413,7 @@ macro(main)
403413

404414
# Set alternative variables
405415

416+
set(MYSQL_CONCPP_jdbc_FOUND ${MYSQL_CONCPP_JDBC_FOUND})
406417
set(MYSQL_CONCPP_debug_FOUND ${MYSQL_CONCPP_DEBUG_FOUND})
407418
set(MYSQL_CONCPP_release_FOUND ${MYSQL_CONCPP_RELEASE_FOUND})
408419

@@ -412,6 +423,7 @@ macro(main)
412423
RUNTIME_LIBRARY_DIR_DEBUG RUNTIME_LIBRARY_DIRS_DEBUG
413424
RUNTIME_LIBRARY_DIR_RELEASE RUNTIME_LIBRARY_DIRS_RELEASE
414425
DEBUG_FOUND debug_FOUND RELEASE_FOUND release_FOUND
426+
JDBC_FOUND jdbc_FOUND
415427
)
416428

417429
if(NOT DEFINED MYSQL_CONCPP_${var})

0 commit comments

Comments
 (0)