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
537864f6
Commit
537864f6
authored
May 16, 2017
by
Davis King
Browse files
Cleanup and also fixed a cmake error when building dlib outside a project.
parent
5515d9cf
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
17 deletions
+20
-17
dlib/CMakeLists.txt
dlib/CMakeLists.txt
+20
-17
No files found.
dlib/CMakeLists.txt
View file @
537864f6
...
...
@@ -181,6 +181,9 @@ if (NOT TARGET dlib)
)
set
(
dlib_needed_libraries
)
set
(
dlib_needed_includes
)
if
(
DLIB_ISO_CPP_ONLY
)
add_library
(
dlib STATIC
${
source_files
}
)
if
(
UNIX AND NOT DLIB_IN_PROJECT_BUILD
)
...
...
@@ -219,8 +222,6 @@ if (NOT TARGET dlib)
stack_trace.cpp
)
set
(
dlib_needed_libraries
)
set
(
dlib_needed_includes
)
if
(
UNIX
)
set
(
CMAKE_THREAD_PREFER_PTHREAD ON
)
find_package
(
Threads REQUIRED
)
...
...
@@ -673,13 +674,6 @@ if (NOT TARGET dlib)
else
()
add_library
(
dlib STATIC
${
source_files
}
)
endif
()
target_include_directories
(
dlib PUBLIC
${
dlib_needed_includes
}
)
target_link_libraries
(
dlib PRIVATE
${
dlib_needed_libraries
}
)
if
(
DLIB_IN_PROJECT_BUILD
)
target_compile_options
(
dlib PUBLIC
${
active_preprocessor_switches
}
)
else
()
target_compile_options
(
dlib PRIVATE
${
active_preprocessor_switches
}
)
endif
()
if
(
UNIX AND NOT DLIB_IN_PROJECT_BUILD
)
if
(
DLIB_USE_CUDA
)
cuda_add_library
(
dlib_shared SHARED
${
source_files
}
)
...
...
@@ -688,24 +682,33 @@ if (NOT TARGET dlib)
add_library
(
dlib_shared SHARED
${
source_files
}
)
add_dependencies
(
dlib_shared dlib
)
endif
()
target_include_directories
(
PUBLIC
${
dlib_needed_includes
}
)
target_link_libraries
(
dlib_shared PRIVATE
${
dlib_needed_libraries
}
)
target_compile_options
(
dlib_shared PRIVATE
${
active_preprocessor_switches
}
)
endif
()
endif
()
##### end of if NOT DLIB_ISO_CPP_ONLY ##########################################################
# Add source or headers to include directory, for building or installation respectively
target_include_directories
(
dlib
INTERFACE $<BUILD_INTERFACE:
${
CMAKE_CURRENT_SOURCE_DIR
}
/..>
INTERFACE $<INSTALL_INTERFACE:include>
PUBLIC
${
dlib_needed_includes
}
)
target_link_libraries
(
dlib PRIVATE
${
dlib_needed_libraries
}
)
if
(
DLIB_IN_PROJECT_BUILD
)
target_compile_options
(
dlib PUBLIC
${
active_preprocessor_switches
}
)
else
()
target_compile_options
(
dlib PRIVATE
${
active_preprocessor_switches
}
)
endif
()
if
(
UNIX AND NOT DLIB_IN_PROJECT_BUILD
)
target_include_directories
(
dlib_shared
INTERFACE $<BUILD_INTERFACE:
${
CMAKE_CURRENT_SOURCE_DIR
}
/..>
INTERFACE $<INSTALL_INTERFACE:include>
)
target_include_directories
(
dlib_shared
INTERFACE $<BUILD_INTERFACE:
${
CMAKE_CURRENT_SOURCE_DIR
}
/..>
INTERFACE $<INSTALL_INTERFACE:include>
PUBLIC
${
dlib_needed_includes
}
)
target_link_libraries
(
dlib_shared PRIVATE
${
dlib_needed_libraries
}
)
target_compile_options
(
dlib_shared PRIVATE
${
active_preprocessor_switches
}
)
endif
()
# Allow the unit tests to ask us to compile the all/source.cpp file just to make sure it compiles.
if
(
DLIB_TEST_COMPILE_ALL_SOURCE_CPP
)
ADD_LIBRARY
(
dlib_all_source_cpp STATIC all/source.cpp
)
...
...
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