Yeap, the macros in OIIO will fail with only the CMAKE_PREFIX_PATH as-is.

Work-around: CMakeLists.txt (OIIO)

    # THIRD_PARTY_TOOLS_HOME -> Finds IlmBase and OpenEXR
    # CMAKE_PREFIX_PATH -> Finds Png, JPEG and other dependencies

    # make and install

    SET( build_make
    cd OpenImageIO-oiio-3ba6bef &&
    )

    IF( lib_cfg_thirdparty_tools )
        SET( build_make
            ${build_make}
            export THIRD_PARTY_TOOLS_HOME=${build_dir} &&
        )
    ENDIF()

    IF( lib_cfg_cmake_prefix )
        SET( build_make
            ${build_make}
            export CMAKE_PREFIX_PATH=${build_dir} &&
        )
    ENDIF()

It's code from my CMake based thirdparty project, simply
used THIRD_PARTY_TOOLS_HOME to force the Find* macros in OIIO to look into
my libraries path (probably same as your /opt/gentoo/* path). It's not
exactly "by the book" but it works (due to the nature of CMake find
macros). So in the end I think OIIO should support  CMAKE_PREFIX_PATH fully
and skip THIRD_PARTY_TOOLS_HOME.

And for building the bundle I use BundleUtilities to make sure all
resources are copied and have right install names/ids.

Hope this helps!


On Mon, Feb 13, 2012 at 8:22 PM, Stephen Parker
<[email protected]>wrote:

> Hey Mikael,
>
> Speaking of CMAKE_PREFIX_PATH, I run Gentoo "Prefix" on my mac (in OSX)
> for development. It's basically
> Gentoo's package mgmt and build system, relegated to a directory tree
> under /opt. Meaning, everything
> is installed/linked with a prefix of /opt/gentoo/[lib64,usr,include,...].
> I had no luck using CMAKE_PREFIX_PATH
> for finding things like ilmbase, openexr, etc when setting
> CMAKE_PREFIX_PATH="/opt/gentoo". I had to use
> their respective _HOME variables. I figured my setup was a bit strange, so
> I never spent much time trying
> to figure it out. Is this your experience too?
>
> I guess it's time to buy that cmake book.
>
> -s
>
> the gentoo prefix project:
> http://www.gentoo.org/proj/en/gentoo-alt/prefix/
>
>
>
>   ------------------------------
> *From:* Mikael Sundell <[email protected]>
> *To:* OpenImageIO developers <[email protected]>
> *Sent:* Monday, February 13, 2012 3:49 AM
> *Subject:* Re: [Oiio-dev] Whither "external"?
>
> Hi all - I think it would be enough if OIIO honors the CMAKE_PREFIX_PATH
> variable when trying to find all dependencies, including IlmBase and
> OpenEXR. By doing that developers with the original external package or
> their own could easly use it to find all dependencies (no system installs
> needed).
> @Stephan and Nicholas: Did you have a look at BundleUtilities (
> http://www.cmake.org/Wiki/BundleUtilitiesExample)? Will do some tests
> with it tonight.
> Mikael
>
> On Mon, Feb 13, 2012 at 9:04 AM, Nicholas Yue <[email protected]>wrote:
>
> **
> On 13/02/12 6:58 PM, Stefan Werner wrote:
>
> On 08.02.2012, at 19:30, Larry Gritz wrote:
>
>
> So, I put it to all of you:
>
> * Does anybody still have the need to separately compile the dependencies 
> rather than use your system libs (and package manager)?
>
> My OS X build is using the externals directory instead of package manager 
> libraries so that I can distribute copies to users who have nothing but a 
> stock OS. I'm linking against static libraries where possible/permitted, and 
> am providing side-by-side dylibs for the rest.
>
> I am doing the same for my Windows x64 build for distribution.
>
>  * Is there any point to keeping the external project going at all, or at 
> this point should we just delete it and replace with the list of what 
> packages are needed and where to get them from?
>
> As long as the build process respects THIRD_PARTY_TOOLS_HOME, I'll be fine.
>
> +1
>
> Best regards
> --
> Nicholas Yue
> Graphics - RenderMan, Visualization, OpenGL, HDF5
> Custom Dev - C++ porting, OSX, Linux, Windows
> http://au.linkedin.com/in/nicholasyue
>
>
> _______________________________________________
> Oiio-dev mailing list
> [email protected]
> http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org
>
>
>
> _______________________________________________
> Oiio-dev mailing list
> [email protected]
> http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org
>
>
>
> _______________________________________________
> Oiio-dev mailing list
> [email protected]
> http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org
>
>
_______________________________________________
Oiio-dev mailing list
[email protected]
http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org

Reply via email to