[CMake] project(), find_package()

Nils Gladitz nilsgladitz at gmail.com
Mon Apr 13 04:56:04 EDT 2015


On 04/13/2015 10:40 AM, Nico Schlömer wrote:
> FIND_PACKAGE(Trilinos REQUIRED)
> ```
> which sits in the custom folder
> ```
> /path/to/lib/x86_64-linux-gnu/cmake/Trilinos/TrilinosConfig.cmake

[...]

> What *does* help was setting the `project()` *before* `find_package()`.
> Is this something that documented anywhere?

I don't think it is documented that explicitly but it is implied by the 
fact that project() [1] performs language initialization (that part is 
documented).

That includes determining that your compiler targets e.g. 
"x86_64-linux-gnu" so that find_package() knows to look in that target 
specific directory.

Nils

[1] http://www.cmake.org/cmake/help/v3.2/command/project.html



More information about the CMake mailing list