Install poppler fix (workaround for the workaround...)

fix #262
presentation
Andreas Butti 7 years ago
parent b43f105908
commit 0fbb49cfcc
  1. 9
      CMakeLists.txt
  2. 26
      cmake/cmake_uninstall.cmake.in

@ -320,6 +320,15 @@ install (DIRECTORY ui
COMPONENT xournalpp
)
if (BUILD_POPPLER)
# The Path /usr/lib is hardcoded, fix if there is a better solution
set(POPPLER_LIB ${CMAKE_INSTALL_PREFIX}/lib/libpoppler.so.72)
install(CODE "MESSAGE(\"Install Poppler workaround to ${POPPLER_LIB}\")")
install(CODE "configure_file(${CMAKE_CURRENT_BINARY_DIR}/poppler-prefix/src/poppler-build/libpoppler.so.72.0.0 ${POPPLER_LIB} COPYONLY)")
install(CODE "file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/install_manifest_workaround.txt \"${POPPLER_LIB}\")")
endif()
# Uninstall target
configure_file (
cmake/cmake_uninstall.cmake.in

@ -19,3 +19,29 @@ foreach(file ${files})
message(STATUS "File $ENV{DESTDIR}${file} does not exist.")
endif(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
endforeach(file)
## WORKAROUND UNINSTALLING
if(EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest_workaround.txt")
message(STATUS "Uninstalling workaround")
file(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest_workaround.txt" files)
string(REGEX REPLACE "\n" ";" files "${files}")
foreach(file ${files})
message(STATUS "Uninstalling $ENV{DESTDIR}${file}")
if(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
exec_program(
"@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\""
OUTPUT_VARIABLE rm_out
RETURN_VALUE rm_retval
)
if(NOT "${rm_retval}" STREQUAL 0)
message(FATAL_ERROR "Problem when removing $ENV{DESTDIR}${file}")
endif(NOT "${rm_retval}" STREQUAL 0)
else(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
message(STATUS "File $ENV{DESTDIR}${file} does not exist.")
endif(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
endforeach(file)
endif()

Loading…
Cancel
Save