sourcey / libsourcey

C++14 evented IO libraries for high performance networking and media based applications
https://sourcey.com/libsourcey
GNU Lesser General Public License v2.1
1.32k stars 350 forks source link

Problem with finding uv.h #236

Open arkadiuk opened 6 years ago

arkadiuk commented 6 years ago

Hi, When I tried to compile one of examples projects (deviceEnumerator.cpp) I got this error

### MESSAGE: Entering directory `/home/ak/TestProgram/'
/bin/sh -c '/usr/bin/make -j 4'
----------Building project:[ Pierwszy - Debug ]----------
-- Could NOT find LIBUV (missing:  LIBUV_LIBRARIES LIBUV_INCLUDE_DIR)
-- Could NOT find HTTPPARSER (missing:  HTTPPARSER_LIBRARIES HTTPPARSER_INCLUDE_DIR)
-- Configuring done
-- Generating done
-- Build files have been written to: /home/ak/TestProgram
[ 50%] Building CXX object CMakeFiles/First.dir/src/Main.cpp.o
In file included from /usr/local/include/scy/logger.h:17:0,
                 from /home/ak/TestProgram/src/Main.cpp:2:
/usr/local/include/scy/error.h:18:16: fatal error: uv.h: No such file or directory
compilation terminated.
CMakeFiles/First.dir/build.make:62: recipe for target 'CMakeFiles/First.dir/src/Main.cpp.o' failed
make[2]: *** [CMakeFiles/First.dir/src/Main.cpp.o] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/First.dir/all' failed
make[1]: *** [CMakeFiles/First.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2
====1 errors, 1 warnings====

Here is my CMakeLists:


cmake_minimum_required (VERSION 2.8)
project (First)
include(FindPackageHandleStandardArgs)

set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Werror -std=c++14")
set (source_dir "${PROJECT_SOURCE_DIR}/src/")

set(LibSourcey_ROOT_DIR "/usr/local/share/libsourcey")
find_package_handle_standard_args(LibSourcey DEFAULT_MSG LibSourcey_ROOT_DIR)

set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${LibSourcey_ROOT_DIR}/cmake)
set(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} ${LibSourcey_ROOT_DIR}/cmake)

find_package(LibSourcey COMPONENTS uv base REQUIRED)

file (GLOB source_files "${source_dir}/*.cpp")

add_executable (First ${source_files})

I am running Ubuntu 16.04 distro. Could someone help and tell me what am i missing ?

Thank you in advance.

arkadiuk commented 6 years ago

So, The problem was with my directory I've pointed to : set(LibSourcey_ROOT_DIR "/usr/local/share/libsourcey") I've changed it to /home//libsourcey What is more i added to my CMakeLists include_directories("${LibSourcey_INCLUDE_DIRS}") defined in FindLibSourcey.cmake file.

Now to overdue other problem with unknown references I have to include also

#  LibSourcey_DEFINITIONS   - Compiler switches required for using the required components.
- #  LibSourcey_LIBRARY_DIRS  - Library directories necessary for using the required components.
- #  LibSourcey_LIBRARIES     - Link these to use the required components.

Unfortunately I don't see any references to these variables in find*.cmake so I have to define them on my own.

Could anyone help me with this problem I have builded my project in /home//libsourcey and I have also files in /usr/local/share/libsourcey (from sudo make install ?) What path do I have to specify to include all files from LibSourcey to my own Project ?

arkadiuk commented 6 years ago

Accidentally I closed the Issue

traw commented 6 years ago

We need to provide following variables to cmake command LibSourcey_ROOT_DIR=$LibSourcey_INSTALL_DIR -DLibSourcey_INCLUDE_DIR=$LibSourcey_INCLUDE_DIR -DLibSourcey_LIBRARY_DIR=$LibSourcey_LIB_DIR

Root and include dir points to headers location and Lib dir points to location of lib files