find_path / find_package hardcoded path

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

find_path / find_package hardcoded path

Stéphane Ancelot

Hi,

using mingw32 with win10 , I can not manage to find jpeg libs .

I tried setting JPEG_DIR, it fails.

it also fails setting CMAKE_FIND_ROOT_PATH

set(JPEG_DIR c:\\work\\WIN32DEPS\\jpegfolder)

find_path(JPEG_INCLUDE_DIR jpeglib.h) fails

find_package(JPEG ) fails


what is the right way to specify the hardcoded path ?

Regards,

S.Ancelot




--

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:
https://cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: find_path / find_package hardcoded path

Rolf Eike Beer
Am 2019-08-28 11:39, schrieb Stéphane Ancelot:
> Hi,
>
> using mingw32 with win10 , I can not manage to find jpeg libs .
>
> I tried setting JPEG_DIR, it fails.
>
> it also fails setting CMAKE_FIND_ROOT_PATH
>
> set(JPEG_DIR c:\\work\\WIN32DEPS\\jpegfolder)

Use forward slashes. Don't do it in the CMakeLists.txt as it is
something happening only on your system, so pass it on the command line,
e.g. as

  cmake -D CMAKE_PREFIX_PATH=c:/work/win32deps/jpegfolder

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:
https://cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: find_path / find_package hardcoded path

Ran Regev

I think you can also add "PATHS" or "HINTS" to find_package.

Ran.

On Wed, Aug 28, 2019 at 1:03 PM Rolf Eike Beer <[hidden email]> wrote:
Am 2019-08-28 11:39, schrieb Stéphane Ancelot:
> Hi,
>
> using mingw32 with win10 , I can not manage to find jpeg libs .
>
> I tried setting JPEG_DIR, it fails.
>
> it also fails setting CMAKE_FIND_ROOT_PATH
>
> set(JPEG_DIR c:\\work\\WIN32DEPS\\jpegfolder)

Use forward slashes. Don't do it in the CMakeLists.txt as it is
something happening only on your system, so pass it on the command line,
e.g. as

  cmake -D CMAKE_PREFIX_PATH=c:/work/win32deps/jpegfolder

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:
https://cmake.org/mailman/listinfo/cmake

--

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:
https://cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: find_path / find_package hardcoded path

Rolf Eike Beer
Am 2019-08-28 12:28, schrieb Ran Regev:
> I think you can also add "PATHS" or "HINTS" to find_package.

Yes, but this has a different purpose. It's idea is to provide places to
look at based on other things already found, things that would work
independent of the machine.

The plan here is to provide information about the local directories, and
those should not end up in CMakeLists.txt as they are totally
meaningless when switching to a different machine.

One could use an initial cache file for this if this has to be done over
and over again on the same machine, or add a shell alias (or a shell
alias to the cache file, which is more flexible).

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:
https://cmake.org/mailman/listinfo/cmake