diff --git a/CMakeLists.txt b/CMakeLists.txt index 960fcc5..8490a47 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,7 @@ project(libxiv) +include(FetchContent) + find_package(fmt QUIET) if(TARGET fmt::fmt) @@ -15,6 +17,8 @@ else() GIT_TAG master ) + set(BUILD_SHARED_LIBS OFF CACHE BOOL "" FORCE) + FetchContent_MakeAvailable(fmt) set(LIBRARIES fmt::fmt ${LIBRARIES}) @@ -41,16 +45,22 @@ else() GIT_TAG master ) + set(BUILD_SHARED_LIBS OFF CACHE BOOL "" FORCE) + FetchContent_MakeAvailable(zlib) - set(LIBRARIES zlib ${LIBRARIES}) -endif() + # welcome to hell, cmake. + include_directories(${CMAKE_BINARY_DIR}/_deps/zlib-src) + # NO REALLY, HELL IS THIS WAY + include_directories(${CMAKE_BINARY_DIR}/_deps/zlib-build) + set(LIBRARIES zlibstatic ${LIBRARIES}) +endif() add_library(libxiv STATIC src/fiinparser.cpp src/indexparser.cpp - src/crc32.cpp + src/crc32checksum.cpp src/gamedata.cpp src/compression.cpp src/exhparser.cpp diff --git a/include/crc32.h b/include/crc32checksum.h similarity index 100% rename from include/crc32.h rename to include/crc32checksum.h diff --git a/src/crc32.cpp b/src/crc32checksum.cpp similarity index 96% rename from src/crc32.cpp rename to src/crc32checksum.cpp index bda444b..6c5e544 100644 --- a/src/crc32.cpp +++ b/src/crc32checksum.cpp @@ -1,4 +1,4 @@ -#include "crc32.h" +#include "crc32checksum.h" void CRC32::generate_table(uint32_t(&table)[256]) { uint32_t polynomial = 0xEDB88320; diff --git a/src/gamedata.cpp b/src/gamedata.cpp index 68bbe0a..ccc5000 100644 --- a/src/gamedata.cpp +++ b/src/gamedata.cpp @@ -1,6 +1,6 @@ #include "gamedata.h" #include "indexparser.h" -#include "crc32.h" +#include "crc32checksum.h" #include "compression.h" #include "string_utils.h"