wut/tools/libraries/CMakeLists.txt

38 lines
1.1 KiB
CMake
Raw Normal View History

2018-06-15 09:08:46 +02:00
include(CheckTypeSize)
2018-05-23 13:35:24 +02:00
# excmd
add_library(excmd INTERFACE)
target_include_directories(excmd INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/excmd/src")
# fmt
2018-05-23 00:08:13 +02:00
add_subdirectory(fmt)
2018-05-25 14:54:17 +02:00
# zlib
find_package(ZLIB QUIET)
if(NOT ZLIB_FOUND)
2018-05-25 15:48:13 +02:00
# Disable zlib install
set(SKIP_INSTALL_ALL 1)
set(BUILD_SHARED_LIBS OFF)
2018-05-25 14:54:17 +02:00
add_subdirectory(zlib)
2018-06-15 09:08:46 +02:00
# Fix zlib tool / example includes
target_include_directories(example PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/zlib")
target_include_directories(minigzip PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/zlib")
check_type_size(off64_t OFF64_T)
if(HAVE_OFF64_T)
target_include_directories(example64 PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/zlib")
target_include_directories(minigzip64 PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/zlib")
endif()
target_include_directories(zlibstatic INTERFACE
2018-05-25 14:54:17 +02:00
"${CMAKE_CURRENT_SOURCE_DIR}/zlib"
"${CMAKE_CURRENT_BINARY_DIR}/zlib")
else()
# Not actually static, but who cares...
add_library(zlibstatic INTERFACE)
target_link_libraries(zlibstatic INTERFACE ${ZLIB_LIBRARIES})
target_include_directories(zlibstatic INTERFACE ${ZLIB_INCLUDE_DIR})
2018-05-25 14:54:17 +02:00
endif()