[CMake] Toolchain.cmake causing find_library problems

Dixon, Shane Shane.Dixon at atmel.com
Wed Oct 28 16:27:27 EDT 2009


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 )
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 )
............................................................


--
Shane Dixon
Linux Engineer
Atmel Corporation 



More information about the CMake mailing list