diff --git a/CMakeLists.txt b/CMakeLists.txt index e12f86f..02d5f71 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -243,5 +243,8 @@ target_link_libraries(fallout2-ce ) add_subdirectory("third_party/fpattern") +target_link_libraries(fallout2-ce ${FPATTERN_LIBRARY}) +target_include_directories(fallout2-ce PRIVATE ${FPATTERN_INCLUDE_DIR}) + add_subdirectory("third_party/zlib") add_subdirectory("third_party/sdl2") diff --git a/src/dfile.cc b/src/dfile.cc index 3595798..90a6b21 100644 --- a/src/dfile.cc +++ b/src/dfile.cc @@ -1,6 +1,6 @@ #include "dfile.h" -#include "fpattern.h" +#include #include #include diff --git a/third_party/fpattern/CMakeLists.txt b/third_party/fpattern/CMakeLists.txt index 1bb90aa..43f4153 100644 --- a/third_party/fpattern/CMakeLists.txt +++ b/third_party/fpattern/CMakeLists.txt @@ -10,10 +10,15 @@ if (NOT fpattern_POPULATED) FetchContent_Populate(fpattern) endif() -target_sources(fallout2-ce PUBLIC +if(MSVC) + set(CMAKE_DEBUG_POSTFIX "d") +endif() + +add_library(fpattern STATIC "${fpattern_SOURCE_DIR}/debug.h" "${fpattern_SOURCE_DIR}/fpattern.c" "${fpattern_SOURCE_DIR}/fpattern.h" ) -target_include_directories(fallout2-ce PUBLIC ${fpattern_SOURCE_DIR}) +set(FPATTERN_LIBRARY "fpattern" PARENT_SCOPE) +set(FPATTERN_INCLUDE_DIR "${fpattern_SOURCE_DIR}" PARENT_SCOPE)