Bug #117763 Contribution: Clear the return variable from the CMake cache

Submitted: 20 Mar 2025 15:06 Modified: 21 Mar 2025 16:11
Reporter: OCA Admin (OCA) Email Updates:
Status: Closed Impact on me:
None 
Category:Connector / C++ Severity:S3 (Non-critical)
Version:9.0 OS:Any
Assigned to: CPU Architecture:Any
Tags: Contribution

[20 Mar 2025 15:06] OCA Admin
Description:
This bug tracks a contribution by Lenny Wu (Github user: TimeLooper), as described in http://github.com/mysql/mysql-connector-cpp/pull/37

How to repeat:
See description

Suggested fix:
See contribution code attached
[20 Mar 2025 15:06] OCA Admin
Contribution submitted via Github - Clear the return variable from the CMake cache 
(*) Contribution by Lenny Wu (Github TimeLooper, mysql-connector-cpp/pull/37#issuecomment-2740006759): I confirm the code being submitted is offered under the terms of the OCA, and that I am authorized to contribute it.

Contribution: git_patch_2390895134.txt (text/plain), 714 bytes.

[20 Mar 2025 15:41] MySQL Verification Team
Hello Lenny Wu,

Thank you for the report and contribution.

regards,
Umesh
[21 Mar 2025 5:05] Rafal Somla
Posted by developer:
 
Refined Problem Description
===========================
Our cmake files use NO_CACHE option for find_xxx() commands to prevent storing results of the search in the cache. However, the NO_CACHE option is supported by cmake 3.21+ and our build system should work with cmake 3.15+. The earlier cmake versions seem to ignore the option which leads to errors because find_xxx() does nothing if result variable is already stored in the cache.

Implemented solution
====================
Replace NO_CACHE option by explicit clearing of the cache variable before invoking find_xxx() commands.
[21 Mar 2025 16:11] Daniel So
Posted by developer:
 
Added the following entry to the C/C++9.3.0 changelog: 

"The mysql-concpp module used the NO_CACHE CMake option, which was not supported for CMake 3.20 and earlier, making the find_ methods fail. This patch uses an implicit command to clear the cached variables instead, before the calls of the find_ methods. Thanks to Lenny Wu for contributing the fix."
[14 Apr 2025 20:25] Daniel So
Posted by developer:
 
Corrected the changelog entry to the following: 

"The mysql-concpp module used the NO_CACHE CMake option, which was not supported for CMake 3.20 and earlier, making the find_ methods fail. This patch uses an explicit command to clear the cached variables instead, before the calls of the find_ methods. Thanks to Lenny Wu for contributing the fix."

Portions of this website are copyright © 2001, 2002 The PHP Group

Page generated in 0.042 sec. using MySQL 8.4.7-u6-cloud

Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.