Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
dlib
Commits
3eaa463e
Commit
3eaa463e
authored
Feb 27, 2017
by
Alain Vaucher
Browse files
Add target_include_directories for build interface and for optional libraries
parent
8ad068c4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
5 deletions
+12
-5
dlib/CMakeLists.txt
dlib/CMakeLists.txt
+12
-5
No files found.
dlib/CMakeLists.txt
View file @
3eaa463e
...
@@ -28,7 +28,6 @@ set(dlib_needed_includes)
...
@@ -28,7 +28,6 @@ set(dlib_needed_includes)
# dlib_needed_includes which will get pushed into the parent cmake scope at the
# dlib_needed_includes which will get pushed into the parent cmake scope at the
# end of this CMakeLists.txt file. This way, it is available to users of dlib/cmake.
# end of this CMakeLists.txt file. This way, it is available to users of dlib/cmake.
macro
(
add_include_directories dir
)
macro
(
add_include_directories dir
)
include_directories
(
${
dir
}
)
set
(
dlib_needed_includes
${
dlib_needed_includes
}
${
dir
}
)
set
(
dlib_needed_includes
${
dlib_needed_includes
}
${
dir
}
)
endmacro
()
endmacro
()
...
@@ -647,7 +646,7 @@ if (NOT TARGET dlib)
...
@@ -647,7 +646,7 @@ if (NOT TARGET dlib)
else
()
else
()
add_library
(
dlib STATIC
${
source_files
}
)
add_library
(
dlib STATIC
${
source_files
}
)
endif
()
endif
()
target_link_libraries
(
dlib
${
dlib_needed_libraries
}
)
target_link_libraries
(
dlib
PRIVATE
${
dlib_needed_libraries
}
)
if
(
UNIX AND NOT DLIB_IN_PROJECT_BUILD
)
if
(
UNIX AND NOT DLIB_IN_PROJECT_BUILD
)
if
(
DLIB_USE_CUDA
)
if
(
DLIB_USE_CUDA
)
cuda_add_library
(
dlib_shared SHARED
${
source_files
}
)
cuda_add_library
(
dlib_shared SHARED
${
source_files
}
)
...
@@ -656,7 +655,7 @@ if (NOT TARGET dlib)
...
@@ -656,7 +655,7 @@ if (NOT TARGET dlib)
add_library
(
dlib_shared SHARED
${
source_files
}
)
add_library
(
dlib_shared SHARED
${
source_files
}
)
add_dependencies
(
dlib_shared dlib
)
add_dependencies
(
dlib_shared dlib
)
endif
()
endif
()
target_link_libraries
(
dlib_shared
${
dlib_needed_libraries
}
)
target_link_libraries
(
dlib_shared
PRIVATE
${
dlib_needed_libraries
}
)
endif
()
endif
()
endif
()
##### end of if NOT DLIB_ISO_CPP_ONLY ##########################################################
endif
()
##### end of if NOT DLIB_ISO_CPP_ONLY ##########################################################
...
@@ -667,8 +666,16 @@ if (NOT TARGET dlib)
...
@@ -667,8 +666,16 @@ if (NOT TARGET dlib)
endif
()
endif
()
# Specify the include directory for CMake targets relying on dlib.
# Specify the include directory for CMake targets relying on dlib.
target_include_directories
(
dlib INTERFACE $<INSTALL_INTERFACE:include>
)
target_include_directories
(
dlib
target_include_directories
(
dlib_shared INTERFACE $<INSTALL_INTERFACE:include>
)
INTERFACE $<BUILD_INTERFACE:
${
CMAKE_CURRENT_SOURCE_DIR
}
/..>
INTERFACE $<INSTALL_INTERFACE:include>
PUBLIC
${
dlib_needed_includes
}
)
target_include_directories
(
dlib_shared
INTERFACE $<BUILD_INTERFACE:
${
CMAKE_CURRENT_SOURCE_DIR
}
/..>
INTERFACE $<INSTALL_INTERFACE:include>
PUBLIC
${
dlib_needed_includes
}
)
# Install the library
# Install the library
if
(
NOT DLIB_IN_PROJECT_BUILD
)
if
(
NOT DLIB_IN_PROJECT_BUILD
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment