Hi everyone,

I have a CMake project where I need to find the third-party package
```
FIND_PACKAGE(Trilinos REQUIRED)
```
which sits in the custom folder
```
/path/to/lib/x86_64-linux-gnu/cmake/Trilinos/TrilinosConfig.cmake
```
Unfortunately, simply extending the CMAKE_PREFIX_PATH
```
CMAKE_PREFIX_PATH=/path/to/:$CMAKE_PREFIX_PATH \
cmake ../source/
```
did not do the trick:
```
CMake Error at CMakeLists.txt:25 (FIND_PACKAGE):
  By not providing "FindTrilinos.cmake" in CMAKE_MODULE_PATH this project
has
  asked CMake to find a package configuration file provided by "Trilinos",
  but CMake did not find one.

  Could not find a package configuration file provided by "Trilinos" with
any
  of the following names:

    TrilinosConfig.cmake
    trilinos-config.cmake
[...]
```
What *does* help was setting the `project()` *before* `find_package()`. Is
this something that documented anywhere?

Cheers,
Nico
-- 

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://public.kitware.com/mailman/listinfo/cmake

Reply via email to