[CMake] Toolchain.cmake causing find_library problems

Alexander Neundorf a.neundorf-work at gmx.net
Wed Oct 28 18:07:35 EDT 2009


Hi,

On Wednesday 28 October 2009, Dixon, Shane wrote:
> I'm using a toolchain.cmake file (see below).  I then try to find a library
> after loading this toolchain (using -DCMAKE_TOOLCHAIN_FILE=... Option).  I
> can't find the library regardless of how I set the CMAKE_FIND_ROOT_PATH
> settings.  I try setting it to NO and still can't find the library.
>
> It's like it ignores the PATHS when CMAKE_FIND_ROOT_PATH_MODE_LIBRARY is
> set.
>
> I even tried setting CMAKE_PREFIX to the same folder as the path, but still
> no luck.  Is there something I'm missing?
>
> In the toolchain.cmake I have:
>
> ............................................................
> INCLUDE( CMakeForceCompiler )
> SET( CMAKE_SYSTEM_NAME Linux )
> CMAKE_FORCE_C_COMPILER( gcc-fm GNU )
> CMAKE_FORCE_CXX_COMPILER( g++-fm GNU )

Why do you use cmake_force_c/cxx_compiler() ?
It shouldn't be necessary.
How does compiler detection fail otherwise ?

> SET( CMAKE_FIND_ROOT_PATH C:/gcc-fm C:/gcc-fm/arm-elf )
> SET( CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER )
> SET( CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY )
> SET( CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY )
> ............................................................
>
> In the top-level CMakeLists.txt I have:
>
> ............................................................
> FIND_LIBRARY( ERACOM_XXX_LIBFMCRT_LIBRARY libfmcrt.lib
> 	PATHS
> 	"$ENV{ProgramFiles}/Eracom/ProtectProcessing Orange SDK"
> 	PATH_SUFFIXES lib/armfm
> 	NO_CMAKE_FIND_ROOT_PATH )
> ............................................................

What are the full paths to libfmcrt.lib and cryptoki.h on your system ?

Alex


More information about the CMake mailing list