MantisBT - CMake
View Issue Details
0009796CMakeCMakepublic2009-10-29 13:032016-06-06 13:37
Shane Dixon 
Alex Neundorf 
normalminoralways
closedno change required 
CMake-2-8 
 
0009796: When using a toolchain.cmake file, FIND_LIBRARY stops working properly
I'm still having success with FIND_PATH, but FIND_LIBRARY fails:

In toolchain.cmake:
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:/Program Files/Eracom/ProtectProcessing Orange SDK"
  "C:/Program Files/Eracom/ProtectToolkit C SDK" )
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 CMakeLists.txt
FIND_PATH( ERACOM_PPO_INCLUDE_DIR fmerr.h )
FIND_PATH( ERACOM_PTKC_INCLUDE_DIR cryptoki.h )
FIND_LIBRARY( ERACOM_XXX_LIBFMCRT_LIBRARY libfmcrt
          PATH_SUFFIXES armfm )
FIND_LIBRARY( ERACOM_XXX_CRYPTOKI2_LIBRARY cryptoki2 )

Both the FIND_PATH's pass and both FIND_LIBRARY's fail again. I thought maybe it's because the paths have a space so I moved them to a folder that has no spaces and still the same issue.

Here are all the paths:
C:\Program Files\Eracom\ProtectToolkit C SDK\include\cryptoki.h
C:\Program Files\Eracom\ProtectProcessing Orange SDK\include\fmerr.h
C:\Program Files\Eracom\ProtectToolkit C SDK\lib\cryptoki2.lib
C:\Program Files\Eracom\ProtectProcessing Orange SDK\lib\armfm\libfmcrt.a
See these mailing list posts:

http://www.cmake.org/pipermail/cmake/2009-October/032887.html [^]
http://www.cmake.org/pipermail/cmake/2009-October/032920.html [^]
cross compile, find_library, toolchain.cmake
Issue History
2009-10-29 13:03Shane DixonNew Issue
2009-10-29 13:36Shane DixonTag Attached: cross compile
2009-10-29 13:36Shane DixonTag Attached: find_library
2009-10-29 13:36Shane DixonTag Attached: toolchain.cmake
2009-10-29 13:51Bill HoffmanStatusnew => assigned
2009-10-29 13:51Bill HoffmanAssigned To => Alex Neundorf
2009-10-29 14:21Alex NeundorfNote Added: 0018281
2009-10-29 14:43Shane DixonNote Added: 0018283
2009-10-29 14:51Alex NeundorfNote Added: 0018284
2009-10-29 14:53Alex NeundorfNote Added: 0018285
2009-10-29 15:51Shane DixonNote Added: 0018286
2009-10-29 16:39Alex NeundorfStatusassigned => closed
2009-10-29 16:39Alex NeundorfResolutionopen => no change required
2016-06-06 13:37Brad KingView Statusprivate => public

Notes
(0018281)
Alex Neundorf   
2009-10-29 14:21   
cryptoki2.lib - this file does not have the "lib" prefix as would be expected for a library for Linux. Also the ".lib" suffix doesn't look good.

About FIND_LIBRARY( ERACOM_XXX_LIBFMCRT_LIBRARY libfmcrt PATH_SUFFIXES armfm )
Are you really sure that
FIND_LIBRARY( ERACOM_XXX_LIBFMCRT_LIBRARY fmcrt
           PATH_SUFFIXES armfm )
also does not work ?

Alex
(0018283)
Shane Dixon   
2009-10-29 14:43   
Okay, you're definitely right about the .lib. The toolchain I'm porting to cmake uses both cl and gcc, so I'll have to fix that by building it as an external project.

FIND_LIBRARY( ERACOM_XXX_LIBFMCRT_LIBRARY fmcrt
           PATH_SUFFIXES armfm )

That works. I had to clean out my build directory, but it worked. I think I have the issue worked out enough to where we can close this
(0018284)
Alex Neundorf   
2009-10-29 14:51   
Then please open a new one for the -rdynamic vs. -shared :-)

Alex
(0018285)
Alex Neundorf   
2009-10-29 14:53   
Can your gcc actually use the cryptoki2.lib if it has been found ?

Alex
(0018286)
Shane Dixon   
2009-10-29 15:51   
No, it can't. cryptoki2.lib is only used when using the "cl" compiler.