1
\$\begingroup\$

I am trying to install PhysicsFS (icculus.org/physfs/) on my Win 7 with MinGW. But I am having hard time doing it. I googled it as well but still nothing - I have used linux environment and make toolchain before (not CMake though) - but I guess I am a bit rusty.

I tried following all the directions in INSTALL.txt and google - but here is what I managed till now.

I have MinGW installed and manually installed CMake as well. Now I download the src from the site and do cmake -G "MinGW MakeFiles

enter image description here The next this is what bemused me - Well I haven't encountered it before - I do make and expect it to make the files but instead it goes into Windows Command Prompt. And then I am lost.

enter image description here

PART 2 -

I am fairly new MinGW - I was wondering if I want to develop do I compile from source or just install the developing package - as I understand compiling from source would give me both ( dev packages as well as binaries/static libs), right? Please correct me if I am wrong.

\$\endgroup\$

2 Answers 2

1
\$\begingroup\$

I recently needed to compile libRocket for MinGW and now I clearly see your problem. It is obvious; I was staring right at the beast and did not see it.

When working with CMake and MinGW you have tow options:

The Windows Way

In this case you can use cmakegui directly without restrictions. You select the folder to generate and select "Mingw Makefiles" as version. Don't forget to specify the make location. If you are invoking cmake from the command line (cmd.exe):

cmake -G "MinGW Makefiles" -D CMAKE_MAKE_PROGRAM="C:\MinGW\bin\mingw32-make.exe" ..\PhyisFS

This will create makefile for use with MinGW under cmd, not bash. It will create an install target that (if your project has one) that installs under C:\Program Files\.

The Unix Way

In this case you can not use cmakegui, since it will not find the prerequisite tools. (Maybe if you call cmakegui from MinGW's bash, it may work. But I have not tried.) In this case you create "Unix Makefiles", like so:

cmake -G "Unix Files" ../PhyisFS

This will create makefile for use under MinGW's bash. Any install target will install under "/usr/local" (or whatever you tell it with $prefix). This assumes a full "unix" environment and MSys provides it. So don't forget to install MSys and the MSys development tools.

\$\endgroup\$
12
  • \$\begingroup\$ I AM using MinGW. can I use cmakegui? I dont think so. \$\endgroup\$
    – Amit Ahire
    Commented Apr 30, 2013 at 9:10
  • \$\begingroup\$ Why not? You are on Windows7, where you have a completely visual environment, why should you not use cmakegui? cmakegui will generate the makefiles and then you can call make from within cmd (or MSys). \$\endgroup\$
    – rioki
    Commented Apr 30, 2013 at 11:20
  • \$\begingroup\$ OH! Yes I could use gui. Thanks. But wait I have some problem with the gui ( environmental variables) - Will get back to you after a while. \$\endgroup\$
    – Amit Ahire
    Commented Apr 30, 2013 at 11:36
  • \$\begingroup\$ If the cmake's bin directory is in the path you can invoke cmakegui from the command line. For cmd that would be: SET PATH=%PATH%;c:\<cmakedir>\bin and on bash (MSys) PATH=$PATH;/c/<cmakedir>/bin Then you can use any predefined env variables. You may also write a small *.bat or *.sh script. \$\endgroup\$
    – rioki
    Commented Apr 30, 2013 at 11:40
  • \$\begingroup\$ Thanks. I fixed all the variable ( have cygwin installed as well) and managed to get it to configure and generate the Makefile. But still I am confused as to - when I do make - Mingw shell changes into Cmd shell and I dont know where to go from there. (make or make install doesnt work in cmd shell) i1268.photobucket.com/albums/jj568/amitahire/… \$\endgroup\$
    – Amit Ahire
    Commented May 1, 2013 at 8:48
0
\$\begingroup\$

I finally managed to get it installed. I will list out the things you need to do and proceed further.

As @rioki advised me - I used the cmake-gui to configure and generate the appropriate files.

First make sure that you are making the right kind of file. There are many options available. In my case I was trying to install PhysicsFS in MinGW and I had to learn the hard way that you should make files for MSYS file system.

Howto1

And then use ( in my case I had different compilers) - Specify Native Compiler

howto2

Then when you finish. If there are any errors in the configuration process the cmake gui will help with it and you can use the gui to specify the path to correct location.

howto3

If everything is correct - (No red flags) - Then press "Generate"

howto4

Then you can go into the shell window and go ahead with the compilation process.

\$\endgroup\$
1
  • \$\begingroup\$ linked image is down, please update it. \$\endgroup\$
    – dns
    Commented Apr 29, 2018 at 0:23

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .