Skip to content

Commit

Permalink
Fix zlib
Browse files Browse the repository at this point in the history
  • Loading branch information
vkedwardli committed Jan 9, 2025
1 parent 3e7053e commit 09d702f
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -277,13 +277,15 @@ target_link_libraries(${PROJECT_NAME} PRIVATE chdr-static)
target_include_directories(${PROJECT_NAME} PRIVATE core/deps/libchdr/include)

if(NOT WITH_SYSTEM_ZLIB)
target_include_directories(${PROJECT_NAME} PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/core/deps/libchdr/deps/zlib-1.3.1")
target_link_libraries(${PROJECT_NAME} PRIVATE zlib)
set(ZLIB_RELATIVE_PATH "core/deps/libchdr/deps/zlib-1.3.1")
target_include_directories(${PROJECT_NAME} PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/${ZLIB_RELATIVE_PATH}" "${CMAKE_CURRENT_BINARY_DIR}/${ZLIB_RELATIVE_PATH}")
# help libzip find the package
set(ZLIB_FOUND TRUE)
set(ZLIB_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/core/deps/libchdr/deps/zlib-1.3.1")
cmake_policy(SET CMP0026 OLD)
get_target_property(ZLIB_LIBRARY zlib LOCATION)
set(ZLIB_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/${ZLIB_RELATIVE_PATH}" "${CMAKE_CURRENT_BINARY_DIR}/${ZLIB_RELATIVE_PATH}")

cmake_policy(SET CMP0026 OLD)
get_target_property(ZLIB_LIBRARY_RELEASE zlibstatic LOCATION)
get_target_property(ZLIB_LIBRARY_DEBUG zlibstatic LOCATION_Debug)
endif()

find_package(PkgConfig)
Expand Down

0 comments on commit 09d702f

Please sign in to comment.