Skip to content

Commit

Permalink
As expected, I'm terrible with CMake...
Browse files Browse the repository at this point in the history
Unbreak previous commit.
  • Loading branch information
NiLuJe committed May 16, 2016
1 parent d301e40 commit 02ba8e1
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions thirdparty/leptonica/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,20 @@ ko_write_gitclone_script(
${SOURCE_DIR}
)

# Make sure we use the old fmemopen symbol on Linux when building against glibc >= 2.22 (c.f. base#421)
# NOTE: The patch will be much simpler w/ the upcoming leptonica version, there's a 1.74 version of the patch already in our tree for when that time comes ;)
# NOTE: Because everything is awesome, this can only be applied safely when building against glibc >= 2.22 ...
if(${GLIBC_GTE_2_22})
set(PATCH_CMD "patch -N -p1 < ${CMAKE_CURRENT_SOURCE_DIR}/leptonica-1.72-fmemopen-compat-symbol.patch")
else()
set(PATCH_CMD "")
endif()

include(ExternalProject)
ExternalProject_Add(
${PROJECT_NAME}
DOWNLOAD_COMMAND ${CMAKE_COMMAND} -P ${GIT_CLONE_SCRIPT_FILENAME}
# Make sure we use the old fmemopen symbol on Linux when building against glibc >= 2.22 (c.f. base#421)
# NOTE: The patch will be much simpler w/ the upcoming leptonica version, there's a 1.74 version of the patch already in our tree for when that time comes ;)
# NOTE: Because everything is awesome, this can only be applied safely when building against glibc >= 2.22 ...
if(${GLIBC_GTE_2_22})
PATCH_COMMAND patch -N -p1 < ${CMAKE_CURRENT_SOURCE_DIR}/leptonica-1.72-fmemopen-compat-symbol.patch
endif(${GLIBC_GTE_2_22})
PATCH_COMMAND ${PATCH_CMD}
CONFIGURE_COMMAND ""
# skip build and install, libk2pdfopt will build it
BUILD_COMMAND ""
Expand Down

0 comments on commit 02ba8e1

Please sign in to comment.