Make regular usage of CMAKE_INSTALL_LIBDIR and GNUInstallDirs

This commit is contained in:
Zopolis4 2024-03-08 09:11:13 +11:00 committed by Stefan Weil
parent 93c9be7acf
commit 2991d36a8b
2 changed files with 9 additions and 11 deletions

View File

@ -471,9 +471,7 @@ else()
set(DOTPRODUCT_FLAGS "${DOTPRODUCT_FLAGS} -O3 -ffast-math")
endif()
if(NOT DEFINED CMAKE_INSTALL_LIBDIR)
set(CMAKE_INSTALL_LIBDIR lib)
endif(NOT DEFINED CMAKE_INSTALL_LIBDIR)
include (GNUInstallDirs)
set(AUTOCONFIG_SRC ${CMAKE_CURRENT_BINARY_DIR}/config_auto.h.in)
set(AUTOCONFIG ${CMAKE_CURRENT_BINARY_DIR}/config_auto.h)
@ -484,13 +482,13 @@ if(GRAPHICS_DISABLED)
endif()
set(CMAKE_REQUIRED_INCLUDES
${CMAKE_REQUIRED_INCLUDES} "${CMAKE_PREFIX_PATH}/include"
"${CMAKE_INSTALL_PREFIX}/include")
${CMAKE_INSTALL_INCLUDEDIR})
include(Configure)
configure_file(${AUTOCONFIG_SRC} ${AUTOCONFIG} @ONLY)
set(INCLUDE_DIR "${CMAKE_INSTALL_PREFIX}/include")
set(LIBRARY_DIRS "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}")
set(INCLUDE_DIR ${CMAKE_INSTALL_INCLUDEDIR})
set(LIBRARY_DIRS ${CMAKE_INSTALL_LIBDIR})
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/include/tesseract/version.h.in
${CMAKE_CURRENT_BINARY_DIR}/include/tesseract/version.h @ONLY)
@ -965,9 +963,9 @@ install(
if(INSTALL_CONFIGS)
install(FILES ${TESSERACT_CONFIGS}
DESTINATION ${CMAKE_INSTALL_PREFIX}/share/tessdata/configs)
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/tessdata/configs)
install(FILES ${TESSERACT_TESSCONFIGS}
DESTINATION ${CMAKE_INSTALL_PREFIX}/share/tessdata/tessconfigs)
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/tessdata/tessconfigs)
endif()
# ##############################################################################

View File

@ -1,7 +1,7 @@
prefix=@CMAKE_INSTALL_PREFIX@
exec_prefix=${prefix}/bin
libdir=${prefix}/@CMAKE_INSTALL_LIBDIR@
includedir=${prefix}/include
exec_prefix=@CMAKE_INSTALL_PREFIX@
libdir=@CMAKE_INSTALL_FULL_LIBDIR@
includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@
Name: @tesseract_NAME@
Description: An OCR Engine that was developed at HP Labs between 1985 and 1995... and now at Google.