Skip to content

Commit

Permalink
Move code related to configuring Zlib and QuaZip to seperate .cmake f…
Browse files Browse the repository at this point in the history
…iles.
  • Loading branch information
przemek83 committed Dec 11, 2024
1 parent 619d51d commit a0f29ad
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 12 deletions.
14 changes: 2 additions & 12 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,8 @@ qt_standard_project_setup()
include(GNUInstallDirs)
include(CMakePackageConfigHelpers)

configure_file(CMakeLists.txt.zlib zlib/CMakeLists.txt)
execute_process(COMMAND ${CMAKE_COMMAND} -G ${CMAKE_GENERATOR} .
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/zlib)
execute_process(COMMAND ${CMAKE_COMMAND} --build .
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/zlib )

set(ZLIB_ROOT ${CMAKE_CURRENT_BINARY_DIR}/zlib/install)
find_package(ZLIB REQUIRED)
include_directories( ${CMAKE_CURRENT_BINARY_DIR}/zlib/install/include)

include(CMakeLists.txt.quazip)
include_directories(${CMAKE_CURRENT_BINARY_DIR}/_deps/quazip-src)
include(ZlibConfig.cmake)
include(QuaZipConfig.cmake)

set(${PROJECT_NAME}_SOURCES
src/EibleUtilities.h
Expand Down
2 changes: 2 additions & 0 deletions CMakeLists.txt.quazip → QuaZipConfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@ FetchContent_Declare(
)

FetchContent_MakeAvailable(QuaZip)

include_directories(${CMAKE_CURRENT_BINARY_DIR}/_deps/quazip-src)
9 changes: 9 additions & 0 deletions ZlibConfig.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
configure_file(CMakeLists.txt.zlib zlib/CMakeLists.txt)
execute_process(COMMAND ${CMAKE_COMMAND} -G ${CMAKE_GENERATOR} .
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/zlib)
execute_process(COMMAND ${CMAKE_COMMAND} --build .
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/zlib )

set(ZLIB_ROOT ${CMAKE_CURRENT_BINARY_DIR}/zlib/install)
find_package(ZLIB REQUIRED)
include_directories( ${CMAKE_CURRENT_BINARY_DIR}/zlib/install/include)

0 comments on commit a0f29ad

Please sign in to comment.