Re: [Podofo-users] Windows build on Podofo 0.9.5

2018-07-20 Thread Patrice Guérin

Hello Matthew and zyx,

Sorry for the delay, I was called on another project until now.

If I've used $(EXTERN_DEV), it's because it's the way VS projects use 
macros.


I've tried many solutions like :

   set( EXTERN_DEV "$ENV{EXTERN_DEV}")

and use ${EXTERN_DEV} in the definitions of paths.
This case throws messages about policy CMP0019.
Even, if I set this policy OLD, variables are evaluated but prepended  
with the project path resulting as :

h:/src/podofo0.9.5/k:\extern_dev/zlib.1.2.11/include
So it doesn't work...

I found that CMake handles differently paths in INCLUDE_DIRECTORY and 
Path to files like libraries


 * Paths to libraries are left untouched
 * Include directories that are absolute paths are left untouched and
   others (including those that begin with variables) are handled as
   relative paths.

I've found a way to handle this situation

 * I've created a symbolic link in the podofo root directory that
   refers EXTERN_DEV (mklink /d extern_dev %EXTERN_DEV%)
 * I've changed $(EXTERN_DEV) to extern_dev in each directory path to
   includes.
 * I've left $(EXTERN_DEV) in library paths. Link step fails if they
   are changed...
 * For install directory, $ENV{EXTERN_DEV}/podofo works

It's a bit complicated but works... In the case of moving the EXTERN_DEV 
directory elsewhere, I've just have to modifiy my environment variable 
and the windows symbolic link.
I've just to correct compilation errors in podofosign on Windows I 
don't understand why Linux doesn't have the same problem...


Thank you to all for your help.
Kind regards,
Patrice.

zyx a écrit :

On 13.7.2018 at 10:48 Patrice Guérin wrote:

ZLIB_INCLUDE_DIR=$(EXTERN_DEV)/zlib/1.2.11/include


Hi,
while Linux shell uses '$' to mark a variable for expansion, Windows 
uses '%' instead. If you've the cmake command part of some .bat file,

then something like:

  cmake -G "..." -DZLIB_INCLUDE_DIR=%EXTERN_DEV%/zlib/1.2.11/include ...

should do the trick. I mean, if you want the shell (command line) to 
expand the variable.

Bye,
zyx

-- 


Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Podofo-users mailing list
Podofo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/podofo-users


--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Podofo-users mailing list
Podofo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/podofo-users


Re: [Podofo-users] Windows build on Podofo 0.9.5

2018-07-13 Thread Matthew Brincke
Hello Patrice, hello all,
> On 13 July 2018 at 10:48 Patrice Guérin  wrote: 
>  
>  Hello, 
>  
>  My name is Patrice and I'm new with Podofo. 
>  I was able to build Podofo 0.9.5 on Linux Debian 7 without problem but it's 
> a little bit more complicated on Windows with Visual Studio 2013. 
>  I've build the dependent libraries (jpeg9c, png1634, tiff 4.0.9, freetype 
> 2.9, zlib 1.2.11) without any major problem. 
>  The libraries includes and libs are all stored in a 'root' directory which 
> is accessed through an environment variable EXTERN_DEV ; the resulting 
> architecture is (I just show zlib 
> 
> > EXTERN_DEV (k:/extern_dev actually but can be changed) 
> >    |- zlib 
> >   |- 1.2.11 
> >      |- include 
> >      |- lib
> Podofo reside on a different disk and directory than dependent libraries. 
>  When creating the cmake project targetting Visual Studio 2013, I've  filled 
> the required paths to include and library in this way 
> 
> >  ZLIB_INCLUDE_DIR=$(EXTERN_DEV)/zlib/1.2.11/include 
> >  ZLIB_LIBRARY_DEBUG=$(EXTERN_DEV)/zlib/1.2.11/lib/zdll.lib 
> >  ZLIB_LIBRARY_RELEASE=$(EXTERN_DEV)/zlib/1.2.11/lib/zdll.lib 
> >  ...

I'm no expert in cmake, but IIRC environment variables are accessed as 
$ENV{NAME_OF_VARIABLE}, so in
your case $ENV{EXTERN_DEV}.
> The configuration process find all the dependencies expressed with 
> $(EXTERN_DEV) but the generation process prepends each include directories 
> with the Podofo source code path, so include files are not found : 
> 

It may also help to declare the cmake variables with their type FILEPATH: e.g. 
for the first one:
ZLIB_INCLUDE_DIR:FILEPATH=$ENV{EXTERN_DEV}

> > H:\Src\podofo-0.9.5\build\vs2013; 
> >  H:\Src\podofo-0.9.5; 
> >  H:\Src\podofo-0.9.5\$(EXTERN_DEV)\libjpeg\9c\include; 
> >  H:\Src\podofo-0.9.5\$(EXTERN_DEV)\libtiff\4.0.9\include; 
> >  H:\Src\podofo-0.9.5\$(EXTERN_DEV)\libpng\1.6.34\include; 
> >  H:\Src\podofo-0.9.5\$(EXTERN_DEV)\zlib\1.2.11\include; 
> >  H:\Src\podofo-0.9.5\src; 
> >  H:\Src\podofo-0.9.5\$(EXTERN_DEV)\freetype\2.9\include\config; 
> >  H:\Src\podofo-0.9.5\$(EXTERN_DEV)\freetype\2.9\include; 
> >  H:\Src\podofo-0.9.5\vcincludes; 
> >  %(AdditionalIncludeDirectories)
> The library files used for linking are expressed correctly.

It looks like as if the environment variable wasn't expanded in these paths.
If my guesses above don't help, I recommend looking for a CMake function
which explicitly resolves file paths to absolute path form (to call where
ZLIB_INCLUDE_DIR etc. are defined). Then even CMake functionality which
doesn't resolve environment variables should handle them correctly.
>  
>  Is there a way to correct this without modifying the VS solution by hand ? 

With my suggestions (I haven't tested them, I don't use Windows, sorry) it
should only be necessary to have CMake automatically generate the VS solution
again after a change of the environment variable.

>  
>  Thank you in advance 
>  Kind regards, 
>  Patrice.

I hope my suggestions help you.

Best regards, Matthew

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Podofo-users mailing list
Podofo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/podofo-users


Re: [Podofo-users] Windows build on Podofo 0.9.5

2018-07-13 Thread Patrice Guérin

Hello Dmitry,

It's the way I do, except that all the dependent library paths are 
expressed relative to the environment variable not with absolute paths.
In the case of moving libraries elsewhere, I've just to change the env 
variable and re-generate the VS solution.
In the case of absolute paths, I've to modify at least 12 (+9 if using 
SSL/idn) paths before re-generating the VS solution.


Kind regards,
Patrice.

Dmitry Salychev a écrit :

Hello, Patrice.

Your configuration seems a bit complicated to me. Why not to specify all
of the required paths using CMake GUI and generate a VS project?

Regards,
Dmitry




--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Podofo-users mailing list
Podofo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/podofo-users


Re: [Podofo-users] Windows build on Podofo 0.9.5

2018-07-13 Thread Dmitry Salychev
Hello, Patrice.

Your configuration seems a bit complicated to me. Why not to specify all
of the required paths using CMake GUI and generate a VS project?

Regards,
Dmitry

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Podofo-users mailing list
Podofo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/podofo-users