Re: Is this the rigth way to build a shared library?
On Thu, 2019-06-27 at 22:24 -0700, dexter810 wrote:
> This is my CMakeLists.txt which is successfully building a shared
> library, I
> just wanted to confirm if it's the right way and it:
> cmake_minimum_required(VERSION 3.6)
> add_library(main SHARED main.cpp)
> link_libraries (
> yaracpp yara pthread ssl crypto)
Rather than specifying -L flags and specifying library names, there are
two other approaches you can take that would be better:
1) Use target_link_directories() in conjunction with
2) Use find_package(Threads) to find pthread, and use find_library()
for everything else.