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
ae13ad80
Commit
ae13ad80
authored
Aug 10, 2017
by
Davis King
Browse files
Added more options for controlling the install folder paths.
parent
d62c5a7c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
46 additions
and
8 deletions
+46
-8
dlib/java/CMakeLists.txt
dlib/java/CMakeLists.txt
+9
-1
dlib/java/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)
#
t
ell swig to put the output files into the local folder.
#
T
ell 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