CLion & MSYS2 - missing wxWidgets_LIBRARIES

Hi There,

I have been successfully building KiCad from source under Linux and wanted to now build KiCad under windows using MSYS2 & CLion. I followed this guide here: https://dev-docs.kicad.org/en/build/windows-msys2/

When compiling using the MSYS2 console everything compiles just fine. However, as soon as I try to use CLion, CMAKE throws errors. I attached the console output.

C:\msys64\mingw64\bin\cmake.exe -DCMAKE_BUILD_TYPE=Debug -G β€œMinGW Makefiles” -DCMAKE_PREFIX_PATH=/mingw64 -DCMAKE_INSTALL_PREFIX=/mingw64 -DDEFAULT_INSTALL_PATH=/mingw64 …/…/ C:\msys64\home\andre\kicad-source
– The C compiler identification is GNU 10.2.0
– The CXX compiler identification is GNU 10.2.0
– Detecting C compiler ABI info
– Detecting C compiler ABI info - done
– Check for working C compiler: C:/msys64/mingw64/bin/gcc.exe - skipped
– Detecting C compile features
– Detecting C compile features - done
– Detecting CXX compiler ABI info
– Detecting CXX compiler ABI info - done
– Check for working CXX compiler: C:/msys64/mingw64/bin/g++.exe - skipped
– Detecting CXX compile features
– Detecting CXX compile features - done
– KiCad install dir:
– Looking for strtok_r
– Looking for strtok_r - found
– Looking for malloc
– Looking for malloc - found
– Looking for math.h
– Looking for math.h - found
– Looking for C++ include cmath
– Looking for C++ include cmath - found
– Looking for asinh
– Looking for asinh - found
– Looking for acosh
– Looking for acosh - found
– Looking for atanh
– Looking for atanh - found
– Performing Test HAVE_CMATH_ISINF
– Performing Test HAVE_CMATH_ISINF - Success
– Looking for clock_gettime in rt
– Looking for clock_gettime in rt - not found
– Looking for gettimeofday
– Looking for gettimeofday - found
– Looking for getc_unlocked
– Looking for getc_unlocked - not found
– Performing Test COMPILER_SUPPORTS_WSUGGEST_OVERRIDE
– Performing Test COMPILER_SUPPORTS_WSUGGEST_OVERRIDE - Success
– Enabling warning -Wsuggest-override
– Performing Test COMPILER_SUPPORTS_WINCONSISTENT_MISSING_OVERRIDE
– Performing Test COMPILER_SUPPORTS_WINCONSISTENT_MISSING_OVERRIDE - Failed
– Performing Test COMPILER_SUPPORTS_WDUPLICATED_BRANCHES
– Performing Test COMPILER_SUPPORTS_WDUPLICATED_BRANCHES - Success
– Enabling warning -Wduplicated-branches
– Performing Test COMPILER_SUPPORTS_WDUPLICATED_COND
– Performing Test COMPILER_SUPPORTS_WDUPLICATED_COND - Success
– Enabling warning -Wduplicated-cond
– Performing Test COMPILER_SUPPORTS_WVLA
– Performing Test COMPILER_SUPPORTS_WVLA - Success
– Enabling error for -Wvla
– Performing Test COMPILER_SUPPORTS_WIMPLICIT_FALLTHROUGH
– Performing Test COMPILER_SUPPORTS_WIMPLICIT_FALLTHROUGH - Success
– Enabling warning -Wimplicit-fallthrough
– Performing Test COMPILER_SUPPORTS_WRETURN_TYPE
– Performing Test COMPILER_SUPPORTS_WRETURN_TYPE - Success
– Enabling error for -Wreturn-type
– Performing Test COMPILER_SUPPORTS_WSHADOW
– Performing Test COMPILER_SUPPORTS_WSHADOW - Success
– Enabling warning -Wshadow
– Performing Test COMPILER_SUPPORTS_WSIGN
– Performing Test COMPILER_SUPPORTS_WSIGN - Success
– Enabling warning -Wsign-compare
– Performing Test COMPILER_SUPPORTS_WMISSING_INIT
– Performing Test COMPILER_SUPPORTS_WMISSING_INIT - Success
– Enabling warning -Wmissing-field-initializers
– Performing Test COMPILER_SUPPORTS_WEMPTY_BODY
– Performing Test COMPILER_SUPPORTS_WEMPTY_BODY - Success
– Enabling warning -Wempty-body
– Performing Test COMPILER_SUPPORTS_WREORDER
– Performing Test COMPILER_SUPPORTS_WREORDER - Success
– Enabling warning -Wreorder
– Performing Test COMPILER_SUPPORTS_WMISMATCHED_TAGS
– Performing Test COMPILER_SUPPORTS_WMISMATCHED_TAGS - Success
– Enabling warning -Wmismatched-tags
– Performing Test COMPILER_SUPPORTS_WIMPLICIT_FLOAT_CONVERSION
– Performing Test COMPILER_SUPPORTS_WIMPLICIT_FLOAT_CONVERSION - Failed
– Performing Test COMPILER_SUPPORTS_WPSABI
– Performing Test COMPILER_SUPPORTS_WPSABI - Success
– Disabling warning -Wpsabi
– Found OpenGL: opengl32
– Found GLEW: C:/msys64/mingw64/include
– Check for installed GLEW – found
– Found GLM: C:/msys64/mingw64/include (found suitable version β€œ0.9.9.8”, minimum required is β€œ0.9.8”)
– Found ZLIB: C:/msys64/mingw64/lib/libz.dll.a (found version β€œ1.2.11”)
– Check for installed ZLIB – found
– Found CURL: C:/msys64/mingw64/lib/libcurl.dll.a (found version β€œ7.75.0”)
– Found PkgConfig: C:/msys64/mingw64/bin/pkg-config.exe (found version β€œ1.7.3”)
– Checking for module β€˜cairo’
– Found cairo, version 1.17.4
– Found Cairo: C:/msys64/mingw64/lib/libcairo.dll.a (found suitable version β€œ1.17.4”, minimum required is β€œ1.12”)
– Checking for module β€˜pixman-1’
– Found pixman-1, version 0.40.0
– Found Pixman: C:/msys64/mingw64/lib/libpixman-1.dll.a (found suitable version β€œ0.40.0”, minimum required is β€œ0.30”)
– Found Boost: C:/msys64/mingw64/include (found suitable version β€œ1.75.0”, minimum required is β€œ1.59.0”)
– Checking for module β€˜ngspice’
– Found ngspice, version 34
– Found ngspice: C:/msys64/mingw64/include
– Found SWIG: C:/msys64/mingw64/bin/swig.exe (found suitable version β€œ4.0.2”, minimum required is β€œ3.0”)
– Found PythonInterp: C:/msys64/mingw64/bin/python2.exe (found suitable version β€œ2.7.18”, minimum required is β€œ2.6”)
– Check for installed Python Interpreter – found
– Python module install path: lib/python2.7/site-packages
– Found PythonLibs: C:/msys64/mingw64/lib/libpython2.7.dll.a (found suitable version β€œ2.7.18”, minimum required is β€œ2.6”)
C:\msys64\mingw64\lib\python2.7\site-packages\wx-3.0-msw/wx/_core.py:16633: UserWarning: wxPython/wxWidgets release number mismatch
warnings.warn(β€œwxPython/wxWidgets release number mismatch”)
– Found wxPython 3.0.2.0/msw (wxWidgets 3.0.2.0)
CMake Error at C:/msys64/mingw64/share/cmake-3.20/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
Could NOT find wxWidgets (missing: wxWidgets_LIBRARIES
wxWidgets_INCLUDE_DIRS) (Required is at least version β€œ3.0.2.0”)
Call Stack (most recent call first):
C:/msys64/mingw64/share/cmake-3.20/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE)
CMakeModules/FindwxWidgets.cmake:1019 (find_package_handle_standard_args)
CMakeLists.txt:920 (find_package)

– Configuring incomplete, errors occurred!
See also β€œC:/msys64/home/andre/kicad-source/CMakeFiles/CMakeOutput.log”.
See also β€œC:/msys64/home/andre/kicad-source/CMakeFiles/CMakeError.log”.

[Finished]

Add following defines on command line
-DMSYS=TRUE -DMINGW=TRUE -DCYGWIN=TRUE

I added those to my CMake options but still the same problem.

C:\msys64\mingw64\bin\cmake.exe -DCMAKE_BUILD_TYPE=Debug -G β€œMinGW Makefiles” -DCMAKE_PREFIX_PATH=/mingw64 -DCMAKE_INSTALL_PREFIX=/mingw64 -DDEFAULT_INSTALL_PATH=/mingw64 -DMSYS=TRUE -DMINGW=TRUE -DCYGWIN=TRUE C:\msys64\home\andre\kicad-source

Did you clear cmake cache?

Yes, I did that. I am not too sure why CLion causes so much trouble.

Issue is not CLion, it’s that msys shell is different environment.

I noticed you have paths like /mingw64 which are not understood by clion or any shell outside of msys, that may be the problem

Here is my vscode settings for when I used msys build. I had msys installed in d:/devtools so change accordingly

    "cmake.configureSettings": {
        "MSYS": "TRUE",
        "MINGW": "TRUE",
        "CYGWIN": "TRUE",
        "Boost_NO_BOOST_CMAKE": "ON",
    },
    "cmake.configureEnvironment": {
        "PATH": "D:/devtools/msys64/usr/bin;D:/devtools/msys64/mingw64/bin;D:/devtools/msys64/mingw64/x86_64-w64-mingw32/bin;%PATH%",
    },
    "cmake.buildEnvironment": {
        "PATH": "C:/Windows/system32;D:/devtools/msys64/usr/bin;D:/devtools/msys64/mingw64/bin;D:/devtools/msys64/mingw64/x86_64-w64-mingw32/bin;%PATH%",
    },
    "cmake.configureArgs": [
        "-DCMAKE_PREFIX_PATH=D:/devtools/msys64/mingw64/;D:/devtools/msys64/mingw64/x86_64-w64-mingw32/",
        "-GNinja"
    ],
    "cmake.generator": "Ninja",
1 Like

Thanks for that, I’ll give it a go and see how I go.

That’s solved it for me! Thanks mate!

1 Like

BTW, the msvc build will be the official build for 6.0. You may want to try that instead of msys.

That’s alright. At the moment I just wanted to test a warehouse plugin I am currently building to assign parameters to a part or multiple parts from an external source.