Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
D
dlib
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
钟尚武
dlib
Commits
ae13ad80
Commit
ae13ad80
authored
Aug 10, 2017
by
Davis King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added more options for controlling the install folder paths.
parent
d62c5a7c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
46 additions
and
8 deletions
+46
-8
CMakeLists.txt
dlib/java/CMakeLists.txt
+9
-1
cmake_swig_jni
dlib/java/cmake_swig_jni
+37
-7
No files found.
dlib/java/CMakeLists.txt
View file @
ae13ad80
...
@@ -16,9 +16,17 @@ include_directories(
...
@@ -16,9 +16,17 @@ include_directories(
#include(../../dlib/cmake)
#include(../../dlib/cmake)
#set(additional_link_libraries dlib)
#set(additional_link_libraries dlib)
#
tell swig to put the output files
into the local folder.
#
Tell swig to put the output files (the shared library and .jar)
into the local folder.
set
(
install_target_output_folder .
)
set
(
install_target_output_folder .
)
# Alternatively, instead of using install_target_output_folder, you can tell
# cmake to output the shared library, java source files, and the jar to
# separate output folders. These commands would put them into folders thelib,
# thesrc, and thejar, respectively.
#set(install_shared_library_output_folder thelib)
#set(install_java_source_output_folder thesrc)
#set(install_jar_output_folder thejar)
include
(
cmake_swig_jni
)
include
(
cmake_swig_jni
)
...
...
dlib/java/cmake_swig_jni
View file @
ae13ad80
...
@@ -16,11 +16,18 @@
...
@@ -16,11 +16,18 @@
# include(../../dlib/dlib/cmake)
# include(../../dlib/dlib/cmake)
# set(additional_link_libraries dlib)
# set(additional_link_libraries dlib)
#
#
# ###
t
ell swig to put the output files into the parent folder of your CMakeLists.txt
# ###
T
ell swig to put the output files into the parent folder of your CMakeLists.txt
# ### file when you run make install.
# ### file when you run make install.
# set(install_target_output_folder ..)
# set(install_target_output_folder ..)
# include(cmake_swig_jni)
# include(cmake_swig_jni)
#
# ### Alternatively, instead of using install_target_output_folder, you can tell
# ### cmake to output the shared library, java source files, and the jar to
# ### separate output folders. These commands would put them into folders
# ### thelib, thesrc, and thejar, respectively.
# # set(install_shared_library_output_folder thelib)
# # set(install_java_source_output_folder thesrc)
# # set(install_jar_output_folder thejar)
...
@@ -197,14 +204,15 @@ add_custom_command(TARGET ${output_library_name}
...
@@ -197,14 +204,15 @@ add_custom_command(TARGET ${output_library_name}
)
)
# Determine the path to our CMakeLists.txt file.
# There is either a bug (or break in compatability maybe) between versions
# of cmake that cause the or expression in this regular expression to be
# necessary.
string(REGEX REPLACE "(cmake_swig_jni|CMakeLists.txt)$" "" base_path ${CMAKE_PARENT_LIST_FILE})
#if the including cmake script set the install_target_output_folder variable
#if the including cmake script set the install_target_output_folder variable
#then make it so we install the compiled library and jar into that folder
#then make it so we install the compiled library and jar into that folder
if (install_target_output_folder)
if (install_target_output_folder)
# Determine the path to our CMakeLists.txt file.
# There is either a bug (or break in compatability maybe) between versions
# of cmake that cause the or expression in this regular expression to be
# necessary.
string(REGEX REPLACE "(cmake_swig_jni|CMakeLists.txt)$" "" base_path ${CMAKE_PARENT_LIST_FILE})
# The directory we will write the output files to.
# The directory we will write the output files to.
set(install_dir "${base_path}${install_target_output_folder}")
set(install_dir "${base_path}${install_target_output_folder}")
set(CMAKE_INSTALL_PREFIX "${install_dir}")
set(CMAKE_INSTALL_PREFIX "${install_dir}")
...
@@ -217,6 +225,28 @@ if (install_target_output_folder)
...
@@ -217,6 +225,28 @@ if (install_target_output_folder)
)
)
endif()
endif()
if (install_shared_library_output_folder)
set(install_dir "${base_path}${install_shared_library_output_folder}")
install(TARGETS ${output_library_name}
DESTINATION "${install_dir}"
)
endif()
if (install_java_source_output_folder)
set(install_dir "${base_path}${install_java_source_output_folder}")
install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/lib/java_src/${package_root_name}
DESTINATION "${install_dir}"
)
endif()
if (install_jar_output_folder)
set(install_dir "${base_path}${install_jar_output_folder}")
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/lib/${PROJECT_NAME}.jar
DESTINATION "${install_dir}"
)
endif()
# Copy any system libraries to the output folder. This really only matters on
# Copy any system libraries to the output folder. This really only matters on
# windows where it's good to have the visual studio runtime show up in the lib
# windows where it's good to have the visual studio runtime show up in the lib
# folder so that you don't forget to include it in your binary distribution.
# folder so that you don't forget to include it in your binary distribution.
...
...
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