[CMake] Toolchain.cmake causing find_library problems

Dixon, Shane Shane.Dixon at atmel.com
Wed Oct 28 17:11:36 EDT 2009


Okay, so a little more digging and I have a bit more information.  I tried find_path() and that one fails until I add "NO_CMAKE_FIND_ROOT_PATH" and then it finds the files just fine.  It just seems like find_library() that's not respecting the "NO_CMAKE_FIND_ROOT_PATH". 

#works
FIND_PATH( ERACOM_PTKC_INCLUDE_DIR cryptoki.h
	PATHS
	"$ENV{ProgramFiles}/Eracom/ProtectToolkit C SDK" 
	PATH_SUFFIXES include 
	NO_CMAKE_FIND_ROOT_PATH )
	
#doesn't work
FIND_LIBRARY( ERACOM_XXX_CRYPTOKI2_LIBRARY cryptoki2.lib 
	PATHS
	"$ENV{ProgramFiles}/Eracom/ProtectToolkit C SDK" 
	PATH_SUFFIXES lib
	NO_CMAKE_FIND_ROOT_PATH)

--
Shane Dixon
Linux Engineer
Atmel Corporation 


-----Original Message-----
From: cmake-bounces at cmake.org [mailto:cmake-bounces at cmake.org] On Behalf Of Dixon, Shane
Sent: Wednesday, October 28, 2009 2:27 PM
To: cmake at cmake.org
Subject: [CMake] Toolchain.cmake causing find_library problems

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 

_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


More information about the CMake mailing list