Passing FreeImage to cmake

Discussion and help for Compilation problems and platform portability.

Moderator: coordinators

Passing FreeImage to cmake

Postby fanou » Tue Jun 19, 2012 9:14 am

hi,

I'm trying to compile Lux v0.9 on SLES11 (Suse Linux Enterprise Server 11) SP1.
FreeImage is not available and I compiled it from sources.

But cmake cannot find it. I tried to declare FREEIMAGE_INCLUDE_PATH and FREEIMAGE_LIBRARY, but I still get the following message :

package 'freeimage' not found

How can I tell cmake where is my FreeImage library ?

Thanks
fanou
Developer
 
Posts: 69
Joined: Fri Feb 15, 2008 7:09 pm
Location: France

Re: Passing FreeImage to cmake

Postby Lord Crc » Tue Jun 19, 2012 9:31 am

On windows I simply do
Code: Select all
SET(FREEIMAGE_ROOT            "${DEPS_ROOT}/FreeImage3141/FreeImage")

where "DEPS_ROOT" is my own variable of where my dependencies are.
May contain traces of nuts.
User avatar
Lord Crc
Developer
 
Posts: 4518
Joined: Sat Nov 17, 2007 2:10 pm

Re: Passing FreeImage to cmake

Postby fanou » Tue Jun 19, 2012 11:30 am

Thanks.

Code: Select all
FREEIMAGE_ROOT
seems to be used only for Windows.
But I used your tip and set :
Code: Select all
SET(FreeImage_INCLUDE_DIR "${LUX_BUILD}/FreeImage/Dist")
SET(FreeImage_LIBRARY_DBG "${LUX_BUILD}/FreeImage/Dist")
SET(FreeImage_LIBRARY_REL "${LUX_BUILD}/FreeImage/Dist")


Building on RHEL or SLES is long as most of lux dependencies are not available, or too old.
For example, boost is installed with 1.36.0 only. I recompiled with 1.46.1.
fanou
Developer
 
Posts: 69
Joined: Fri Feb 15, 2008 7:09 pm
Location: France

Re: Passing FreeImage to cmake

Postby jeanphi » Tue Jun 19, 2012 2:10 pm

Hi,

There's nothing Windows specific in the FreeImage detection, so FREEIMAGE_ROOT should work on any platform.

Jeanphi
jeanphi
Developer
 
Posts: 6624
Joined: Mon Jan 14, 2008 7:21 am

Re: Passing FreeImage to cmake

Postby fanou » Wed Jun 20, 2012 10:49 am

Hi,

I'm not familiar to cmake, so sorry if I'm wrong but,
what I understand of this code in luxrays/cmake/Packages/FindFreeImage.cmake is that FREEIMAGE_ROOT_DIR seems to be used only for WIN32, or not ?
That's why I declared FREEIMAGE_INCLUDE_PATH and FREEIMAGE_LIBRARY.

FREEIMAGE_ROOT is never used in v0.8.

Code: Select all
IF (WIN32)
    FIND_PATH( FREEIMAGE_INCLUDE_PATH FreeImage.h
        ${FREEIMAGE_ROOT_DIR}/include
        ${FREEIMAGE_ROOT_DIR}
        DOC "The directory where FreeImage.h resides")
    FIND_LIBRARY( FREEIMAGE_LIBRARY
        NAMES FreeImage freeimage
        PATHS
        ${FREEIMAGE_ROOT_DIR}/lib
        ${FREEIMAGE_ROOT_DIR}
ELSE (WIN32)
    FIND_PATH( FREEIMAGE_INCLUDE_PATH FreeImage.h
        /usr/include
        /usr/local/include
        /sw/include
        /opt/local/include
        DOC "The directory where FreeImage.h resides")
    FIND_LIBRARY( FREEIMAGE_LIBRARY
        NAMES FreeImage freeimage libfreeimage libfreeimage-3.15.2
        PATHS
        /usr/lib64
        /usr/lib
        /usr/local/lib64
        /usr/local/lib
        /sw/lib
        /opt/local/lib
        DOC "The FreeImage library")
ENDIF (WIN32)
fanou
Developer
 
Posts: 69
Joined: Fri Feb 15, 2008 7:09 pm
Location: France

Re: Passing FreeImage to cmake

Postby jeanphi » Thu Jun 21, 2012 2:40 am

Hi,

You said Lux, so I answered for the renderer, the luxrays cmake opencl detection needs to be updated to match what we have in lux. If you define the variables, it should work though.

Jeanphi
jeanphi
Developer
 
Posts: 6624
Joined: Mon Jan 14, 2008 7:21 am

Re: Passing FreeImage to cmake

Postby fanou » Fri Jun 22, 2012 4:45 am

Ok, yes.
I was talking about luxrays which I was compiling first.
fanou
Developer
 
Posts: 69
Joined: Fri Feb 15, 2008 7:09 pm
Location: France


Return to Compilation & Portability

Who is online

Users browsing this forum: No registered users and 1 guest