Skip to content

Commit 9aa75cf

Browse files
TimeLooperrsomla1
authored andcommitted
Bug#37734620: Contribution: Do not use NO_CACHE option of cmake find_xxx() commands
1 parent 1d07819 commit 9aa75cf

File tree

4 files changed

+23
-18
lines changed

4 files changed

+23
-18
lines changed

mysql-concpp-config.cmake.in

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -479,11 +479,12 @@ function(find_includes)
479479

480480
#message(STATUS "Looking for headers at: ${INCLUDE_DIR}")
481481

482+
unset(MYSQL_CONCPP_INCLUDE_DIR CACHE)
482483
find_path(MYSQL_CONCPP_INCLUDE_DIR
483484
NAMES mysqlx/xdevapi.h
484485
PATHS ${INCLUDE_DIR}
485486
NO_DEFAULT_PATH
486-
NO_CACHE
487+
# NO_CACHE # Note: requires cmake 3.21
487488
)
488489

489490
if(NOT MYSQL_CONCPP_INCLUDE_DIR)
@@ -697,7 +698,7 @@ function(add_connector_target which tgt base_name)
697698
find_library(lib_path
698699
NAMES ${lib_name}
699700
${find_lib_paths} ${win_opts}
700-
NO_CACHE
701+
# NO_CACHE
701702
)
702703

703704
if(lib_path)
@@ -740,7 +741,7 @@ function(add_connector_target which tgt base_name)
740741
PATHS "${LIBRARY_DIR}/debug"
741742
${win_opts}
742743
NO_DEFAULT_PATH
743-
NO_CACHE
744+
# NO_CACHE
744745
)
745746

746747
if(lib_path_debug)
@@ -880,12 +881,13 @@ function(find_imp_lib var base_name path)
880881
set(CMAKE_FIND_LIBRARY_SUFFIXES .lib)
881882

882883
#message("!!! Looking for import library for: ${path}")
884+
unset(${var} CACHE)
883885
find_library(${var}
884886
NAMES ${base_name}
885887
PATHS ${base_path}
886888
PATH_SUFFIXES ${vs_suffix}
887889
NO_DEFAULT_PATH
888-
NO_CACHE
890+
# NO_CACHE
889891
)
890892

891893
if(NOT ${var})
@@ -921,7 +923,7 @@ function(find_deps)
921923
PATHS ${LIBRARY_DIR}
922924
PATH_SUFFIXES private ${vs_suffix}
923925
NO_DEFAULT_PATH
924-
NO_CACHE
926+
# NO_CACHE
925927
)
926928

927929
unset(ssl_crypto CACHE)
@@ -930,7 +932,7 @@ function(find_deps)
930932
PATHS ${LIBRARY_DIR}
931933
PATH_SUFFIXES private ${vs_suffix}
932934
NO_DEFAULT_PATH
933-
NO_CACHE
935+
# NO_CACHE
934936
)
935937

936938
if(NOT ssl_lib OR NOT ssl_crypto)

testapp/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,13 @@ function(find_openssl where)
7575
endif()
7676
endif()
7777

78+
unset(openssl CACHE)
7879
find_library(openssl
7980
NAMES ssl
8081
PATHS "${WITH_SSL}"
8182
PATH_SUFFIXES "" "lib" "lib64"
8283
NO_DEFAULT_PATH
83-
NO_CACHE
84+
# NO_CACHE # Note: requires cmake 3.21
8485
)
8586

8687
if(NOT openssl)

testing/find_package/CMakeLists.txt

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -124,11 +124,12 @@ macro(add_version_tests)
124124

125125
if(WITH_CONCPP)
126126

127-
find_file(INFO_SRC
127+
unset(INFO_SRC CACHE)
128+
find_file(INFO_SRC
128129
NAME INFO_SRC
129130
PATHS ${WITH_CONCPP}
130131
NO_DEFAULT_PATH
131-
NO_CACHE
132+
#NO_CACHE # Note: requires cmake 3.21
132133
)
133134

134135
else()
@@ -210,7 +211,7 @@ macro(add_version_tests)
210211

211212
# Prepare options for run_test.cmake
212213

213-
set(test_opts
214+
set(test_opts
214215
"-DVERSION=${VERSION_${A}}"
215216
"-DWITH_DEBUG=${WITH_DEBUG}"
216217
)
@@ -256,12 +257,13 @@ macro(add_tests)
256257

257258
if(WITH_SSL)
258259

260+
unset(openssl_lib CACHE)
259261
find_library(openssl_lib
260262
NAMES ssl libssl
261263
PATHS ${WITH_SSL}
262264
PATH_SUFFIXES lib
263265
NO_DEFAULT_PATH
264-
NO_CACHE
266+
# NO_CACHE
265267
)
266268

267269
endif()
@@ -287,8 +289,8 @@ macro(add_tests)
287289
# Note: On Windows scenarios which build in Debug mode with static
288290
# connector library are added only if debug package is available.
289291

290-
if(WIN32
291-
AND A STREQUAL "static"
292+
if(WIN32
293+
AND A STREQUAL "static"
292294
AND B STREQUAL "Debug"
293295
AND NOT WITH_DEBUG
294296
)
@@ -332,7 +334,7 @@ macro(add_tests)
332334
#
333335
# They are implemented by run_test.cmake -- see there.
334336

335-
add_test("config_${name_suffix}"
337+
add_test("config_${name_suffix}"
336338
${CMAKE_COMMAND}
337339
"-DCDK_DIR=${CDK_DIR}"
338340
"-DCONCPP_SRC_DIR=${HOME_DIR}/../.."
@@ -347,7 +349,7 @@ macro(add_tests)
347349
FIXTURES_SETUP "${name_suffix}_configured"
348350
)
349351

350-
add_test("build_${name_suffix}"
352+
add_test("build_${name_suffix}"
351353
${CMAKE_COMMAND}
352354
"-DCDK_DIR=${CDK_DIR}"
353355
"-DCONCPP_SRC_DIR=${HOME_DIR}/../.."
@@ -365,7 +367,7 @@ macro(add_tests)
365367

366368
message(STATUS "# added test: build_${name_suffix}")
367369

368-
add_test("check_${name_suffix}"
370+
add_test("check_${name_suffix}"
369371
${CMAKE_COMMAND}
370372
"-DCDK_DIR=${CDK_DIR}"
371373
"-DCONCPP_SRC_DIR=${HOME_DIR}/../.."

testing/find_package/run_test.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,11 +182,11 @@ function(action_check)
182182
foreach(exec devapi_test xapi_test jdbc_test)
183183

184184
set(exec_path)
185-
find_program(exec_path
185+
find_program(exec_path
186186
NAMES ${exec}
187187
PATHS "config_test/${out_dir}"
188188
NO_DEFAULT_PATH
189-
NO_CACHE
189+
# NO_CACHE # note: requires cmake 3.21
190190
)
191191

192192
if(NOT EXISTS "${exec_path}")

0 commit comments

Comments
 (0)