Add zlib as a submodule.

This commit is contained in:
James Benton 2018-05-25 13:54:17 +01:00
parent cdc540938a
commit 17ea24cdb0
7 changed files with 22 additions and 13 deletions

3
.gitmodules vendored
View File

@ -4,3 +4,6 @@
[submodule "tools/libraries/excmd"]
path = tools/libraries/excmd
url = https://github.com/exjam/excmd.git
[submodule "tools/libraries/zlib"]
path = tools/libraries/zlib
url = https://github.com/madler/zlib.git

View File

@ -14,7 +14,6 @@ else()
endif()
add_subdirectory(libraries)
find_package(ZLIB REQUIRED)
include_directories(common)
add_subdirectory(elf2rpl)

View File

@ -6,11 +6,8 @@ file(GLOB_RECURSE HEADER_FILES *.h)
add_executable(elf2rpl
${SOURCE_FILES} ${HEADER_FILES})
target_include_directories(elf2rpl PRIVATE
${ZLIB_INCLUDE_DIR})
target_link_libraries(elf2rpl
fmt
${ZLIB_LIBRARIES})
zlib)
install(TARGETS elf2rpl RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}/bin")

View File

@ -4,3 +4,18 @@ target_include_directories(excmd INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/excmd/sr
# fmt
add_subdirectory(fmt)
# zlib
find_package(ZLIB QUIET)
if(NOT ZLIB_FOUND)
add_subdirectory(zlib)
target_include_directories(zlib INTERFACE
"${CMAKE_CURRENT_SOURCE_DIR}/zlib"
"${CMAKE_CURRENT_BINARY_DIR}/zlib")
else()
add_library(zlib INTERFACE)
target_link_libraries(zlib INTERFACE ${ZLIB_LIBRARIES})
target_include_directories(zlib INTERFACE ${ZLIB_INCLUDE_DIR})
endif()

1
tools/libraries/zlib Submodule

@ -0,0 +1 @@
Subproject commit cacf7f1d4e3d44d871b605da3b647f07d718623f

View File

@ -6,12 +6,9 @@ file(GLOB_RECURSE HEADER_FILES *.h)
add_executable(readrpl
${SOURCE_FILES} ${HEADER_FILES})
target_include_directories(readrpl PRIVATE
${ZLIB_INCLUDE_DIR})
target_link_libraries(readrpl
excmd
fmt
${ZLIB_LIBRARIES})
zlib)
install(TARGETS readrpl RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}/bin")

View File

@ -6,10 +6,7 @@ file(GLOB_RECURSE HEADER_FILES *.h)
add_executable(rplgen
${SOURCE_FILES} ${HEADER_FILES})
target_include_directories(rplgen PRIVATE
${ZLIB_INCLUDE_DIR})
target_link_libraries(rplgen
${ZLIB_LIBRARIES})
zlib)
install(TARGETS rplgen RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}/bin")