[DiscordArchive] does it mean that it can't find my .lib file because I use a relative path?
[DiscordArchive] does it mean that it can't find my .lib file because I use a relative path?
Archived author: William Von Kha • Posted: 2023-01-08T16:43:51.077000+00:00
Original source
does it mean that it can't find my .lib file because I use a relative path?
I have added in CmakeList.txt :
```
target_link_libraries(scripts
PRIVATE
trinity-core-interface
PUBLIC
TSClientSdk
game-interface)
```
the .lib should not be on my computer, but in the TrinityCore project?
Archived author: Guybrush • Posted: 2023-01-08T16:49:56.659000+00:00
Original source
<@315115040170835970> two separate issues. the private/public issue pertains to inheritance
Archived author: Guybrush • Posted: 2023-01-08T16:55:58.892000+00:00
Original source
the path issue is that while it *may* work for you, you're assuming everyone has that path on their machine, and that that is the exact location for the TS lib. You're using an absolute path (providing the entire location) when you should be using a path *relative to the project*. Check out https://github.com/TrinityCore/TrinityCo...master/dep for examples
Archived author: Tea • Posted: 2023-01-08T16:56:21.592000+00:00
Original source
i dont think he cares about that right now, it doesnt even work for him
![[Image: image.png?ex=690c2c43&is=690adac3&hm=696...9530b2ddc&]](https://cdn.discordapp.com/attachments/376074396915335170/1061691772528513175/image.png?ex=690c2c43&is=690adac3&hm=69605df7021ed39eae85d6e1d9c8919db2c9d0f922727a14615ca279530b2ddc&)
Archived author: William Von Kha • Posted: 2023-01-08T17:04:03.912000+00:00
Original source
for the inheritance I understood and I modified it as requested.
Now for the access path, I created as for boost an environment variable.
I never thought it would be so complicated to add two libraries...
And unfortunately I can't find any information to help me on the internet. I modified as follows:
```
find_package(TSClientSdk REQUIRED COMPONENTS lib)
find_package(TSServerSdk REQUIRED COMPONENTS lib)
add_library(TSClientSdk UNKNOWN IMPORTED)
add_library(TSServerSdk UNKNOWN IMPORTED)
target_link_libraries(TSClientSdk
INTERFACE
ts3client::ts3client)
target_link_libraries(TSServerSdk
INTERFACE
ts3server::ts3server)
set(TS_INCLUDE_DIR "$ENV{TS_INCLUDE_DIR}")
set(TS_LIB_DIR "$ENV{TS_LIB_DIR}")
set_target_properties(TSClientSdk
PROPERTIES
IMPORTED_LOCATION
"${TS_LIB_DIR}/ts3client.lib"
INTERFACE_INCLUDE_DIRECTORIES
"${TS_INCLUDE_DIR}")
set_target_properties(TSServerSdk
PROPERTIES
IMPORTED_LOCATION
"${TS_LIB_DIR}/ts3server.lib"
INTERFACE_INCLUDE_DIRECTORIES
"${TS_INCLUDE_DIR}")
```
With my environment variable in screen. More than that I don't know what to do...
![[Image: image.png?ex=690c2c43&is=690adac3&hm=696...9530b2ddc&]](https://cdn.discordapp.com/attachments/376074396915335170/1061691772528513175/image.png?ex=690c2c43&is=690adac3&hm=69605df7021ed39eae85d6e1d9c8919db2c9d0f922727a14615ca279530b2ddc&)
![[Image: image.png?ex=690c2d2e&is=690adbae&hm=a4a...3a848b9a8&]](https://cdn.discordapp.com/attachments/376074396915335170/1061692756340256858/image.png?ex=690c2d2e&is=690adbae&hm=a4adb990a5e5d64bcf38253c9415d85ce3c745109655e94a09867cb3a848b9a8&)
Archived author: William Von Kha • Posted: 2023-01-08T17:07:58.487000+00:00
Original source
and my cmake configuration
![[Image: image.png?ex=690c2d2e&is=690adbae&hm=a4a...3a848b9a8&]](https://cdn.discordapp.com/attachments/376074396915335170/1061692756340256858/image.png?ex=690c2d2e&is=690adbae&hm=a4adb990a5e5d64bcf38253c9415d85ce3c745109655e94a09867cb3a848b9a8&)
Archived author: Guybrush • Posted: 2023-01-08T17:09:10.819000+00:00
Original source
that's why there's an entire separate book on CMake
Archived author: Tea • Posted: 2023-01-08T17:10:45.919000+00:00
Original source
try like this
Archived author: Tea • Posted: 2023-01-08T17:11:25.612000+00:00
Original source
```
set_target_properties(TSServerSdk
PROPERTIES
IMPORTED_LOCATION
"${TSServerSdk_LIBRARY}"
INTERFACE_INCLUDE_DIRECTORIES
"${TSServerSdk_INCLUDE_DIR}")
```
Archived author: Tea • Posted: 2023-01-08T17:12:16.535000+00:00
Original source
also drop ts3server::ts3server and ts3client::ts3client, they dont do anything for you