diff --git a/dlib/CMakeLists.txt b/dlib/CMakeLists.txt index 6e754127e..1409bb586 100644 --- a/dlib/CMakeLists.txt +++ b/dlib/CMakeLists.txt @@ -185,6 +185,7 @@ if (NOT TARGET dlib) add_library(dlib STATIC ${source_files} ) if (UNIX AND NOT DLIB_IN_PROJECT_BUILD) add_library(dlib_shared SHARED ${source_files} ) + add_dependencies(dlib_shared dlib) endif() else() @@ -631,8 +632,10 @@ if (NOT TARGET dlib) if (UNIX AND NOT DLIB_IN_PROJECT_BUILD) if (DLIB_USE_CUDA) cuda_add_library(dlib_shared SHARED ${source_files} ) + add_dependencies(dlib_shared dlib) else() add_library(dlib_shared SHARED ${source_files} ) + add_dependencies(dlib_shared dlib) endif() target_link_libraries(dlib_shared ${dlib_needed_libraries} ) endif()