wswatson / freetype-gl

Automatically exported from code.google.com/p/freetype-gl
Other
0 stars 0 forks source link

Ease the build for Windows Visual Studio #6

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
1. I put all the 3rd libraries and headers in a directory named "dependence", 
and a cmake file that set all the path variable such as 
FREETYPE_INCLUDE_DIR_ft2build etc.  Then I modified the CMakeLists to try to 
include the settings. That may help to ease the work to compile under Windows 
Visual Studio.
2. I add two files : platform.h/.c to handle some platform specific issues
3. I make a few modifications to the source for compatible problems under 
Windows Visual Studio.

The changes are based on r108 from the SVN repository and packed in the 
attached files.

Original issue reported on code.google.com by wangyong...@gmail.com on 26 Jan 2012 at 9:05

Attachments:

GoogleCodeExporter commented 9 years ago
For Windows VS user, the dependence directory could be an optional download and 
be updated along with freetype-gl. 

I hope it may help :-) 

Original comment by wangyong...@gmail.com on 26 Jan 2012 at 9:10

GoogleCodeExporter commented 9 years ago

Thanks for the patch.
I'm not familiar at all with windows. Is this the usual way of doing things ?

Also, could you update the CMakeLists.txt to include latest demos ?

At this point, do we need some kind of "HOWTO" to explain compilation for 
windows or is it straightforward using visual studio ?

Nicolas

Original comment by Nicolas.Rougier@gmail.com on 6 Feb 2012 at 7:19

GoogleCodeExporter commented 9 years ago
Unlike Linux, open source libraries are always not included in Windows. One 
must download them from Web one by one and you could put them in any 
directories (no convention about this). Tracing the updating is in a similar 
way. So the compiling options (such as including path, lib path, etc.) of 
Visual Studio solution vary with different users.  It's bad.

So I prefer to pack anything needed together to make the project stand alone. 
Use  relative path in compiling options. Then you could copy the whole project 
directory to any machine and make it work without any changes.  Additional 
benefit is that, your project always work with a certain version of 3rd 
libraries. It prevent some compatible problems (e.g. freetype-gl may work with 
freetype v247, but one downloads freetype v248, it may cause problems  ). Many 
commercial or open source SDKs and game engines for Windows are organized in 
similar manner.

The attached file include a dependence directory which contain the needed 3rd 
libs for Windows, and a few source files that are modified for compatible 
problems with Window (run differ to look at the changes). A modified 
CMakeLists.txt is included, too. For Windows users:
1. Unzip them to freetype-gl directory and override the original ones.
2. Create a directory name "build"
3. In command line, execute:
        cd build
        cmake ../CMakeLists.txt
4. Open the generated VS solution file and build it. 
If nothing goes wrong, freetype-gl lib and most demos should be built 
successfully. 

Original comment by wangyong...@gmail.com on 9 Feb 2012 at 6:02

GoogleCodeExporter commented 9 years ago
I start integrating your proposal but I have a problem with platform.h that 
test for the definiton of "HAVE_STDINT_H" that is not defined with the regular 
make. If this is specific to VS, isn't it a specific define for VS ?

Original comment by Nicolas.Rougier@gmail.com on 15 Feb 2012 at 10:20

GoogleCodeExporter commented 9 years ago
Done !
Also, I cleaned up the CMakeLists.txt, hope I did not break anything.

Original comment by Nicolas.Rougier@gmail.com on 15 Feb 2012 at 5:20