Commit e2293e5c authored by Davis King's avatar Davis King

Push all include and link options needed for dlib to pkg-config. We do this by…

Push all include and link options needed for dlib to pkg-config.  We do this by getting them from the same list cmake uses.
parent 5d64de24
...@@ -373,7 +373,7 @@ if (NOT TARGET dlib) ...@@ -373,7 +373,7 @@ if (NOT TARGET dlib)
endif() endif()
endif() endif()
mark_as_advanced(pthreadlib xlib xlib_path x11_path) mark_as_advanced(xlib xlib_path x11_path)
else () ################################################################################## else () ##################################################################################
# link to the nsl library if it exists. this is something you need sometimes # link to the nsl library if it exists. this is something you need sometimes
find_library(nsllib nsl) find_library(nsllib nsl)
...@@ -403,7 +403,7 @@ if (NOT TARGET dlib) ...@@ -403,7 +403,7 @@ if (NOT TARGET dlib)
endif() endif()
endif() endif()
mark_as_advanced(nsllib pthreadlib socketlib) mark_as_advanced(nsllib socketlib)
endif () ################################################################################## endif () ##################################################################################
if (NOT DLIB_NO_GUI_SUPPORT) if (NOT DLIB_NO_GUI_SUPPORT)
...@@ -437,7 +437,6 @@ if (NOT TARGET dlib) ...@@ -437,7 +437,6 @@ if (NOT TARGET dlib)
if (PNG_FOUND) if (PNG_FOUND)
include_directories(${PNG_INCLUDE_DIR}) include_directories(${PNG_INCLUDE_DIR})
set (dlib_needed_libraries ${dlib_needed_libraries} ${PNG_LIBRARIES}) set (dlib_needed_libraries ${dlib_needed_libraries} ${PNG_LIBRARIES})
set(REQUIRES_LIBS " libpng")
else() else()
# If we can't find libpng then statically compile it in. # If we can't find libpng then statically compile it in.
include_directories(external/libpng external/zlib) include_directories(external/libpng external/zlib)
...@@ -487,7 +486,6 @@ if (NOT TARGET dlib) ...@@ -487,7 +486,6 @@ if (NOT TARGET dlib)
) )
set_source_files_properties(external/libpng/arm/filter_neon.S PROPERTIES COMPILE_FLAGS "${CMAKE_ASM_FLAGS} ${CMAKE_CXX_FLAGS} -x assembler-with-cpp") set_source_files_properties(external/libpng/arm/filter_neon.S PROPERTIES COMPILE_FLAGS "${CMAKE_ASM_FLAGS} ${CMAKE_CXX_FLAGS} -x assembler-with-cpp")
endif() endif()
set(REQUIRES_LIBS "")
endif() endif()
set(source_files ${source_files} set(source_files ${source_files}
image_loader/png_loader.cpp image_loader/png_loader.cpp
...@@ -756,6 +754,7 @@ if (NOT TARGET dlib) ...@@ -756,6 +754,7 @@ if (NOT TARGET dlib)
${cudnn} ${cudnn}
${CUDA_curand_LIBRARY} ${CUDA_curand_LIBRARY}
${CUDA_cusolver_LIBRARY} ${CUDA_cusolver_LIBRARY}
${CUDA_CUDART_LIBRARY}
) )
if(openmp_libraries) if(openmp_libraries)
list(APPEND dlib_needed_libraries ${openmp_libraries}) list(APPEND dlib_needed_libraries ${openmp_libraries})
...@@ -867,6 +866,11 @@ if (NOT TARGET dlib) ...@@ -867,6 +866,11 @@ if (NOT TARGET dlib)
# Install the library # Install the library
if (NOT DLIB_IN_PROJECT_BUILD) if (NOT DLIB_IN_PROJECT_BUILD)
string (REPLACE ";" " " pkg_config_dlib_needed_libraries "${dlib_needed_libraries}")
# Make the -I include options for pkg-config
foreach (ITR ${dlib_needed_includes})
set (pkg_config_dlib_needed_includes "${pkg_config_dlib_needed_includes} -I${ITR}")
endforeach()
set_target_properties(dlib PROPERTIES set_target_properties(dlib PROPERTIES
VERSION ${VERSION}) VERSION ${VERSION})
install(TARGETS dlib install(TARGETS dlib
......
...@@ -4,6 +4,5 @@ includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@ ...@@ -4,6 +4,5 @@ includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@
Name: @PROJECT_NAME@ Name: @PROJECT_NAME@
Description: Numerical and networking C++ library Description: Numerical and networking C++ library
Version: @VERSION@ Version: @VERSION@
Libs: -L${libdir} -ldlib Libs: -L${libdir} -ldlib @pkg_config_dlib_needed_libraries@
Cflags: -I${includedir} Cflags: -I${includedir} @pkg_config_dlib_needed_includes@
Requires:@REQUIRES_LIBS@
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment