Would be nice to have an msys2 project template that takes a list of /bin/pkg-config names to use to generate C and linker flags.
example:
click new project->msys2
STEP 1: Dialog box for selecting msys/mingw install
the following msys2 installs were detected:
C:/msys64/mingw32
C:/msys64/mingw64
STEP 2: Dialog box auto-detect if msys pkg-config installed.
does file C:/msys64/mingw32/bin/pkg-config exist?
if it does not run msys2 command:
pacman -S mingw-w64-i686-pkg-config
dialog can optionally list common msys2
programming library packages to install
with checkboxs: for example:
pacman -S mingw-w64-i686-gtkmm3 pacman -S mingw-w64-i686-gtk2 pacman -S mingw-w64-i686-gtk3 (pacman -Ss <search_string>)
STEP 3: Dialog box for msys "pkg-config --list-all"
(This part of dialog executes command
"C:/msys64/mingw32/bin/pkg-config --list-all"
and adds the output of the command to a scrollable checkbox list)
EXAMPLE: in the list the user see "gtkmm-3.0"
and he clicks on it because he wants to build
a gtkmm-3.0 C++ project.
STEP 4: now codeblock does the following automatically:
MENU: Settings->Compiler->Compiler Settings
-> Other Compiler Options
C:/msys64/mingw32/bin/pkg-config gtkmm-3.0 --cflags
MENU: Settings->Compiler->Linker Settings
-> Other Compiler Options
C:/msys64/mingw32/bin/pkg-config gtkmm-3.0 --libs
MENU: Settings->Compiler->Toolchain executables
->Compiler's installation directory
C:\msys64\mingw32\bin
=======================================================================
Incidently here's my msys setup for gtkmm-3.0/mingw-w64 enivironment that compiles under codeblocks:
MSYS2 Setup Script:
L="$L mingw-w64-i686-gcc"
L="$L mingw-w64-i686-gtkmm3"
L="$L mingw-w64-i686-pkg-config"
L="$L mingw-w64-i686-make"
L="$L mingw-w64-i686-glade"
L="$L mingw-w64-i686-tcl"
L="$L m3m perl p7zip tar diffutils vim msys/git"
for x in $L; do
yes | pacman -S $x
done
I think the above codeblocks msys2 template should run pkg-config like this to create files in the project directory:
And then invoke the gcc compiler like this during build:
GTK has too many compiler and linker flags... it really gets annoying when you invoke the compiler this way:
I would suggest that template follow above method of providing gcc options through a file using @ option for selected pkg-config's.
Here's a sniplet my makefile:
Last edit: W Sforge 2016-12-24
complete make with pkg-config
I just noticed that pkg-config is part of menu:
Projects->Properties->Libraries
Doesn't seem to work... but, that's what is needed
for an Msys2 icon under add new projects...
Some type of Dialog box for selecting libraries...
I wonder... why not add a template wizard for Makefile projects as well?
I had Msys2 template and Makefile template under create new project... its done... that's the only thing I would ever need...
A project wizard is a squirrel script file which is maintained by scriptedwizard plugin. You can create one for you need if you like.