[CMake] CMake toolchain and FIND_PACKAGE(OpenSSL)
Boards Killer
boards.killer at gmail.com
Mon Nov 19 07:41:16 EST 2012
Hi CMake Community !
I am writing a CMake toolchain to cross compile our CMake project with the
Ubuntu ARM Linux toolchain. The CMake toolchain is given below.
I am facing the following problem. When using:
FIND_PACKAGE(OpenSSL)
The libraries (lssl, lcrypto) are *not* found. There are actually located
at
$ENV{SDK_TARGET}/lib
I thought that adding a LINK_DIRECTORIES to the toolchain would do the
trick, but no avail.
What is the best way to tell CMake where to find the libraries? Should I
set the path manually
in the toolchain, for instance.
TIA,
/ld
--
# Cmake toolchain for cross compiling
# target system type
SET(CMAKE_SYSTEM_NAME Linux)
SET(CMAKE_SYSTEM_VERSION 1)
SET(CMAKE_SYSTEM_PROCESSOR armv7l)
INCLUDE_DIRECTORIES(SYSTEM "$ENV{SDK_TARGET}/usr/include")
INCLUDE_DIRECTORIES(SYSTEM "$ENV{SDK_TARGET}/usr/include/arm-linux-gnueabi")
LINK_DIRECTORIES("$ENV{SDK_TARGET}/lib")
# specify the cross compiler
SET(CMAKE_C_COMPILER arm-linux-gnueabi-gcc)
SET(CMAKE_CXX_COMPILER arm-linux-gnueabi-g++)
# location of target environment
SET(CMAKE_FIND_ROOT_PATH $ENV{SDK_TARGET})
# search for programs in the build host directories
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
# for libraries and headers in the target directories
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20121119/c1620ae8/attachment.htm>
More information about the CMake
mailing list