diff --git a/CMakeLists.txt b/CMakeLists.txt index dce0630..3e7f652 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,9 +14,10 @@ if(MSVC) add_compile_options("$<$:/execution-charset:utf-8>") endif() -FILE(GLOB HEADERS ./*.h) -FILE(GLOB COMMON_SOURCES cJSON.cpp aes.cpp main.cpp ncmcrypt.cpp) -FILE(GLOB WIN_SOURCES win32_init.cpp) +FILE(GLOB HEADERS ./src/include/*.h) +FILE(GLOB COMMON_SOURCES ./src/*.cpp ./src/utils/*.cpp) +FILE(GLOB WIN_SOURCES ./src/platform/win32_init.cpp) + if(WIN32) set(SOURCES ${COMMON_SOURCES} ${WIN_SOURCES}) @@ -27,6 +28,9 @@ add_executable(ncmdump ${HEADERS} ${SOURCES} ) + +target_include_directories(ncmdump PRIVATE src/include) + target_link_libraries(ncmdump tag) target_include_directories(ncmdump PRIVATE taglib) target_include_directories(ncmdump PRIVATE taglib/taglib) diff --git a/aes.h b/src/include/aes.h similarity index 100% rename from aes.h rename to src/include/aes.h diff --git a/base64.h b/src/include/base64.h similarity index 100% rename from base64.h rename to src/include/base64.h diff --git a/cJSON.h b/src/include/cJSON.h similarity index 100% rename from cJSON.h rename to src/include/cJSON.h diff --git a/color.h b/src/include/color.h similarity index 100% rename from color.h rename to src/include/color.h diff --git a/ncmcrypt.h b/src/include/ncmcrypt.h similarity index 100% rename from ncmcrypt.h rename to src/include/ncmcrypt.h diff --git a/platform.h b/src/include/platform.h similarity index 100% rename from platform.h rename to src/include/platform.h diff --git a/main.cpp b/src/main.cpp similarity index 97% rename from main.cpp rename to src/main.cpp index 96e9d1a..7d8bfc5 100644 --- a/main.cpp +++ b/src/main.cpp @@ -77,7 +77,7 @@ int main(int argc, char **argv) #define COMPARE_STR(s1, s2) (strcmp(s1, s2) == 0) #define HELP_SHORT "-h" #define HELP_LONG "--help" -#define FOLDER "-d" +#define PROCESS_FOLDER "-d" for (int i = 1; i < argc; ++i) { if (COMPARE_STR(argv[i], HELP_SHORT) || COMPARE_STR(argv[i], HELP_LONG)) @@ -85,7 +85,7 @@ int main(int argc, char **argv) displayHelp(); return 0; } - else if (COMPARE_STR(argv[i], FOLDER)) + else if (COMPARE_STR(argv[i], PROCESS_FOLDER)) { processFolders = true; if (i + 1 < argc && argv[i + 1][0] != '-') diff --git a/ncmcrypt.cpp b/src/ncmcrypt.cpp similarity index 100% rename from ncmcrypt.cpp rename to src/ncmcrypt.cpp diff --git a/win32_init.cpp b/src/platform/win32_init.cpp similarity index 100% rename from win32_init.cpp rename to src/platform/win32_init.cpp diff --git a/aes.cpp b/src/utils/aes.cpp similarity index 100% rename from aes.cpp rename to src/utils/aes.cpp diff --git a/cJSON.cpp b/src/utils/cJSON.cpp similarity index 100% rename from cJSON.cpp rename to src/utils/cJSON.cpp