On Tue, Aug 10, 2010 at 7:47 PM, Alexander Neundorf <a.neundorf-w...@gmx.net> wrote: > On Tuesday 10 August 2010, 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, > > I'd suggest to use a findopenjpeg.cmake, which first does a > find_package(openjpeg QUIET NO_MODULE) > and if that fails, continues to search with the "traditional" > find_library/find_path/etc. calls. > > This way you can also print custom success/failure messages if > the -config.cmake file is not found, or test for additional features even > if -config.cmake is found.
Neat, I did not relalize there was a NO_MODULE option. Warning: for anyone trying this solution do NOT use : find_package(OpenJPEG 1.0 REQUIRED) and expect it to work. Instead, it is required to use find_package(OpenJPEG REQUIRED) .. I am not sure if I should report that as a bug or not. Thanks ! -- Mathieu _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake