Skip to content

Commit

Permalink
cmake: enable libArchive support for non_cppan build
Browse files Browse the repository at this point in the history
  • Loading branch information
zdenop committed Mar 10, 2019
1 parent e4bf971 commit 4ed44d7
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,11 @@ else()
endif()

find_package(OpenCL QUIET)
find_package(LibArchive)
if(LibArchive_FOUND)
add_definitions(-DHAVE_LIBARCHIVE)

This comment has been minimized.

Copy link
@egorpugin

egorpugin Mar 10, 2019

Contributor

Global defs are bad today. It's better to set them per target.

This comment has been minimized.

Copy link
@zdenop

zdenop Mar 10, 2019

Author Contributor

Ok. Then it should go to config.h

endif()


###############################################################################
#
Expand Down Expand Up @@ -353,7 +358,7 @@ if (CPPAN_BUILD)
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/TesseractTargets.cmake "include(${CMAKE_CURRENT_BINARY_DIR}/cppan.cmake)\n")
export(TARGETS libtesseract APPEND FILE ${CMAKE_CURRENT_BINARY_DIR}/TesseractTargets.cmake)
else()
target_link_libraries (libtesseract ${Leptonica_LIBRARIES})
target_link_libraries (libtesseract ${Leptonica_LIBRARIES} ${LibArchive_LIBRARIES})
export(TARGETS libtesseract FILE ${CMAKE_CURRENT_BINARY_DIR}/TesseractTargets.cmake)
endif()

Expand Down

4 comments on commit 4ed44d7

@zdenop
Copy link
Contributor Author

@zdenop zdenop commented on 4ed44d7 Mar 10, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@egorpugin : can you add libarchive support to cppan and cw?

@egorpugin
Copy link
Contributor

@egorpugin egorpugin commented on 4ed44d7 Mar 10, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't it already there?

Oh, I see, we need -DHAVE_LIBARCHIVE.
I'll add it for sw. Seems we can remove cppan now.

@zdenop
Copy link
Contributor Author

@zdenop zdenop commented on 4ed44d7 Mar 10, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you remove cppan than please update wiki too.

@egorpugin
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, a bit later (busy atm).

Please sign in to comment.