Reduced development environment

Magick++ is an object-oriented C++ interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning Magick++.
Post Reply
bleriot13
Posts: 2
Joined: 2011-12-13T09:34:03-07:00
Authentication code: 8675308

Reduced development environment

Post by bleriot13 »

Hi,

I have just downloaded the last version of ImageMagick in source code version (6.7.4). I have built the DLLs using Visual C++ Express 2008 following the instructions given in the web.

I have also built de demo programs succesfully. This means that I have a development environment able to create applications using Magick++. Now, I would like that all developers in my company could use ImageMagick to develop their applications, but I would like to offer them a "reduced" environment, including only those files in the source distribution that are really needed.

I read the instructions concerning a "portable" installation and found, I think, all the information I need but the place to get the header files from.

I have checked one of the .vcproj projects created in the demo folders (the instructions say I must take a look to the .dsp's, but this is valid for former versions of Visual C++) in order to see how to configure a project on my own.

The section with the preprocessor directives is clear enough. However, the additional inclusion directories are confusing me.

Since I want to create a "slimmer" development environment including only those files that are really needed from the source distribution any developer wishing to create its own program will need:

The library (.lib) files included in the lib directory.
The dll files found in the bin directory.
The .xml files found in the bin directory (by the way, I couldn't find modules.xml!!!)
The .h / .hpp found... in many different places across the source distribution!!!

Checking one of the .vcproj files I mentioned above, I saw the following line:

Code: Select all

AdditionalIncludeDirectories="..\..\..,..\..\..\xlib,..\..\..\Magick++\lib,..\..\..\,..\..\..\magick,..\..\..\Magick++,..\..\..\Magick++\demo,..\..\..\Magick++\lib,..\..\..\Magick++\lib\Magick++,..\..\..\Magick++\tests"
This line, obviously, lists all the directories in the source distribution hierarchy where headers (.h / .hpp) must be sought.

In my "streamlined" development environment I would like to create a single directory, let's say "magick_include" where I would copy as many directories as necessary from those listed above. The questions, then, are:

- Which ones of these folders do I really need? For instance, do I need "..\..\..\Magick++\demo"?
- Assuming that the list of required folders is known, I guess that it is possible to create a folder hierarchy like the one below:

+magick_include
+ required_folder_1
+ required_folder_2
+ ...
+ required_folder_N

and then use Visual C++ to define each of these folders as a place to look for header files (in "Project directories").

Thank you very much for your help!
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Reduced development environment

Post by magick »

You would certainly want to keep the Magick++ folder if you're using the Magick++ API but the demos could go. If you just want to use the MagickCore C API you could remove the MagickWand and Magick++ folders. You can remove any of the delegate libraries you don't need support for-- support you don't need PNG, remove the entire folder. You could remove the documentation. And you could remove any coders you don't need. Don't need WMF support, remove coders/wmf.c.
bleriot13
Posts: 2
Joined: 2011-12-13T09:34:03-07:00
Authentication code: 8675308

Re: Reduced development environment

Post by bleriot13 »

Thank you for your comments.

It looks like I have been able to create a streamlined copy of ImageMagick, so it is possible to develop without problems.

I will explain what I did (just in case there's some other people interested) and then I will ask you some more questions.

The idea is to create a much slimmer copy of the ImageMagick source code distribution so it is possible to develop our own applications.

So the first thing to do is to create a parallel folder structure to keep the minimal set of files to use.

I have created the following structure:

Code: Select all

My_ImageMagick_root_folder
  bin (1)
  lib (2)
  include (3)
    magick (4)
    Magick++ (5)
      bin (6)
      lib (7)
        Magick++ (8)
    wand (9)
    xlib (10)
These directories have been extracted from the original source code distribution as follows:

(1) bin -> ImageMagick-6.7.4\VisualMagick\bin
(2) lib -> ImageMagick-6.7.4\VisualMagick\lib
(3) include - I created this folder to keep all the subfolders holding header files under the same hood. You won't find it in the original distribution.
(4) magick -> ImageMagick-6.7.4\magick
(5) Magick++ (and all its subfolders, that is, (6, 7, 8 )) -> ImageMagick-6.7.4\Magick++
(9) wand -> ImageMagick-6.7.4\wand
(10) xlib -> ImageMagick-6.7.4\xlib

where "ImageMagick-6.7.4" is the rooot directory where I extracted the .zip file with the source code.

Note also that in the case of the Magick++ (5) folder, I removed some subfolders, since you commented this in your former answer: demo, doc, tests.

Then I put the path to (1) -bin- in may PATH environment variable.
I inserted lib (2) , the path to libraries, in the list of directories (libraries section) to look for in the Visual C++ 2008 Express environment.
I inserted the paths to (3, 4, 5, 7, 8, 9, 10) in the list of directories (header files section) to look for in VC++.

Then I could compile and link a couple of programs made by myself. Both worked nicely.

Then, a few questions:

- May I delete de bin folder tagged as (6)? There seems to be no header files inside.
- For every folder included in "include" (tags 3 to 9). There are many kinds of files in these folders. I guess, but I'm only guessing, that every file but those with a .h or .hpp extension could be deleted. Is this true? The idea is that we only need the header files, not the source (.c, .cpp) or others since these folders keep the "inclusion" files only.
- May I delete the .pdb files found in the bin (1) folder? These use a rather big chunk of my disk. BTW, I have compiled ImageMagick in Release mode (just in case it helps).
- May I delete the .exp files found in the lib (2) folder? Again, this is related to disk space.

Well, that's all (at least, by the moment).

THANK YOU VERY MUCH!
Post Reply