I know very little about CMake but FWIW,
here is my simple CMakeFile for a small application using wxWidgets (tested only on MSW and Linux). It uses only core and base wxWidgets libraries, so if any more are needed they need to be added in this line (and minimal required version of wxWidgets can be adjusted here as well):
Code: Select all
find_package(wxWidgets 3.1.0 COMPONENTS core base REQUIRED)
The file obviously needs to be adapted, in particular your actual header and source files must be set in
statement. Other adjustments, such removing OpenCV libraries, changing the project name, etc must be done as well. Similarly, C++ standard needed can be changed. But all that should be very easy, considering the file is so short and its contents is quite self-descriptive.
If your application has its own resource file (it better does, if for just having an icon), change
Code: Select all
if (WIN32)
list(APPEND SOURCES "${wxWidgets_ROOT_DIR}/include/wx/msw/wx.rc")
endif()
to add your own resource file instead, which should in turn include wx.rc file.
As always, CMake must be able to find wxWidgets, so on MSW either WXWIN system environment variable or CMake variables wxWidgets_LIB_DIR and wxWidgets_ROOT_DIR must be set correctly.