Skip to content

Conversation

@antonvw
Copy link
Owner

@antonvw antonvw commented Jan 24, 2026

PR Type

Enhancement


Description

  • Reorganized CMake options processing for wxWidgets build

  • Moved wxBUILD_CXX_STANDARD to external/CMakeLists.txt

  • Reordered include statements to follow wxWidgets build sequence

  • Improved code formatting and consistency in CMake files


Diagram Walkthrough

flowchart LR
  A["CMakeLists.txt"] -->|includes| B["cmake/options-wx.cmake"]
  B -->|sets| C["wxUSE options"]
  A -->|includes| D["wxWidgets build cmake"]
  D -->|provides| E["wxWidgets configuration"]
  F["external/CMakeLists.txt"] -->|sets| G["wxBUILD_CXX_STANDARD"]
  G -->|used by| E
Loading

File Walkthrough

Relevant files
Configuration changes
options-wx.cmake
Reorganize wxWidgets options and remove CXX standard         

cmake/options-wx.cmake

  • Removed wxBUILD_CXX_STANDARD setting (moved to
    external/CMakeLists.txt)
  • Removed blank line after wxBUILD_CXX_STANDARD
  • Moved wxUSE_REGEX and wxUSE_STD_STRING_CONV_IN_WXSTRING to end of file
  • Changed wxUSE_STD_STRING_CONV_IN_WXSTRING from option to set with
    value 1
+3/-5     
CMakeLists.txt
Reorder CMake includes for proper wxWidgets initialization

CMakeLists.txt

  • Removed early include of cmake/options-wx.cmake
  • Added wxBINARY_DIR and wxOUTPUT_DIR variable definitions
  • Added includes for wxWidgets build cmake functions, options, and init
  • Moved cmake/options-wx.cmake include after wxWidgets cmake includes
  • Moved add_subdirectory(external) after toolkit.cmake include
+9/-3     
CMakeLists.txt
Move CXX standard setting and improve CMake formatting     

external/CMakeLists.txt

  • Added wxBUILD_CXX_STANDARD setting (moved from cmake/options-wx.cmake)
  • Removed wxBINARY_DIR and wxOUTPUT_DIR definitions (moved to
    CMakeLists.txt)
  • Removed include of wxWidgets/build/cmake/init.cmake
  • Reformatted if statement spacing for consistency
  • Improved formatting of add_custom_target commands with proper
    indentation
+15/-12 

@antonvw antonvw linked an issue Jan 24, 2026 that may be closed by this pull request
@qodo-code-review
Copy link

PR Compliance Guide 🔍

Below is a summary of compliance checks for this PR:

Security Compliance
🟢
No security concerns identified No security vulnerabilities detected by AI analysis. Human verification advised for critical code.
Ticket Compliance
🟡
🎫 #1168
🟢 Improve CMake options processing for the wxWidgets build (reorganize how/when wxWidgets
options are set and included).
Ensure wxBUILD_CXX_STANDARD is set in the appropriate location as part of the improved
options processing.
Reorder/include CMake modules in a way that matches the wxWidgets build sequence and
improves consistency/formatting.
Confirm the wxWidgets build still configures and compiles correctly across supported
platforms/toolkits after the include/order changes.
Confirm the change from option(wxUSE_STD_STRING_CONV_IN_WXSTRING ...) to
set(wxUSE_STD_STRING_CONV_IN_WXSTRING 1) preserves the intended configurability and
behavior in all build environments.
Codebase Duplication Compliance
Codebase context is not defined

Follow the guide to enable codebase context checks.

Custom Compliance
🟢
Generic: Comprehensive Audit Trails

Objective: To create a detailed and reliable record of critical system actions for security analysis
and compliance.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Meaningful Naming and Self-Documenting Code

Objective: Ensure all identifiers clearly express their purpose and intent, making code
self-documenting

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Robust Error Handling and Edge Case Management

Objective: Ensure comprehensive error handling that provides meaningful context and graceful
degradation

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Secure Error Handling

Objective: To prevent the leakage of sensitive system information through error messages while
providing sufficient detail for internal debugging.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Secure Logging Practices

Objective: To ensure logs are useful for debugging and auditing without exposing sensitive
information like PII, PHI, or cardholder data.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Security-First Input Validation and Data Handling

Objective: Ensure all data inputs are validated, sanitized, and handled securely to prevent
vulnerabilities

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Compliance status legend 🟢 - Fully Compliant
🟡 - Partial Compliant
🔴 - Not Compliant
⚪ - Requires Further Human Verification
🏷️ - Compliance label

@antonvw antonvw merged commit 51d9f22 into develop Jan 24, 2026
15 checks passed
@antonvw antonvw deleted the 1168-improve-cmake-options-processing branch January 24, 2026 13:29
@qodo-code-review
Copy link

PR Code Suggestions ✨

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Impact
Possible issue
Use correct variable for wxWidgets build directory

Use wxBUILD_DIR instead of wxBINARY_DIR to specify the wxWidgets build directory
and place it in a dedicated subdirectory to keep the build tree clean.

CMakeLists.txt [73-74]

-set(wxBINARY_DIR ${CMAKE_CURRENT_BINARY_DIR})
-set(wxOUTPUT_DIR ${wxBINARY_DIR}/lib)
+set(wxBUILD_DIR ${CMAKE_CURRENT_BINARY_DIR}/external/wxWidgets)
+set(wxOUTPUT_DIR ${wxBUILD_DIR}/lib)
  • Apply / Chat
Suggestion importance[1-10]: 7

__

Why: The suggestion correctly identifies that wxBUILD_DIR is the idiomatic variable to control the wxWidgets build location, preventing pollution of the root build directory and improving build hygiene.

Medium
General
Use standard boolean value for clarity

For consistency and readability, change the value of
wxUSE_STD_STRING_CONV_IN_WXSTRING from 1 to the standard CMake boolean ON.

cmake/options-wx.cmake [26]

-set(wxUSE_STD_STRING_CONV_IN_WXSTRING 1)
+set(wxUSE_STD_STRING_CONV_IN_WXSTRING ON)
  • Apply / Chat
Suggestion importance[1-10]: 3

__

Why: This is a valid stylistic suggestion that improves code readability and consistency by using the canonical ON for a boolean value in CMake, but it has no functional impact.

Low
  • More

@sonarqubecloud
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

improve cmake options processing

2 participants