Skip to content

Commit

Permalink
Merge pull request #5 from xsacha/hunter
Browse files Browse the repository at this point in the history
Just link targets directly. No need to check.
  • Loading branch information
ruslo authored Jun 5, 2017
2 parents 87ff4f2 + 3af1ffe commit a1ec46a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 19 deletions.
5 changes: 0 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,6 @@ endif()
#
###############################################################################

set(LIBRARY_TYPE SHARED)
if (STATIC)
set(LIBRARY_TYPE)
endif()

if (WIN32)
if (MSVC)
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
Expand Down
5 changes: 5 additions & 0 deletions cmake/templates/LeptonicaConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@

include(${CMAKE_CURRENT_LIST_DIR}/LeptonicaTargets.cmake)

find_package(JPEG CONFIG REQUIRED)
find_package(PNG CONFIG REQUIRED)
find_package(TIFF CONFIG REQUIRED)
find_package(ZLIB CONFIG REQUIRED)

# ======================================================
# Version variables:
# ======================================================
Expand Down
17 changes: 3 additions & 14 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ if (MSVC)
set_source_files_properties(${src} PROPERTIES LANGUAGE CXX)
endif()

add_library (leptonica ${LIBRARY_TYPE} ${src} ${hdr})
add_library (leptonica ${src} ${hdr})
set_target_properties (leptonica PROPERTIES VERSION ${VERSION_PLAIN})
set_target_properties (leptonica PROPERTIES SOVERSION 5.1.0)
if (WIN32)
Expand All @@ -29,24 +29,13 @@ endif()
if (GIF_LIBRARY)
target_link_libraries (leptonica ${GIF_LIBRARY})
endif()
if (JPEG_LIBRARY)
target_link_libraries (leptonica JPEG::jpeg)
endif()
if (JP2K_FOUND)
target_link_libraries (leptonica ${JP2K_LIBRARIES})
endif()
if (PNG_LIBRARY)
target_link_libraries (leptonica PNG::png)
endif()
if (TIFF_LIBRARY)
target_link_libraries (leptonica TIFF::libtiff)
endif()
if (WEBP_FOUND)
target_link_libraries (leptonica ${WEBP_LIBRARIES})
endif()
if (ZLIB_LIBRARY)
target_link_libraries (leptonica ZLIB::zlib)
endif()
target_link_libraries (leptonica PUBLIC JPEG::jpeg PNG::png TIFF::libtiff ZLIB::zlib)

if (UNIX)
target_link_libraries (leptonica m)
Expand All @@ -68,7 +57,7 @@ else()
endif()

install(TARGETS leptonica EXPORT LeptonicaTargets RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib INCLUDES DESTINATION include)
install(EXPORT LeptonicaTargets DESTINATION lib/cmake/${PROJECT_NAME})
install(EXPORT LeptonicaTargets NAMESPACE "Leptonica::" DESTINATION lib/cmake/${PROJECT_NAME})
install(FILES
${hdr}
${CMAKE_BINARY_DIR}/src/endianness.h
Expand Down

0 comments on commit a1ec46a

Please sign in to comment.