From 22c8d84b1e4058fddd6feb3de564b494d4dc4b63 Mon Sep 17 00:00:00 2001 From: Sandu Liviu Catalin Date: Sat, 21 Mar 2020 22:00:02 +0200 Subject: [PATCH] More work on Cmake scripts. --- external/B64/CMakeLists.txt | 0 external/Hash/CMakeLists.txt | 0 source/CMakeLists.txt | 2 +- source/Library/Crypt/AES256/CMakeLists.txt | 7 +++++++ .../Library/Crypt/AES256}/aes256.cpp | 0 .../Library/Crypt/AES256/include}/aes256.h | 0 source/Library/Crypt/B64/CMakeLists.txt | 7 +++++++ {external => source/Library/Crypt}/B64/LICENSE | 0 {external => source/Library/Crypt}/B64/decode.c | 2 +- {external => source/Library/Crypt}/B64/encode.c | 2 +- .../Library/Crypt/B64/include}/b64.h | 0 source/Library/Crypt/Hash/CMakeLists.txt | 17 +++++++++++++++++ .../Library/Crypt}/Hash/crc32.cpp | 0 .../Library/Crypt}/Hash/digest.cpp | 0 .../Library/Crypt}/Hash/hash_license.txt | 0 .../Library/Crypt/Hash/include}/crc32.h | 0 .../Library/Crypt/Hash/include}/hash.h | 0 .../Library/Crypt/Hash/include}/hmac.h | 0 .../Library/Crypt/Hash/include}/keccak.h | 0 .../Library/Crypt/Hash/include}/md5.h | 0 .../Library/Crypt/Hash/include}/sha1.h | 0 .../Library/Crypt/Hash/include}/sha256.h | 0 .../Library/Crypt/Hash/include}/sha3.h | 0 .../Library/Crypt}/Hash/keccak.cpp | 0 {external => source/Library/Crypt}/Hash/md5.cpp | 0 .../Library/Crypt}/Hash/sha1.cpp | 0 .../Library/Crypt}/Hash/sha256.cpp | 0 .../Library/Crypt}/Hash/sha3.cpp | 0 source/Library/Crypt/Whirlpool/CMakeLists.txt | 13 +++++++++++++ .../Library/Crypt/Whirlpool}/byte_order.c | 0 .../Library/Crypt/Whirlpool}/byte_order.h | 0 .../Library/Crypt/Whirlpool/include}/ustd.h | 0 .../Crypt/Whirlpool/include}/whirlpool.h | 0 .../Library/Crypt/Whirlpool}/whirlpool.c | 0 .../Library/Crypt/Whirlpool}/whirlpool_sbox.c | 0 .../Library/IO/SimpleIni}/ConvertUTF.cpp | 0 .../Library/IO/SimpleIni}/LICENCE.txt | 0 .../Library/IO/SimpleIni/include}/ConvertUTF.h | 0 .../Library/IO/SimpleIni/include}/SimpleIni.h | 0 sqrat/CMakeLists.txt | 2 +- squirrel/CMakeLists.txt | 2 +- 41 files changed, 49 insertions(+), 5 deletions(-) delete mode 100644 external/B64/CMakeLists.txt delete mode 100644 external/Hash/CMakeLists.txt create mode 100644 source/Library/Crypt/AES256/CMakeLists.txt rename {external/Common => source/Library/Crypt/AES256}/aes256.cpp (100%) rename {include => source/Library/Crypt/AES256/include}/aes256.h (100%) create mode 100644 source/Library/Crypt/B64/CMakeLists.txt rename {external => source/Library/Crypt}/B64/LICENSE (100%) rename {external => source/Library/Crypt}/B64/decode.c (99%) rename {external => source/Library/Crypt}/B64/encode.c (99%) rename {include => source/Library/Crypt/B64/include}/b64.h (100%) create mode 100644 source/Library/Crypt/Hash/CMakeLists.txt rename {external => source/Library/Crypt}/Hash/crc32.cpp (100%) rename {external => source/Library/Crypt}/Hash/digest.cpp (100%) rename {external => source/Library/Crypt}/Hash/hash_license.txt (100%) rename {external/Hash => source/Library/Crypt/Hash/include}/crc32.h (100%) rename {external/Hash => source/Library/Crypt/Hash/include}/hash.h (100%) rename {external/Hash => source/Library/Crypt/Hash/include}/hmac.h (100%) rename {external/Hash => source/Library/Crypt/Hash/include}/keccak.h (100%) rename {external/Hash => source/Library/Crypt/Hash/include}/md5.h (100%) rename {external/Hash => source/Library/Crypt/Hash/include}/sha1.h (100%) rename {external/Hash => source/Library/Crypt/Hash/include}/sha256.h (100%) rename {external/Hash => source/Library/Crypt/Hash/include}/sha3.h (100%) rename {external => source/Library/Crypt}/Hash/keccak.cpp (100%) rename {external => source/Library/Crypt}/Hash/md5.cpp (100%) rename {external => source/Library/Crypt}/Hash/sha1.cpp (100%) rename {external => source/Library/Crypt}/Hash/sha256.cpp (100%) rename {external => source/Library/Crypt}/Hash/sha3.cpp (100%) create mode 100644 source/Library/Crypt/Whirlpool/CMakeLists.txt rename {external/Common => source/Library/Crypt/Whirlpool}/byte_order.c (100%) rename {external/Common => source/Library/Crypt/Whirlpool}/byte_order.h (100%) rename {external/Common => source/Library/Crypt/Whirlpool/include}/ustd.h (100%) rename {include => source/Library/Crypt/Whirlpool/include}/whirlpool.h (100%) rename {external/Common => source/Library/Crypt/Whirlpool}/whirlpool.c (100%) rename {external/Common => source/Library/Crypt/Whirlpool}/whirlpool_sbox.c (100%) rename {external/Common => source/Library/IO/SimpleIni}/ConvertUTF.cpp (100%) rename {external/SimpleINI => source/Library/IO/SimpleIni}/LICENCE.txt (100%) rename {include => source/Library/IO/SimpleIni/include}/ConvertUTF.h (100%) rename {include => source/Library/IO/SimpleIni/include}/SimpleIni.h (100%) diff --git a/external/B64/CMakeLists.txt b/external/B64/CMakeLists.txt deleted file mode 100644 index e69de29b..00000000 diff --git a/external/Hash/CMakeLists.txt b/external/Hash/CMakeLists.txt deleted file mode 100644 index e69de29b..00000000 diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt index e2d8e9d5..6b8bca69 100644 --- a/source/CMakeLists.txt +++ b/source/CMakeLists.txt @@ -1,4 +1,4 @@ -# +# Create the Squirrel module add_library(SquirrelModule MODULE SqBase.hpp Main.cpp diff --git a/source/Library/Crypt/AES256/CMakeLists.txt b/source/Library/Crypt/AES256/CMakeLists.txt new file mode 100644 index 00000000..4e593c00 --- /dev/null +++ b/source/Library/Crypt/AES256/CMakeLists.txt @@ -0,0 +1,7 @@ +# Create the AES256Lib library +add_library(AES256Lib STATIC include/aes256.h aes256.cpp) +# Configure include folders +target_include_directories(AES256Lib PRIVATE ${CMAKE_CURRENT_LIST_DIR}) +target_include_directories(AES256Lib PUBLIC ${CMAKE_CURRENT_LIST_DIR}/include) +# Configure build options +target_compile_definitions(AES256Lib PRIVATE ) diff --git a/external/Common/aes256.cpp b/source/Library/Crypt/AES256/aes256.cpp similarity index 100% rename from external/Common/aes256.cpp rename to source/Library/Crypt/AES256/aes256.cpp diff --git a/include/aes256.h b/source/Library/Crypt/AES256/include/aes256.h similarity index 100% rename from include/aes256.h rename to source/Library/Crypt/AES256/include/aes256.h diff --git a/source/Library/Crypt/B64/CMakeLists.txt b/source/Library/Crypt/B64/CMakeLists.txt new file mode 100644 index 00000000..05da8201 --- /dev/null +++ b/source/Library/Crypt/B64/CMakeLists.txt @@ -0,0 +1,7 @@ +# Create the B64Lib library +add_library(B64Lib STATIC include/b64.h decode.c decode.c) +# Configure include folders +target_include_directories(B64Lib PRIVATE ${CMAKE_CURRENT_LIST_DIR}) +target_include_directories(B64Lib PUBLIC ${CMAKE_CURRENT_LIST_DIR}/include) +# Configure build options +target_compile_definitions(B64Lib PRIVATE ) diff --git a/external/B64/LICENSE b/source/Library/Crypt/B64/LICENSE similarity index 100% rename from external/B64/LICENSE rename to source/Library/Crypt/B64/LICENSE diff --git a/external/B64/decode.c b/source/Library/Crypt/B64/decode.c similarity index 99% rename from external/B64/decode.c rename to source/Library/Crypt/B64/decode.c index ff26b0e3..e58034b5 100644 --- a/external/B64/decode.c +++ b/source/Library/Crypt/B64/decode.c @@ -8,7 +8,7 @@ #include #include #include -#include "b64.h" +#include unsigned char * diff --git a/external/B64/encode.c b/source/Library/Crypt/B64/encode.c similarity index 99% rename from external/B64/encode.c rename to source/Library/Crypt/B64/encode.c index 0c8aca82..b8a54854 100644 --- a/external/B64/encode.c +++ b/source/Library/Crypt/B64/encode.c @@ -7,7 +7,7 @@ #include #include -#include "b64.h" +#include char * b64_encode (const unsigned char *src, size_t len) { diff --git a/include/b64.h b/source/Library/Crypt/B64/include/b64.h similarity index 100% rename from include/b64.h rename to source/Library/Crypt/B64/include/b64.h diff --git a/source/Library/Crypt/Hash/CMakeLists.txt b/source/Library/Crypt/Hash/CMakeLists.txt new file mode 100644 index 00000000..bc521794 --- /dev/null +++ b/source/Library/Crypt/Hash/CMakeLists.txt @@ -0,0 +1,17 @@ +# Create the HashLib library +add_library(HashLib STATIC + include/hash.h + include/hmac.h + include/crc32.h crc32.cpp + include/keccak.h keccak.cpp + include/md5.h md5.cpp + include/sha1.h sha1.cpp + include/sha3.h sha3.cpp + include/sha256.h sha256.cpp + digest.cpp +) +# Configure include folders +target_include_directories(HashLib PRIVATE ${CMAKE_CURRENT_LIST_DIR}) +target_include_directories(HashLib PUBLIC ${CMAKE_CURRENT_LIST_DIR}/include) +# Configure build options +target_compile_definitions(HashLib PRIVATE ) diff --git a/external/Hash/crc32.cpp b/source/Library/Crypt/Hash/crc32.cpp similarity index 100% rename from external/Hash/crc32.cpp rename to source/Library/Crypt/Hash/crc32.cpp diff --git a/external/Hash/digest.cpp b/source/Library/Crypt/Hash/digest.cpp similarity index 100% rename from external/Hash/digest.cpp rename to source/Library/Crypt/Hash/digest.cpp diff --git a/external/Hash/hash_license.txt b/source/Library/Crypt/Hash/hash_license.txt similarity index 100% rename from external/Hash/hash_license.txt rename to source/Library/Crypt/Hash/hash_license.txt diff --git a/external/Hash/crc32.h b/source/Library/Crypt/Hash/include/crc32.h similarity index 100% rename from external/Hash/crc32.h rename to source/Library/Crypt/Hash/include/crc32.h diff --git a/external/Hash/hash.h b/source/Library/Crypt/Hash/include/hash.h similarity index 100% rename from external/Hash/hash.h rename to source/Library/Crypt/Hash/include/hash.h diff --git a/external/Hash/hmac.h b/source/Library/Crypt/Hash/include/hmac.h similarity index 100% rename from external/Hash/hmac.h rename to source/Library/Crypt/Hash/include/hmac.h diff --git a/external/Hash/keccak.h b/source/Library/Crypt/Hash/include/keccak.h similarity index 100% rename from external/Hash/keccak.h rename to source/Library/Crypt/Hash/include/keccak.h diff --git a/external/Hash/md5.h b/source/Library/Crypt/Hash/include/md5.h similarity index 100% rename from external/Hash/md5.h rename to source/Library/Crypt/Hash/include/md5.h diff --git a/external/Hash/sha1.h b/source/Library/Crypt/Hash/include/sha1.h similarity index 100% rename from external/Hash/sha1.h rename to source/Library/Crypt/Hash/include/sha1.h diff --git a/external/Hash/sha256.h b/source/Library/Crypt/Hash/include/sha256.h similarity index 100% rename from external/Hash/sha256.h rename to source/Library/Crypt/Hash/include/sha256.h diff --git a/external/Hash/sha3.h b/source/Library/Crypt/Hash/include/sha3.h similarity index 100% rename from external/Hash/sha3.h rename to source/Library/Crypt/Hash/include/sha3.h diff --git a/external/Hash/keccak.cpp b/source/Library/Crypt/Hash/keccak.cpp similarity index 100% rename from external/Hash/keccak.cpp rename to source/Library/Crypt/Hash/keccak.cpp diff --git a/external/Hash/md5.cpp b/source/Library/Crypt/Hash/md5.cpp similarity index 100% rename from external/Hash/md5.cpp rename to source/Library/Crypt/Hash/md5.cpp diff --git a/external/Hash/sha1.cpp b/source/Library/Crypt/Hash/sha1.cpp similarity index 100% rename from external/Hash/sha1.cpp rename to source/Library/Crypt/Hash/sha1.cpp diff --git a/external/Hash/sha256.cpp b/source/Library/Crypt/Hash/sha256.cpp similarity index 100% rename from external/Hash/sha256.cpp rename to source/Library/Crypt/Hash/sha256.cpp diff --git a/external/Hash/sha3.cpp b/source/Library/Crypt/Hash/sha3.cpp similarity index 100% rename from external/Hash/sha3.cpp rename to source/Library/Crypt/Hash/sha3.cpp diff --git a/source/Library/Crypt/Whirlpool/CMakeLists.txt b/source/Library/Crypt/Whirlpool/CMakeLists.txt new file mode 100644 index 00000000..545847cb --- /dev/null +++ b/source/Library/Crypt/Whirlpool/CMakeLists.txt @@ -0,0 +1,13 @@ +# Create the WhirlpoolLib library +add_library(WhirlpoolLib STATIC + include/ustd.h + include/whirlpool.h + byte_order.h byte_order.c + whirlpool.c.c + whirlpool_sbox.c +) +# Configure include folders +target_include_directories(WhirlpoolLib PRIVATE ${CMAKE_CURRENT_LIST_DIR}) +target_include_directories(WhirlpoolLib PUBLIC ${CMAKE_CURRENT_LIST_DIR}/include) +# Configure build options +target_compile_definitions(WhirlpoolLib PRIVATE ) diff --git a/external/Common/byte_order.c b/source/Library/Crypt/Whirlpool/byte_order.c similarity index 100% rename from external/Common/byte_order.c rename to source/Library/Crypt/Whirlpool/byte_order.c diff --git a/external/Common/byte_order.h b/source/Library/Crypt/Whirlpool/byte_order.h similarity index 100% rename from external/Common/byte_order.h rename to source/Library/Crypt/Whirlpool/byte_order.h diff --git a/external/Common/ustd.h b/source/Library/Crypt/Whirlpool/include/ustd.h similarity index 100% rename from external/Common/ustd.h rename to source/Library/Crypt/Whirlpool/include/ustd.h diff --git a/include/whirlpool.h b/source/Library/Crypt/Whirlpool/include/whirlpool.h similarity index 100% rename from include/whirlpool.h rename to source/Library/Crypt/Whirlpool/include/whirlpool.h diff --git a/external/Common/whirlpool.c b/source/Library/Crypt/Whirlpool/whirlpool.c similarity index 100% rename from external/Common/whirlpool.c rename to source/Library/Crypt/Whirlpool/whirlpool.c diff --git a/external/Common/whirlpool_sbox.c b/source/Library/Crypt/Whirlpool/whirlpool_sbox.c similarity index 100% rename from external/Common/whirlpool_sbox.c rename to source/Library/Crypt/Whirlpool/whirlpool_sbox.c diff --git a/external/Common/ConvertUTF.cpp b/source/Library/IO/SimpleIni/ConvertUTF.cpp similarity index 100% rename from external/Common/ConvertUTF.cpp rename to source/Library/IO/SimpleIni/ConvertUTF.cpp diff --git a/external/SimpleINI/LICENCE.txt b/source/Library/IO/SimpleIni/LICENCE.txt similarity index 100% rename from external/SimpleINI/LICENCE.txt rename to source/Library/IO/SimpleIni/LICENCE.txt diff --git a/include/ConvertUTF.h b/source/Library/IO/SimpleIni/include/ConvertUTF.h similarity index 100% rename from include/ConvertUTF.h rename to source/Library/IO/SimpleIni/include/ConvertUTF.h diff --git a/include/SimpleIni.h b/source/Library/IO/SimpleIni/include/SimpleIni.h similarity index 100% rename from include/SimpleIni.h rename to source/Library/IO/SimpleIni/include/SimpleIni.h diff --git a/sqrat/CMakeLists.txt b/sqrat/CMakeLists.txt index 9a143728..e3a4a715 100644 --- a/sqrat/CMakeLists.txt +++ b/sqrat/CMakeLists.txt @@ -7,7 +7,7 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") #target_compile_options(Sqrat PRIVATE -w #) endif() -# Configure macro options +# Configure build options target_compile_definitions(Sqrat INTERFACE GARBAGE_COLLECTOR=1) # Library includes target_include_directories(Sqrat INTERFACE ${CMAKE_CURRENT_LIST_DIR}) diff --git a/squirrel/CMakeLists.txt b/squirrel/CMakeLists.txt index 3a438ec7..0eba56ca 100644 --- a/squirrel/CMakeLists.txt +++ b/squirrel/CMakeLists.txt @@ -55,7 +55,7 @@ if (GCC OR MINGW) -Wno-unused-but-set-variable ) endif() -# Configure macro options +# Configure build options target_compile_definitions(Squirrel PRIVATE GARBAGE_COLLECTOR=1) # Library includes target_include_directories(Squirrel PRIVATE ${CMAKE_CURRENT_LIST_DIR})