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)
endif()
endif()
mark_as_advanced(pthreadlib xlib xlib_path x11_path)
mark_as_advanced(xlib xlib_path x11_path)
else () ##################################################################################
# link to the nsl library if it exists. this is something you need sometimes
find_library(nsllib nsl)
......@@ -403,7 +403,7 @@ if (NOT TARGET dlib)
endif()
endif()
mark_as_advanced(nsllib pthreadlib socketlib)
mark_as_advanced(nsllib socketlib)
endif () ##################################################################################
if (NOT DLIB_NO_GUI_SUPPORT)
......@@ -437,7 +437,6 @@ if (NOT TARGET dlib)
if (PNG_FOUND)
include_directories(${PNG_INCLUDE_DIR})
set (dlib_needed_libraries ${dlib_needed_libraries} ${PNG_LIBRARIES})
set(REQUIRES_LIBS " libpng")
else()
# If we can't find libpng then statically compile it in.
include_directories(external/libpng external/zlib)
......@@ -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")
endif()
set(REQUIRES_LIBS "")
endif()
set(source_files ${source_files}
image_loader/png_loader.cpp
......@@ -756,6 +754,7 @@ if (NOT TARGET dlib)
${cudnn}
${CUDA_curand_LIBRARY}
${CUDA_cusolver_LIBRARY}
${CUDA_CUDART_LIBRARY}
)
if(openmp_libraries)
list(APPEND dlib_needed_libraries ${openmp_libraries})
......@@ -867,6 +866,11 @@ if (NOT TARGET dlib)
# Install the library
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
VERSION ${VERSION})
install(TARGETS dlib
......
......@@ -4,6 +4,5 @@ includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@
Name: @PROJECT_NAME@
Description: Numerical and networking C++ library
Version: @VERSION@
Libs: -L${libdir} -ldlib
Cflags: -I${includedir}
Requires:@REQUIRES_LIBS@
Libs: -L${libdir} -ldlib @pkg_config_dlib_needed_libraries@
Cflags: -I${includedir} @pkg_config_dlib_needed_includes@
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