when trying to build i get this errors:
undefined reference to 'uuid_generate'
undefined reference to 'uuid_unparse'
this my CMakeLists.txt file:
cmake_minimum_required(VERSION 3.6)
project(Synergy)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -luuid -pthread")
find_package (Threads)
set(SOURCE_FILES Functions.cpp Inotify.cpp Inotify.h main.cpp Master.h Message.cpp Message.h Server.cpp Server.h Threads.cpp )
add_executable(synergy_server ${SOURCE_FILES})
I can solve this problem by creating Makefile by myself and add -luuid flag.
but I want to do it with CMake,I tried to add this flag in the CMakeLists.txt file but it doesn't help :(
I have installed uuid-dev(it's not the Problem )
Hope you can help me.
Have a nice day
edit:
I add target_link_libraries(Synergy uuid)
to the end of the file and it works, but there is a better way(look at the answers below)