Skip to content

Commit

Permalink
Cleanup in requirements and in cmake also edited readme to help with …
Browse files Browse the repository at this point in the history
…getting ZeroMQ & czmq
  • Loading branch information
Black-Speedy committed Jan 14, 2024
1 parent c42d9e7 commit b422765
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 44 deletions.
65 changes: 25 additions & 40 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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)
Expand All @@ -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)
29 changes: 28 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -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
```
2 changes: 0 additions & 2 deletions WebShare-Connect/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions requirementsLinux(Ubuntu).txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
libzmq3-dev
libcmzq-dev
libssl-dev
libnice-dev
1 change: 0 additions & 1 deletion requirementsWindows.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
czmq
openssl
pkgconf
libnice

0 comments on commit b422765

Please sign in to comment.