Skip to content

Commit

Permalink
Make regular usage of CMAKE_INSTALL_LIBDIR and GNUInstallDirs
Browse files Browse the repository at this point in the history
  • Loading branch information
Zopolis4 authored and stweil committed Jun 21, 2024
1 parent 93c9be7 commit 2991d36
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
14 changes: 6 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down Expand Up @@ -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()

# ##############################################################################
Expand Down
6 changes: 3 additions & 3 deletions tesseract.pc.cmake
Original file line number Diff line number Diff line change
@@ -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.
Expand Down

0 comments on commit 2991d36

Please sign in to comment.