[Cmake] Re:FIND_PACKAGE?
Brad King
brad.king at kitware.com
Fri Mar 7 08:58:32 EST 2003
> Obviously, I haven't understood the mechanisms of FIND_PACKAGE
> correctly. Maybe you could clarify this for me.
See below.
> Ultimately, I want to include a project that is not cmake aware. This
> project exports its build parameters in a Makefile stub file. I would
> like to convert that to a Cmake conforming build file. The problem is
> that there are multiple stub files for multiple builds in multiple sub
> dirs and I need to find a way to pick the right one for the cmake build
> of the project including this project. For each architecture and
> compiler, there is a stub file in a sub-dir, but the compiler flags and
> library names then depend upon certain compilation options during build
> such as template preinstantiation, optimized build etc. So I cannot
> manually provide config.cmake files for them. There seems to be
> everything in place in cmake to handle this, but I haven't quite figured
> how to use it. Mmmh ;-)
CMake will not read unix Makefiles and construct information from them.
You'll either have to add something to the other project to make it CMake
aware, or write a loadable C command for CMake that will read the
makefiles and store their information in CMake variables.
> # FindFoo.cmake
> SET(FOO_INCLUDE_DIR ${A_CMAKE_TEST_SRC_DIR}/foo)
[snip]
> FIND_PACKAGE(FOO)
You have everything right, except the capitalization of "Foo" and "FOO" do
not match. Since it cannot find "FindFOO.cmake", it reverts to the second
form.
-Brad
More information about the CMake
mailing list