Closed marcus-sonestedt closed 2 years ago
@miq @simonschmeisser any comments on this? If not, I will merge it in the next few days and prepend a "cmake: " prefix to the commit message subject line
Ok for me.
Setting link libraries globally is bad style. In #154 we already added this as a dependency on libads
which should be applied transitively to all consumers of libads
. Maybe @marcusl could add a PR description stating which error he wants to fix?
@simonschmeisser Ah. I got the errors for the tools & example executables, and the libs for adslib are linked with PRIVATE. Maybe we only need to change that to PUBLIC to make it transitive (since the lib is static, any dependencies on other libs need to be public).
I'll test that and update this PR. Thanks for the quick feedback everyone!
Marking it as public worked. Not sure why I didn't have that change in my repo though, but diff looks ok now.
Any comments on the latest change? @marcusl maybe it helps if you rebase this on latest master
The diff looks small enough, and no conflicts, so should be good for a squash-merge. But I can rebase if you think it helps.
rebased on latest master
I don't know why wsock32
library is needed but ws2_32
should be required on win32 regardless of the compiler being used.
in #154 it was stated that it's only needed with msvc but I have no further knowledge or interest on this exotic platform
in #154 it was stated that it's only needed with msvc but I have no further knowledge or interest on this exotic platform
I suppose the compiler (MSVC) was used as the discriminator between Windows and Unix, rather than some OS modifier. (I'm no cmake wizard, yet. ;-) )
We're using Windows temporarily since TwinCAT/NCI is not yet available for TwinCAT/BSD.
This fixes linking of the executables (adstool, example), as well as any other consumers of adstool, even outside this repo, on Windows.