[CMake] findpackage.cmake vs packageconfig.cmake

Michael Wild themiwi at gmail.com
Tue Aug 10 10:45:51 EDT 2010


On 10. Aug, 2010, at 16:20 , Mathieu Malaterre wrote:

> Hi there,
> 
>  I am trying to find a solution to find the openjpeg package.
> 
>  In the 1.x version, openjpeg uses a makefile based build system. In
> this case I need to write a custom findopenjpeg.cmake file to discover
> all required path.
> 
>  However in the current 2.x version, openjpeg now uses cmake as build
> system. In this case I need to search for the installed
> openjpeg-config.cmake.
> 
>  I did not find a solution to cope with both situations. As soon as I
> provide a findopenjpeg.cmake in the cmake_module_path, I cannot search
> for openjpeg-config.cmake anymore.
> 
> Any hints or suggestion greatly appreciated,
> -- 
> Mathieu

1: search for OpenJPEG without FindOpenJPEG.cmake (making sure that FindOpenJPEG.cmake is not on your CMAKE_MODULE_PATH)

2: if not found, either:
  a: Directly include() the FindOpenJPEG.cmake file.
  b: set the CMAKE_MODULE_PATH and retry.

I'd go with 2a (VTK and ParaView use this method extensively to provide custom FindXXX modules for older CMake versions)...

HTH

Michael


More information about the CMake mailing list