Changed: Don't check Debian environment variables in CMake scripts (define options on cmake command-line instead)

This commit is contained in:
kervala 2012-10-03 10:08:56 +02:00
parent c202964108
commit ad98304019

View file

@ -13,11 +13,7 @@ ENDIF(NOT CMAKE_BUILD_TYPE)
MACRO(NL_GEN_PC name)
IF(NOT WIN32 AND WITH_INSTALL_LIBRARIES)
CONFIGURE_FILE(${name}.in "${CMAKE_CURRENT_BINARY_DIR}/${name}")
IF(CMAKE_LIBRARY_ARCHITECTURE)
INSTALL(FILES "${CMAKE_CURRENT_BINARY_DIR}/${name}" DESTINATION lib/${CMAKE_LIBRARY_ARCHITECTURE}/pkgconfig)
ELSE(CMAKE_LIBRARY_ARCHITECTURE)
INSTALL(FILES "${CMAKE_CURRENT_BINARY_DIR}/${name}" DESTINATION lib/pkgconfig)
ENDIF(CMAKE_LIBRARY_ARCHITECTURE)
INSTALL(FILES "${CMAKE_CURRENT_BINARY_DIR}/${name}" DESTINATION ${NL_LIB_PREFIX}/pkgconfig)
ENDIF(NOT WIN32 AND WITH_INSTALL_LIBRARIES)
ENDMACRO(NL_GEN_PC)
@ -250,16 +246,7 @@ MACRO(NL_SETUP_DEFAULT_OPTIONS)
###
# Optional support
###
# Check if CMake is launched from a Debian packaging script
SET(DEB_HOST_GNU_CPU $ENV{DEB_HOST_GNU_CPU})
# Don't strip if generating a .deb
IF(DEB_HOST_GNU_CPU)
OPTION(WITH_SYMBOLS "Keep debug symbols in binaries" ON )
ELSE(DEB_HOST_GNU_CPU)
OPTION(WITH_SYMBOLS "Keep debug symbols in binaries" OFF)
ENDIF(DEB_HOST_GNU_CPU)
OPTION(WITH_SYMBOLS "Keep debug symbols in binaries" OFF)
IF(WIN32)
OPTION(WITH_STLPORT "With STLport support." ON )
@ -371,9 +358,6 @@ MACRO(NL_SETUP_BUILD)
ENDIF(HOST_CPU MATCHES "amd64")
# Determine target CPU
IF(NOT TARGET_CPU)
SET(TARGET_CPU $ENV{DEB_HOST_GNU_CPU})
ENDIF(NOT TARGET_CPU)
# If not specified, use the same CPU as host
IF(NOT TARGET_CPU)
@ -386,9 +370,6 @@ MACRO(NL_SETUP_BUILD)
SET(TARGET_CPU "x86")
ENDIF(TARGET_CPU MATCHES "amd64")
# DEB_HOST_ARCH_ENDIAN is 'little' or 'big'
# DEB_HOST_ARCH_BITS is '32' or '64'
IF(${CMAKE_CXX_COMPILER_ID} MATCHES "Clang")
SET(CLANG ON)
MESSAGE(STATUS "Using Clang compiler")
@ -449,12 +430,6 @@ MACRO(NL_SETUP_BUILD)
ENDIF(TARGET_CPU STREQUAL "x86_64")
# Fix library paths suffixes for Debian MultiArch
SET(DEBIAN_MULTIARCH $ENV{DEB_HOST_MULTIARCH})
IF(DEBIAN_MULTIARCH)
SET(CMAKE_LIBRARY_ARCHITECTURE ${DEBIAN_MULTIARCH})
ENDIF(DEBIAN_MULTIARCH)
IF(CMAKE_LIBRARY_ARCHITECTURE)
SET(CMAKE_LIBRARY_PATH /lib/${CMAKE_LIBRARY_ARCHITECTURE} /usr/lib/${CMAKE_LIBRARY_ARCHITECTURE} ${CMAKE_LIBRARY_PATH})
IF(TARGET_X64)