Why Nostr? What is Njump?
2024-07-02 23:25:22

npub19q…84arj on Nostr: commit cdbe192243cba89189acd4ab1596271c3a412f55 Author: randymcmillan ...

commit cdbe192243cba89189acd4ab1596271c3a412f55
Author: randymcmillan <[email protected]>
Date: Mon May 20 19:47:55 2024 -0400

CMakeLists.txt

diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644
index 000000000..d5c847af7
--- /dev/null
+++ b/CMakeLists.txt
@@ -0,0 +1,77 @@
+if (MSVC)
+ cmake_minimum_required(VERSION 3.26)
+else()
+ cmake_minimum_required(VERSION 3.15)
+endif()
+set(CMAKE_BUILD_TYPE Debug)
+project (nostril C)
+
+include_directories(${CMAKE_SOURCE_DIR}/deps/secp256k1/include)
+add_subdirectory(${CMAKE_SOURCE_DIR}/deps/secp256k1)
+
+#//////////////////////////
+#windows.h header file has macros for min and max, nostril defines max
+#//////////////////////////
+
+if (MSVC)
+ add_definitions(-DNOMINMAX)
+ add_definitions(-D_CRT_SECURE_NO_WARNINGS)
+ add_definitions(-D_CRT_NONSTDC_NO_DEPRECATE)
+endif()
+
+#//////////////////////////
+#sources
+#//////////////////////////
+
+set(src ${src})
+set(src ${src} hex.h)
+set(src ${src} proof.h)
+set(src ${src} cursor.h)
+set(src ${src} endian.h)
+set(src ${src} random.h)
+set(src ${src} sha256.h)
+set(src ${src} sha256.c)
+set(src ${src} base64.h)
+set(src ${src} base64.c)
+set(src ${src} aes.h)
+set(src ${src} aes.c)
+if (MSVC)
+ set(src ${src} clock_gettime.h)
+endif()
+
+#//////////////////////////
+#link with libraries
+#lib_dep contains a cascade definition of all the libraries needed to link
+#//////////////////////////
+
+set(lib_dep ${lib_dep})
+set(lib_dep ${lib_dep} ${CMAKE_SOURCE_DIR}/deps/secp256k1/.libs/libsecp256k1.a)
+if (MSVC)
+ set(lib_dep ${lib_dep} ${CMAKE_SOURCE_DIR}/deps/secp256k1/src/Debug/libsecp256k1.lib)
+ set(lib_dep ${lib_dep} Bcrypt.lib)
+endif()
+
+
+#//////////////////////////
+#executables
+#//////////////////////////
+
+# tool to generate file 'config.h' , generate from a shell with
+# configurator.exe > config.h
+add_executable(configurator configurator.c)
+
+add_executable(nostril ${src} nostril.c)
+target_link_libraries (nostril ${lib_dep})
+
+#//////////////////////////
+# generate config.h
+#//////////////////////////
+
+add_custom_command(
+ TARGET configurator
+ POST_BUILD
+ COMMAND configurator > config.h
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_BINARY_DIR}/config.h" ${CMAKE_SOURCE_DIR}
+ COMMENT "generating config.h"
+)
+
Author Public Key
npub19qglzxuhawt488w0ctdnq8gxm33unske9dxp425z7gntvzu3ywwsg84arj