[CMake] Overriding found jpeg

Ramin Kamal ramin.kamal at primefocusworld.com
Thu Feb 6 07:30:54 EST 2014


Thanks! I tried that, but it still finds the system library. Here's my test
setup:

% cd /tmp
% mkdir myjpeg myproj
% cd myjpeg
% mkdir lib include
% cd /usr/lib
% cp libjpeg.* /tmp/myjpeg/lib/
% cd /usr/include
% cp jpeglib.h  /tmp/myjpeg/include/
% cd /tmp/myproj
% cat << EOF > CMakeLists.txt
cmake_minimum_required (VERSION 2.6)
project (test)
find_package(JPEG REQUIRED)
message( "path is ${JPEG_LIBRARY}" )
EOF
% mkdir build
% cd build
% cmake -D CMAKE_PREFIX_PATH=/tmp/myjpeg ..
-- The C compiler identification is GNU
-- The CXX compiler identification is GNU
-- Check for working C compiler: /usr/lib64/ccache/gcc
-- Check for working C compiler: /usr/lib64/ccache/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/lib64/ccache/c++
-- Check for working CXX compiler: /usr/lib64/ccache/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Found JPEG: /usr/lib64/libjpeg.so
*path is /usr/lib64/libjpeg.so*
-- Configuring done
-- Generating done
-- Build files have been written to: /tmp/myproj/build

Did I miss something simple there?

cheers,
Ramin


On Thu, Feb 6, 2014 at 12:14 PM, Rolf Eike Beer <eike at sf-mail.de> wrote:

> Am 06.02.2014 13:02, schrieb Ramin Kamal:
>
>  Hi,
>>
>> I'm trying to build an open source package (openimageio, if it matters)
>> and
>> would like to have cmake use a specific build of the jpeg library for that
>> project. It looks like the jpeg library that's used is determined in the
>> line:
>>
>> find_package (JPEG REQUIRED)
>>
>> So I'd like to modify the behaviour of that command so that it finds the
>> lib and include files that I've custom built at, say,
>> /myjpeg/lib/libjpeg.a, etc
>>
>> Is there an easy way to do this? I would prefer if I could guarantee that
>> it doesn't pick up the system libjpeg.a file.
>>
>
> cmake -D CMAKE_PREFIX_PATH=/opt/special_jpeg ...
>
> Eike
> --
>
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at http://www.kitware.com/
> opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20140206/b6b7ba02/attachment-0001.html>


More information about the CMake mailing list