From b4227652cfe84aaff6145eaf071b95de62e972a1 Mon Sep 17 00:00:00 2001 From: Black Speedy <78355795+Black-Speedy@users.noreply.github.com> Date: Sun, 14 Jan 2024 03:36:14 +0100 Subject: [PATCH] Cleanup in requirements and in cmake also edited readme to help with getting ZeroMQ & czmq --- CMakeLists.txt | 65 +++++++++++++-------------------- README.md | 29 ++++++++++++++- WebShare-Connect/CMakeLists.txt | 2 - requirementsLinux(Ubuntu).txt | 4 ++ requirementsWindows.txt | 1 - 5 files changed, 57 insertions(+), 44 deletions(-) create mode 100644 requirementsLinux(Ubuntu).txt diff --git a/CMakeLists.txt b/CMakeLists.txt index cf92e68..a6f5449 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,4 @@ -# CMakeList.txt : Top-level CMake project file, do global configuration -# and include sub-projects here. -# -cmake_minimum_required (VERSION 3.8) +cmake_minimum_required(VERSION 3.8) if(WIN32) # Set the vcpkg toolchain file if vcpkg is being used @@ -10,6 +7,7 @@ if(WIN32) CACHE STRING "") endif() endif() + # Enable Hot Reload for MSVC compilers if supported. if (POLICY CMP0141) cmake_policy(SET CMP0141 NEW) @@ -20,46 +18,33 @@ project(WebShare-Connect LANGUAGES C VERSION 0.0.1) - set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/") -find_package(LibNice REQUIRED) -message("LibNice_FOUND: ${LibNice_FOUND}") -if(WIN32) - find_package(ZeroMQ CONFIG REQUIRED) - message("ZeroMQ_FOUND: ${ZeroMQ_FOUND}") - message("ZeroMQ_VERSION: ${ZeroMQ_VERSION}") - find_package(czmq CONFIG REQUIRED) - message("czmq_FOUND: ${czmq_FOUND}") -message("czmq_VERSION: ${czmq_VERSION}") -elseif(UNIX AND NOT APPLE) - - find_package(PkgConfig REQUIRED) - message(STATUS "PkgConfig found: ${PKG_CONFIG_FOUND}") - - set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "/usr/local/lib/cmake/") - - set(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH}"/usr/include") - pkg_check_modules(czmq REQUIRED libczmq) - message("CZMQ Dir" ${czmq_INCLUDE_DIRS}) - message("CZMQ Lib" ${czmq_LIBRARIES}) - message("czmq_FOUND: ${czmq_FOUND}") - message("czmq_VERSION: ${czmq_VERSION}") - - set(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH}"/usr/include") - find_package(ZeroMQ CONFIG REQUIRED) - message("ZeroMQ Dir" ${ZeroMQ_INCLUDE_DIRS}) - message("ZeroMQ Lib" ${ZeroMQ_LIBRARIES}) - message("ZeroMQ_FOUND: ${ZeroMQ_FOUND}") - message("ZeroMQ_VERSION: ${ZeroMQ_VERSION}") +message("Finding library ZeroMQ / libzmq") +find_package(ZeroMQ CONFIG REQUIRED) +if(ZeroMQ_FOUND) + message("ZeroMQ Found: TRUE") + message("ZeroMq Version: ${ZeroMQ_VERSION}") endif() +message("Finding library czmq") +find_package(czmq CONFIG REQUIRED) +if(czmq_FOUND) + message("czmq Found: TRUE") + message("czmq Version: ${czmq_VERSION}") +endif() +message("Finding library OpenSSL") find_package(OpenSSL REQUIRED) -#set(OPENSSL_INCLUDE_DIR "${OPENSSL_INCLUDE_DIR}/openssl") -message("OPENSSL_FOUND: ${OPENSSL_FOUND}") - - - +if(OPENSSL_FOUND) + message("OPENSSL Found: " ${OPENSSL_FOUND}) + message("OPENSSL Version: ${OPENSSL_VERSION}") +endif() +message("Finding library LibNice") +find_package(LibNice REQUIRED) +if(LibNice_FOUND) + message("LibNice Found: " ${LibNice_FOUND}) + message("LibNice Version: ${LibNice_VERSION}") +endif() # Include sub-projects. -add_subdirectory ("WebShare-Connect") +add_subdirectory("WebShare-Connect") # Link libraries to your project (replace 'your_target_name' with the actual target name) # target_link_libraries(your_target_name PRIVATE czmq ZeroMQ::ZeroMQ) diff --git a/README.md b/README.md index 16cf331..d85dc68 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,29 @@ -# WebShare-Connect +## WebShare-Connect A program that transfer of files of any size over the web + +## Having trouble getting ZeroMQ and czmq on Linux? +Note for building below. +You can clone the repository to any location. +Make install will put the files into the correct locations. +# To build ZeroMQ follow the steps: +``` +git clone https://github.com/zeromq/libzmq.git +cd libzmq +mkdir build +cd build +cmake .. +make +sudo make install + +``` +# To build czmq follow the steps: +``` +git clone https://github.com/zeromq/czmq.git +cd czmq +mkdir build +cd build +cmake .. +make +sudo make install + +``` \ No newline at end of file diff --git a/WebShare-Connect/CMakeLists.txt b/WebShare-Connect/CMakeLists.txt index dfee30c..af00681 100644 --- a/WebShare-Connect/CMakeLists.txt +++ b/WebShare-Connect/CMakeLists.txt @@ -35,8 +35,6 @@ add_library(removeQuotes "removeQuotes.c" "removeQuotes.h") # Include the OpenSSL include directory include_directories(${OPENSSL_INCLUDE_DIR}) -include_directories(${ZMQ_INCLUDE_DIRS}) -message("ZMQ_INCLUDE_DIRS: ${ZMQ_INCLUDE_DIRS}") # Link against libraries target_link_libraries(WebShare-Connect PRIVATE diff --git a/requirementsLinux(Ubuntu).txt b/requirementsLinux(Ubuntu).txt new file mode 100644 index 0000000..36feb64 --- /dev/null +++ b/requirementsLinux(Ubuntu).txt @@ -0,0 +1,4 @@ +libzmq3-dev +libcmzq-dev +libssl-dev +libnice-dev diff --git a/requirementsWindows.txt b/requirementsWindows.txt index ddb75cc..8bb4093 100644 --- a/requirementsWindows.txt +++ b/requirementsWindows.txt @@ -1,4 +1,3 @@ czmq openssl -pkgconf libnice