Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6815135
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T20:46:15+00:00 2026-05-26T20:46:15+00:00

I am trying to determine if the version of wxWidgets found by CMake is

  • 0

I am trying to determine if the version of wxWidgets found by CMake is >= 2.9. I tried this:

find_package(wxWidgets 2.9 COMPONENTS core base REQUIRED)
if(wxWidgets_FOUND)
  message("wxWidgets found successfully.")
  include( ${wxWidgets_USE_FILE} )
else()
  message(FATAL_ERROR "wxWidgets was not found!")
endif()

if(wxWidgets_VERSION LESS 2.9)
  message(FATAL_ERROR "wxWidgets is not a high enough version!")
else()
  message("wxWidgets Version ${wxWidgets_VERSION}")
  message("wxWidgets Major version ${wxMAJOR_VERSION}")
  message("release number ${wxRELEASE_NUMBER}")
  message("check version ${wxCHECK_VERSION}")
  message("wxWidgets version ${WX_WIDGETS_VERSION}")
  message("wxWidgets major version ${WX_MAJOR_VERSION}")
  message("wxWidgets version string ${WX_VERSION_STRING}")
endif()

(My system has wx2.8, so this should fail).

The if(wxWidgets_FOUND) returns TRUE, so so far so good. However, the if(wxWidgets_VERSION LESS 2.9) fails, but it is not because wxWidgets_VERSION is < 2.9. It is because wxWidgets_VERSION is empty. In fact, the whole output is:

wxWidgets Version 
wxWidgets Major version 
release number 
check version 
wxWidgets version 
wxWidgets major version 
wxWidgets version string 

(i.e. all of the variables are empty)

Does anyone know the correct way to check for the wxWidgets version through CMake?

Thanks,

David

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T20:46:16+00:00Added an answer on May 26, 2026 at 8:46 pm

    Someone suggested a project named wxArt2d that has a bit better wxWidgets cmake. It is unfortunate that these things are not easier/better maintained 🙁

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Short version: I'm trying to determine the best way to track what the user
I am trying to determine if a phone is located in this polygon using
I'm trying to determine what version of the TWAIN specification I can write my
In this statement I am trying to match if a version ($var2) exist in
I'm trying to determine the version number of my Silverlight application. Currently I am
So I am trying to determine if this is a bug or browser caching
I'm trying to find out how I can determine the version of a .class
I am trying to determine the version of the .NET framework that a dll
I am trying to determine which version of a member function gets called based
My Google-fu is failing me. I'm trying to determine what version(s) of mobile WebKit

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.