comparison Resources/LinuxStandardBaseToolchain.cmake @ 193:a1b9d1e1497b

failed attempt to compile with linux standard base
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 13 Nov 2012 14:02:28 +0100
parents
children ded40a9e8cc8
comparison
equal deleted inserted replaced
192:c56dc32266e0 193:a1b9d1e1497b
1 INCLUDE(CMakeForceCompiler)
2
3 SET(LSB_PATH $ENV{LSB_PATH})
4 SET(LSB_TARGET_VERSION "4.0")
5
6 IF ("${LSB_PATH}" STREQUAL "")
7 SET(LSB_PATH "/opt/lsb")
8 ENDIF()
9
10 message("Using the following Linux Standard Base: ${LSB_PATH}")
11
12 IF (EXISTS ${LSB_PATH}/lib64)
13 SET(LSB_TARGET_PROCESSOR "x86_64")
14 ELSEIF (EXISTS ${LSB_PATH}/lib)
15 SET(LSB_TARGET_PROCESSOR "x86")
16 ELSE()
17 MESSAGE(FATAL_ERROR "Unable to detect the target processor architecture. Check the LSB_PATH environment variable.")
18 ENDIF()
19
20 SET(LSB_CPPPATH ${LSB_PATH}/include)
21 SET(LSB_LIBPATH ${LSB_PATH}/lib-${LSB_TARGET_VERSION})
22 SET(PKG_CONFIG_PATH ${LSB_LIBPATH}/pkgconfig/)
23
24 # the name of the target operating system
25 SET(CMAKE_SYSTEM_NAME Linux)
26 SET(CMAKE_SYSTEM_VERSION LinuxStandardBase)
27 SET(CMAKE_SYSTEM_PROCESSOR ${LSB_TARGET_PROCESSOR})
28
29 # which compilers to use for C and C++
30 SET(CMAKE_C_COMPILER ${LSB_PATH}/bin/lsbcc)
31 CMAKE_FORCE_CXX_COMPILER(${LSB_PATH}/bin/lsbc++ GNU)
32
33 # here is the target environment located
34 SET(CMAKE_FIND_ROOT_PATH ${LSB_PATH})
35
36 # adjust the default behaviour of the FIND_XXX() commands:
37 # search headers and libraries in the target environment, search
38 # programs in the host environment
39 SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
40 SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
41 SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)