Skip to content

Commit

Permalink
cmake-utils.eclass: make heredocs die
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Palimaka committed Oct 15, 2015
1 parent d09e4e1 commit 1ebdc4b
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions eclass/cmake-utils.eclass
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ _modify-cmakelists() {
|| die "${LINENO}: failed to disable hardcoded settings"

# NOTE Append some useful summary here
cat >> "${CMAKE_USE_DIR}"/CMakeLists.txt <<- _EOF_
cat >> "${CMAKE_USE_DIR}"/CMakeLists.txt <<- _EOF_ || die
MESSAGE(STATUS "<<< Gentoo configuration >>>
Build type \${CMAKE_BUILD_TYPE}
Expand Down Expand Up @@ -457,7 +457,7 @@ enable_cmake-utils_src_configure() {

# Prepare Gentoo override rules (set valid compiler, append CPPFLAGS etc.)
local build_rules=${BUILD_DIR}/gentoo_rules.cmake
cat > "${build_rules}" <<- _EOF_
cat > "${build_rules}" <<- _EOF_ || die
SET (CMAKE_AR $(type -P $(tc-getAR)) CACHE FILEPATH "Archive manager" FORCE)
SET (CMAKE_ASM_COMPILE_OBJECT "<CMAKE_C_COMPILER> <DEFINES> ${CFLAGS} <FLAGS> -o <OBJECT> -c <SOURCE>" CACHE STRING "ASM compile command" FORCE)
SET (CMAKE_C_COMPILE_OBJECT "<CMAKE_C_COMPILER> <DEFINES> ${CPPFLAGS} <FLAGS> -o <OBJECT> -c <SOURCE>" CACHE STRING "C compile command" FORCE)
Expand All @@ -468,7 +468,7 @@ enable_cmake-utils_src_configure() {
_EOF_

local toolchain_file=${BUILD_DIR}/gentoo_toolchain.cmake
cat > ${toolchain_file} <<- _EOF_
cat > ${toolchain_file} <<- _EOF_ || die
SET (CMAKE_C_COMPILER $(tc-getCC))
SET (CMAKE_CXX_COMPILER $(tc-getCXX))
SET (CMAKE_Fortran_COMPILER $(tc-getFC))
Expand All @@ -489,14 +489,14 @@ enable_cmake-utils_src_configure() {
*) sysname="${KERNEL}" ;;
esac

cat >> "${toolchain_file}" <<- _EOF_
cat >> "${toolchain_file}" <<- _EOF_ || die
SET (CMAKE_SYSTEM_NAME "${sysname}")
_EOF_

if [ "${SYSROOT:-/}" != "/" ] ; then
# When cross-compiling with a sysroot (e.g. with crossdev's emerge wrappers)
# we need to tell cmake to use libs/headers from the sysroot but programs from / only.
cat >> "${toolchain_file}" <<- _EOF_
cat >> "${toolchain_file}" <<- _EOF_ || die
set(CMAKE_FIND_ROOT_PATH "${SYSROOT}")
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
Expand All @@ -508,7 +508,7 @@ enable_cmake-utils_src_configure() {
has "${EAPI:-0}" 0 1 2 && ! use prefix && EPREFIX=

if [[ ${EPREFIX} ]]; then
cat >> "${build_rules}" <<- _EOF_
cat >> "${build_rules}" <<- _EOF_ || die
# in Prefix we need rpath and must ensure cmake gets our default linker path
# right ... except for Darwin hosts
IF (NOT APPLE)
Expand All @@ -533,7 +533,7 @@ enable_cmake-utils_src_configure() {
# Common configure parameters (invariants)
local common_config=${BUILD_DIR}/gentoo_common_config.cmake
local libdir=$(get_libdir)
cat > "${common_config}" <<- _EOF_
cat > "${common_config}" <<- _EOF_ || die
SET (LIB_SUFFIX ${libdir/lib} CACHE STRING "library path suffix" FORCE)
SET (CMAKE_INSTALL_LIBDIR ${libdir} CACHE PATH "Output directory for libraries")
_EOF_
Expand Down

0 comments on commit 1ebdc4b

Please sign in to comment.