Skip to content
This repository was archived by the owner on Nov 27, 2025. It is now read-only.

Commit 951df48

Browse files
committed
build: add target_link_directories because we're pulling a library from a file and not a target
1 parent 23d782e commit 951df48

File tree

3 files changed

+13
-5
lines changed

3 files changed

+13
-5
lines changed

app/CMakeLists.txt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@ add_executable(${CMAKE_PROJECT_NAME} main.cpp)
33

44
message(" finding where Skia shared library is")
55
include(FindSkiaSystem)
6+
message(" set SKIA_LIBRARIES to ${SKIA_LIBRARIES}")
7+
8+
message("-- Use target_link_directories to")
9+
message(" tell target where to look for .dlls")
10+
message(" (by default in CMake +3 it is recommended to link by targets, not directories)")
11+
target_link_directories(${CMAKE_PROJECT_NAME} PRIVATE ${CMAKE_BINARY_DIR}/src)
612

713
set(EXECUTABLE_LIBRARIES
814
${APP_DEPENDENCIES}
@@ -13,5 +19,5 @@ set(EXECUTABLE_LIBRARIES
1319
message(" linked with ${EXECUTABLE_LIBRARIES}")
1420

1521
# Finally join our libraries with the executable
16-
target_link_libraries(${CMAKE_PROJECT_NAME} ${EXECUTABLE_LIBRARIES})
22+
target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE ${EXECUTABLE_LIBRARIES})
1723

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
message("-- Generated shared library")
22
message(" from target Engine")
33
message(" in ${SKIA_BUILD_DIR}/libskia.friction.so")
4-
message("-- Moving libskia.friction.so")
5-
message(" to ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}")
64

5+
message("-- Moving libskia.friction.so")
6+
message(" to ${CMAKE_BINARY_DIR}/src")
7+
message(" so it is importable using \"\"")
78
file(COPY ${SKIA_BUILD_DIR}/libskia.friction.so
8-
DESTINATION ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR})
9+
DESTINATION ${CMAKE_BINARY_DIR}/src)
10+

thirdparty/skia/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ ExternalProject_Add(
7070

7171

7272
if(UNIX AND NOT APPLE)
73-
#include(CopySkiaLibraryToInstallDir)
73+
include(CopySkiaLibraryToInstallDir)
7474
endif()
7575

7676

0 commit comments

Comments
 (0)