diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..db0ce5a --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,20 @@ +cmake_minimum_required(VERSION 2.8.9) +project (BinExtractor) +file(GLOB SRC_FILES ${PROJECT_SOURCE_DIR}/src/*.c) +include_directories( ${PROJECT_SOURCE_DIR}/src/) +add_executable(BinExtractor ${SRC_FILES}) +if (WIN32) + if(NOT EXISTS ${PROJECT_SOURCE_DIR}/src/dirent.h) + file(DOWNLOAD "https://raw.githubusercontent.com/tronkko/dirent/master/include/dirent.h" ${PROJECT_SOURCE_DIR}/src/dirent.h SHOW_PROGRESS STATUS status) + list(GET status 0 status_code) + list(GET status 1 status_string) + if(NOT status_code EQUAL 0) + message(WARN "error: downloading failed + status_code: ${status_code} + status_string: ${status_string}") + else() + message("Download succeeded") + endif() + endif() +endif() +#set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -c -Wall -std=c89 -pedantic -O2") \ No newline at end of file diff --git a/src/BinExtractor.c b/src/BinExtractor.c index 8aec47e..70a7825 100644 --- a/src/BinExtractor.c +++ b/src/BinExtractor.c @@ -13,7 +13,12 @@ #include "APHeader.h" #include -#include +#ifdef _WIN32 + #include +#else + #include +#endif // DEBUG + #include int main(int argc, char* args[])