-
Notifications
You must be signed in to change notification settings - Fork 7.4k
[libodraw] Add new port #8155
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
[libodraw] Add new port #8155
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,80 @@ | ||
| cmake_minimum_required(VERSION 3.12) | ||
|
|
||
| project(libodraw C) | ||
|
|
||
| find_package(OpenSSL REQUIRED) | ||
| find_package(ZLIB REQUIRED) | ||
|
|
||
| if(MSVC) | ||
| add_compile_definitions(_CRT_SECURE_NO_DEPRECATE) | ||
| add_compile_definitions(_CRT_NONSTDC_NO_DEPRECATE) | ||
| endif() | ||
|
|
||
| add_compile_definitions(HAVE_LOCAL_LIBBFIO) | ||
| add_compile_definitions(HAVE_LOCAL_LIBCERROR) | ||
| add_compile_definitions(HAVE_LOCAL_LIBCTHREADS) | ||
| add_compile_definitions(HAVE_LOCAL_LIBCDATA) | ||
| add_compile_definitions(HAVE_LOCAL_LIBCLOCALE) | ||
| add_compile_definitions(HAVE_LOCAL_LIBCNOTIFY) | ||
| add_compile_definitions(HAVE_LOCAL_LIBCSPLIT) | ||
| add_compile_definitions(HAVE_LOCAL_LIBCFILE) | ||
| add_compile_definitions(HAVE_LOCAL_LIBCPATH) | ||
| add_compile_definitions(HAVE_LOCAL_LIBHMAC) | ||
| add_compile_definitions(HAVE_LOCAL_LIBUNA) | ||
|
|
||
| if(UNIX) | ||
| configure_file(common/config.h.in common/config.h) | ||
| add_compile_definitions(HAVE_CONFIG_H) | ||
| add_compile_definitions(LOCALEDIR="/usr/share/locale") | ||
| endif() | ||
|
|
||
| if(MSVC) | ||
| add_compile_definitions(LIBODRAW_DLL_EXPORT) | ||
| set(LIB_RC libodraw/libodraw.rc) | ||
| endif() | ||
|
|
||
|
|
||
| include(GNUInstallDirs) | ||
| include(CMakePackageConfigHelpers) | ||
|
|
||
| # Add CMake find_package() integration | ||
| set(PROJECT_TARGET_NAME "${PROJECT_NAME}") | ||
| set(CONFIG_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}") | ||
| set(PROJECT_CONFIG "${CMAKE_CURRENT_BINARY_DIR}/generated/${PROJECT_TARGET_NAME}Config.cmake") | ||
| set(TARGETS_EXPORT_NAME "${PROJECT_TARGET_NAME}Targets") | ||
| set(NAMESPACE "libodraw::") | ||
|
|
||
| # Source files | ||
| file(GLOB LIB_SRC lib*/*.c) | ||
|
|
||
| # Headers | ||
| file(GLOB LIB_INST_HEADERS include/libodraw/*.h) | ||
|
|
||
| add_library(${PROJECT_NAME} ${LIB_SRC} ${LIB_RC}) | ||
|
|
||
| target_include_directories(${PROJECT_NAME} PRIVATE ./include ./common) | ||
| target_include_directories(${PROJECT_NAME} PRIVATE ./libbfio ./libcdata ./libcerror ./libcfile ./libclocale) | ||
| target_include_directories(${PROJECT_NAME} PRIVATE ./libcnotify ./libcpath ./libcsplit ./libcthreads) | ||
| target_include_directories(${PROJECT_NAME} PRIVATE ./libhmac ./libuna) | ||
|
|
||
| target_link_libraries(${PROJECT_NAME} PRIVATE ZLIB::ZLIB OpenSSL::Crypto) | ||
|
|
||
| install(TARGETS ${PROJECT_NAME} | ||
| EXPORT ${TARGETS_EXPORT_NAME} | ||
| RUNTIME DESTINATION bin | ||
| LIBRARY DESTINATION lib | ||
| ARCHIVE DESTINATION lib | ||
| INCLUDES DESTINATION include) | ||
|
|
||
| install(FILES ${LIB_INST_HEADERS} DESTINATION include/libodraw) | ||
| install(FILES include/libodraw.h DESTINATION include) | ||
|
|
||
|
|
||
| # Generate and install libodrawConfig.cmake | ||
| configure_package_config_file("Config.cmake.in" "${PROJECT_CONFIG}" INSTALL_DESTINATION "${CONFIG_INSTALL_DIR}") | ||
| install(FILES "${PROJECT_CONFIG}" DESTINATION "${CONFIG_INSTALL_DIR}") | ||
|
|
||
| # Generate and install libodrawTargets*.cmake | ||
| install(EXPORT ${TARGETS_EXPORT_NAME} | ||
| NAMESPACE ${NAMESPACE} | ||
| DESTINATION "${CONFIG_INSTALL_DIR}") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| Source: libodraw | ||
| Version: 2019-01-18 | ||
| Build-Depends: openssl,zlib | ||
| Description: Library and tools to access to optical disc (split) RAW image files (BIN/CUE, ISO/CUE). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| @PACKAGE_INIT@ | ||
|
|
||
| include("${CMAKE_CURRENT_LIST_DIR}/@TARGETS_EXPORT_NAME@.cmake") | ||
| check_required_components("@PROJECT_NAME@") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| include(vcpkg_common_functions) | ||
|
|
||
| vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY) | ||
|
|
||
| set(LIB_VERSION 20190118) | ||
| set(LIB_FILENAME libodraw-alpha-${LIB_VERSION}.tar.gz) | ||
|
|
||
| # Release distribution file contains configured sources, while the source code in the repository does not. | ||
| vcpkg_download_distfile(ARCHIVE | ||
| URLS "https://github.com/libyal/libodraw/releases/download/${LIB_VERSION}/${LIB_FILENAME}" | ||
| FILENAME "${LIB_FILENAME}" | ||
| SHA512 db7e44867d75c8742bbc1655d6c7cdfbf27542bff2bcca32bb2bebaedaa6f98488fd9fe2f20d4d652a6f39c9aff8cc4805dbbb07661e1c90a913396a9d39e708 | ||
| ) | ||
|
|
||
| vcpkg_extract_source_archive_ex( | ||
| OUT_SOURCE_PATH SOURCE_PATH | ||
| ARCHIVE ${ARCHIVE} | ||
| REF ${LIB_VERSION} | ||
| ) | ||
|
|
||
| file(COPY "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt" DESTINATION "${SOURCE_PATH}") | ||
| file(COPY "${CMAKE_CURRENT_LIST_DIR}/Config.cmake.in" DESTINATION "${SOURCE_PATH}") | ||
|
|
||
| vcpkg_configure_cmake( | ||
| SOURCE_PATH "${SOURCE_PATH}" | ||
| PREFER_NINJA | ||
| ) | ||
| vcpkg_install_cmake() | ||
|
|
||
| vcpkg_fixup_cmake_targets(CONFIG_PATH "lib/cmake/libodraw" TARGET_PATH "share/libodraw") | ||
|
|
||
| file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") | ||
|
|
||
| # License and man | ||
| file(INSTALL "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/libodraw" RENAME copyright) | ||
|
|
||
| vcpkg_copy_pdbs() | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
include(vcpkg_common_functions) is deprecated. Please remove it.