AW: CLion or CLion Nova on macOS

Stefan Csomor <[email protected]>
Newsgroups gmane.comp.lib.wxwindows.general
Message-ID <GV0P278MB024392B0E0B4FBCCFF20A55CDDB4A@GV0P278MB0243.CHEP278.PROD.OUTLOOK.COM>
Hi Giles 

Thank you very much. I’ve followed the guide from that post, made several attempts, but always ended up missing some files. 

I’ve done a full checkout of master (not using a download zip but I hope this shouldn’t matter. ..), built as indicated in the forum post in a directory beside this 

(is it correct that I don’t need to indicate anything referring to CMake ?) 

I’ve set CMAKE_PREFIX_PATH to this build dir, added the few dirs settings from your sample, and still it complains about 

CMake Error at CMakeLists.txt:40 (find_package): 
Could not find a package configuration file provided by "wxWidgets" 
(requested version 3.3) with any of the following names: 

wxWidgetsConfig.cmake 
wxwidgets-config.cmake 

Add the installation prefix of "wxWidgets" to CMAKE_PREFIX_PATH or set 
"wxWidgets_DIR" to a directory containing one of the above files. If 
"wxWidgets" provides a separate development package or SDK, be sure it has 
been installed. 

And IMHO this error is correct, there is no wxWidgets…...cmake anywhere in sight in my build dir … 

Thanks for any pointers … 

Stefan 

PS: I just did the same with a 3.2.4 download, same problem … 


Von: [email protected] <[email protected]> im Auftrag von Giles Forster <[email protected]>
Datum: Sonntag, 19. November 2023 um 11:02
An: wx-users <[email protected]>
Betreff: Re: CLion or CLion Nova on macOS 

This is the best guide and following this worked for me in about 5 minutes: 


https://forums.wxwidgets.org/viewtopic.php?p=197038#p187276 



The two things to note are 



* you need to define CMAKE_PREFIX_PATH 

* or use the CMake module for WX: https://cmake.org/cmake/help/latest/module/FindwxWidgets.html 



Then it all works. 



Looks something like: 



cmake_minimum_required(VERSION 3.21)
project(wx_first)

set(CMAKE_CXX_STANDARD 17)

set(wxWidgets_ROOT_DIR /Users/bob/Code/wx/wxWidgets-3.2.2.1)
set(wxWidgets_LIBRARIES /Users/bob/Code/wx/wxWidgets-3.2.2.1/build-release/lib)
set(wxWidgets_INCLUDE_DIRS /Users/bob/Code/wx/wxWidgets-3.2.2.1/include)

#
# Remember to add:
# CMAKE_PREFIX_PATH=/Users/bob/Code/wx/wxWidgets-3.2.2.1/build-release
#
# This is in CLion -> Preferences -> Build, Execution, Deployment -> CMake -> Environment

find_package(wxWidgets REQUIRED)
message(STATUS "wxWidgets library:")

# Include the wxWidgets use file to initialize various settings
include(${wxWidgets_USE_FILE})

include(${wxWidgets_USE_FILE})

if(WIN32)
# Include a RC file for windows
list(APPEND SRC_FILES ../sample.rc)
elseif(APPLE)
# Add an icon for the apple .app file
list(APPEND SRC_FILES ../../src/osx/carbon/wxmac.icns)
endif()

# Define the build target for the executable
#add_executable(${PROJECT_NAME} WIN32 MACOSX_BUNDLE ${SRC_FILES})
# Link required libraries to the executable
#target_link_libraries(${PROJECT_NAME} ${wxWidgets_LIBRARIES})

link_libraries(${wxWidgets_LIBRARIES})
add_executable(wx_mysample main.cpp hello.cpp menu.cpp menu.h record_dialog.cpp thread.cpp thread.h)

if(APPLE)
set_target_properties(${PROJECT_NAME} PROPERTIES
RESOURCE "../../src/osx/carbon/wxmac.icns"
MACOSX_BUNDLE_ICON_FILE wxmac.icns
MACOSX_BUNDLE_COPYRIGHT "Copyright wxWidgets"
MACOSX_BUNDLE_GUI_IDENTIFIER "org.wxwidgets.minimal"
)
endif() 




And setup Settings->Build, Execution , Deployment, CMake -> Environment with your WX build, for example: 



CMAKE_PREFIX_PATH=/Users/bob/Code/wx/wxWidgets-3.2.2.1/build-release 



Giles 



On Saturday, 18 November 2023 at 08:17:45 UTC Stefan Csomor wrote: 

Hi 

I’d like to test some things with Qodana but I get stuck with the CLion IDE when used with wx, does anyone have experience with the current CLion version used with the current wx master. 

I’d be grateful for any pointers … 

Thanks, 

Stefan 



-- 
Please read https://www.wxwidgets.org/support/mlhowto.htm <https://www.wxwidgets.org/support/mlhowto.htm> before posting.
--- 
You received this message because you are subscribed to the Google Groups "wx-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected] <mailto:[email protected]>.
To view this discussion on the web visit https://groups.google.com/d/msgid/wx-users/0c1681d7-671c-44e6-912f-9a27792d6b9fn%40googlegroups.com <https://groups.google.com/d/msgid/wx-users/0c1681d7-671c-44e6-912f-9a27792d6b9fn%40googlegroups.com?utm_medium=email&amp;utm_source=footer>. 



-- 
Please read https://www.wxwidgets.org/support/mlhowto.htm before posting.
--- 
You received this message because you are subscribed to the Google Groups "wx-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/wx-users/GV0P278MB024392B0E0B4FBCCFF20A55CDDB4A%40GV0P278MB0243.CHEP278.PROD.OUTLOOK.COM.
smime.p7s (application/x-pkcs7-signature, 10.9 KB) - not displayed
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.