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
31757a21
Commit
31757a21
authored
Sep 28, 2015
by
Davis King
Browse files
Options
Browse Files
Download
Plain Diff
merged
parents
f858ada0
a4c38a62
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
164 additions
and
156 deletions
+164
-156
CMakeLists.txt
dlib/CMakeLists.txt
+1
-1
add_python_module
dlib/add_python_module
+57
-59
cmake_find_blas.txt
dlib/cmake_find_blas.txt
+13
-1
tell_visual_studio_to_use_static_runtime.cmake
dlib/tell_visual_studio_to_use_static_runtime.cmake
+19
-0
.current_minor_release_number
docs/.current_minor_release_number
+0
-1
.current_release_number
docs/.current_release_number
+0
-1
bash_helper_functions
docs/bash_helper_functions
+30
-0
howto_contribute.xml
docs/docs/howto_contribute.xml
+0
-28
makedocs
docs/makedocs
+16
-33
makerel
docs/makerel
+20
-26
setup.py
setup.py
+8
-6
No files found.
dlib/CMakeLists.txt
View file @
31757a21
...
...
@@ -16,7 +16,7 @@ project(dlib)
set
(
CPACK_PACKAGE_VERSION_MAJOR
"18"
)
set
(
CPACK_PACKAGE_VERSION_MINOR
"17"
)
set
(
CPACK_PACKAGE_VERSION_PATCH
"
99
"
)
set
(
CPACK_PACKAGE_VERSION_PATCH
"
100
"
)
set
(
VERSION
${
CPACK_PACKAGE_VERSION_MAJOR
}
.
${
CPACK_PACKAGE_VERSION_MINOR
}
.
${
CPACK_PACKAGE_VERSION_PATCH
}
)
set
(
CMAKE_LEGACY_CYGWIN_WIN32 0
)
# Remove when CMake >= 2.8.4 is required
...
...
dlib/add_python_module
View file @
31757a21
...
...
@@ -35,10 +35,19 @@ get_filename_component(PYTHON_PATH ${PYTHON_PATH} PATH)
set(CMAKE_PREFIX_PATH ${PYTHON_PATH})
# To avoid dll hell, always link everything statically when compiling in
# visual studio. This way, the resulting library won't depend on a bunch
# of other dll files and can be safely copied to someone elese's computer
# and expected to run.
if (MSVC)
string(REGEX REPLACE "add_python_module$" "" dlib_path ${CMAKE_CURRENT_LIST_FILE})
include(${dlib_path}/tell_visual_studio_to_use_static_runtime.cmake)
add_definitions(-DBOOST_PYTHON_STATIC_LIB)
SET(Boost_USE_STATIC_LIBS ON)
SET(Boost_USE_MULTITHREADED ON)
SET(Boost_USE_STATIC_RUNTIME ON)
endif()
#SET(Boost_USE_STATIC_LIBS OFF)
#SET(Boost_USE_MULTITHREADED ON)
#SET(Boost_USE_STATIC_RUNTIME OFF)
set(Boost_NO_BOOST_CMAKE ON)
if (NOT WIN32)
...
...
@@ -46,61 +55,59 @@ if (NOT WIN32)
/usr/lib/x86_64-linux-gnu/)
endif()
if (PYTHON3)
# on Some systems the boost python3 module is called python-py34 so check for that one.
# On some systems the boost python3 module is called python-py34 so check
# for that one first.
FIND_PACKAGE(Boost 1.41.0 COMPONENTS python-py34 )
if (NOT Boost_FOUND)
# But if you don't find it then try looking for a module called python.
FIND_PACKAGE(Boost 1.41.0 COMPONENTS python REQUIRED)
FIND_PACKAGE(Boost 1.41.0 COMPONENTS python)
endif()
FIND_PACKAGE(PythonLibs 3.4 REQUIRED)
else()
FIND_PACKAGE(Boost 1.41.0 COMPONENTS python
REQUIRED
)
FIND_PACKAGE(Boost 1.41.0 COMPONENTS python)
FIND_PACKAGE(PythonLibs 2.6 REQUIRED)
endif()
if (NOT Boost_FOUND)
message(STATUS " *****************************************************************************************************")
if (WIN32)
message(" Set the BOOST_ROOT and BOOST_LIBRARYDIR environment variables before running cmake. ")
message(" E.g. Something like this: ")
message(" set BOOST_ROOT=C:\\local\\boost_1_57_0 " )
message(" set BOOST_LIBRARYDIR=C:\\local\\boost_1_57_0\\stage\\lib")
message("")
message(" You will also likely need to compile boost yourself rather than using one of the precompiled ")
message(" windows binaries. Do this by going to the folder tools\\build\\ within boost and running ")
message(" bootstrap.bat. Then run the command: ")
message(" b2 install")
message(" And then add the output bin folder to your PATH. Usually this is the C:\\boost-build-engine\\bin")
message(" folder. Finally, go to the boost root and run a command like this:")
message(" b2 --with-python address-model=64 toolset=msvc --build-type=complete")
message(" When it completes, set BOOST_LIBRARYDIR equal to wherever b2 put the compiled libraries.")
message(" Note that you will need to set the address-model based on if you want a 32 or 64bit python library.")
message("")
message(" Next, when you invoke cmake to compile dlib you may have to use cmake's -G option to set the ")
message(" 64 vs. 32bit mode of visual studio. Also, if you want a Python3 library you will need to ")
message(" add -DPYTHON3=1. You do this with a statement like: ")
message(" cmake -G \"Visual Studio 12 2013 Win64\" -DPYTHON3=1 ..\\..\\tools\\python")
message(" Rather than:")
message(" cmake ..\\..\\tools\\python")
message(" Which will build a 32bit Python2 module by default on most systems.")
message("")
message(STATUS "We couldn't find the right version of boost python. If you installed boost and you are still "
"getting this error then you might have installed a version of boost that was compiled with a different "
"version of visual studio than the one you are using. So you have to make sure that the version of "
"visual studio is the same version that was used to compile the copy of boost you are using.")
message(STATUS " Set the BOOST_ROOT and BOOST_LIBRARYDIR environment variables before running cmake. ")
message(STATUS " E.g. Something like this: ")
message(STATUS " set BOOST_ROOT=C:\\local\\boost_1_57_0 " )
message(STATUS " set BOOST_LIBRARYDIR=C:\\local\\boost_1_57_0\\stage\\lib")
message(STATUS "")
message(STATUS " You will also likely need to compile boost yourself rather than using one of the precompiled ")
message(STATUS " windows binaries. Do this by going to the folder tools\\build\\ within boost and running ")
message(STATUS " bootstrap.bat. Then run the command: ")
message(STATUS " b2 install")
message(STATUS " And then add the output bin folder to your PATH. Usually this is the C:\\boost-build-engine\\bin")
message(STATUS " folder. Finally, go to the boost root and run a command like this:")
message(STATUS " b2 -a --with-python address-model=64 toolset=msvc runtime-link=static")
message(STATUS " When it completes, set BOOST_LIBRARYDIR equal to wherever b2 put the compiled libraries.")
message(STATUS " Note that you will need to set the address-model based on if you want a 32 or 64bit python library.")
message(STATUS "")
message(STATUS " Next, when you invoke cmake to compile dlib you may have to use cmake's -G option to set the ")
message(STATUS " 64 vs. 32bit mode of visual studio. Also, if you want a Python3 library you will need to ")
message(STATUS " add -DPYTHON3=1. You do this with a statement like: ")
message(STATUS " cmake -G \"Visual Studio 12 2013 Win64\" -DPYTHON3=1 ..\\..\\tools\\python")
message(STATUS " Rather than:")
message(STATUS " cmake ..\\..\\tools\\python")
message(STATUS " Which will build a 32bit Python2 module by default on most systems.")
message(STATUS "")
else()
message("")
message(" *****************************************************************************************************")
message(" To compile Boost.Python yourself download boost from boost.org and then go into the boost root folder")
message(" and run these commands: ")
message(" ./bootstrap.sh --with-libraries=python")
message(" ./b2")
message(" sudo ./b2 install")
message(" *****************************************************************************************************")
message("")
message(STATUS " To compile Boost.Python yourself download boost from boost.org and then go into the boost root folder")
message(STATUS " and run these commands: ")
message(STATUS " ./bootstrap.sh --with-libraries=python")
message(STATUS " ./b2")
message(STATUS " sudo ./b2 install")
endif()
message(STATUS " *****************************************************************************************************")
message(FATAL_ERROR " Boost python library not found. ")
endif()
if (WIN32 AND NOT Boost_LIBRARIES)
message(FATAL_ERROR "We couldn't find the right version of boost python. If you installed boost and you are still "
"getting this error then you might have installed a version of boost that was compiled with a different "
"version of visual studio than the one you are using. So you have to make sure that the version of "
"visual studio is the same version that was used to compile the copy of boost you are using.")
endif()
INCLUDE_DIRECTORIES("${Boost_INCLUDE_DIRS}")
...
...
@@ -110,6 +117,8 @@ else()
INCLUDE_DIRECTORIES("${PYTHON_INCLUDE_DIRS}" )
endif()
message(STATUS "USING BOOST_LIBS: ${Boost_LIBRARIES}")
message(STATUS "USING PYTHON_LIBS: ${PYTHON_LIBRARIES}")
if (CMAKE_COMPILER_IS_GNUCXX)
# Just setting CMAKE_POSITION_INDEPENDENT_CODE should be enough to set
...
...
@@ -124,6 +133,7 @@ endif()
string(REGEX REPLACE "add_python_module$" "" dlib_path ${CMAKE_CURRENT_LIST_FILE})
include(${dlib_path}/cmake)
# We put the extra _ on the end of the name just so it's possible to
# have a module name of dlib and not get a conflict with the target named
# dlib in ../dlib/cmake. We use the target OUPUT_NAME property to ensure the
...
...
@@ -158,21 +168,9 @@ macro(add_python_module module_name module_sources )
# Determine the path to our CMakeLists.txt file.
string(REGEX REPLACE "CMakeLists.txt$" "" base_path ${CMAKE_CURRENT_LIST_FILE})
INSTALL(TARGETS ${module_name}_
DESTINATION "${base_path}/${path}"
RUNTIME DESTINATION "${base_path}/${path}"
LIBRARY DESTINATION "${base_path}/${path}"
)
# On windows we will usually need to have the boost-python .dll files in the same folder or
# you will get an error about how they can't be found. So copy the boost .dll files along with
# your module to the install folder to avoid this.
if (WIN32)
list(GET Boost_LIBRARIES 1 boostlibs1)
list(GET Boost_LIBRARIES 3 boostlibs2)
string(REGEX REPLACE ".lib$" ".dll" boostdlls1 ${boostlibs1})
string(REGEX REPLACE ".lib$" ".dll" boostdlls2 ${boostlibs2})
INSTALL(FILES ${boostdlls1} ${boostdlls2}
DESTINATION "${base_path}/${path}"
)
endif()
endmacro()
endmacro()
...
...
dlib/cmake_find_blas.txt
View file @
31757a21
...
...
@@ -234,6 +234,7 @@ elseif(WIN32 AND NOT MINGW)
find_library(mkl_intel mkl_intel_c ${mkl_search_path})
endif()
INCLUDE (CheckFunctionExists)
# Search for the needed libraries from the MKL.
find_library(mkl_core mkl_core ${mkl_search_path})
...
...
@@ -249,7 +250,18 @@ elseif(WIN32 AND NOT MINGW)
set(lapack_found 1)
message(STATUS "Found Intel MKL BLAS/LAPACK library")
if (MSVC)
# Make sure the version of the Intel MKL we found is compatible with
# the compiler we are using. One way to do this check is to see if we can
# link to it right now.
set(CMAKE_REQUIRED_LIBRARIES ${blas_libraries})
CHECK_FUNCTION_EXISTS(cblas_ddot HAVE_CBLAS)
if (NOT HAVE_CBLAS)
message(STATUS "BLAS library does not have cblas symbols, so dlib will not use BLAS or LAPACK")
set(blas_found 0)
set(lapack_found 0)
endif()
if (MSVC AND blas_found)
# need to set /bigobj when statically linking with the MKL on
# visual studio or it doesn't work right.
if (NOT CMAKE_CXX_FLAGS MATCHES "/bigobj")
...
...
dlib/tell_visual_studio_to_use_static_runtime.cmake
0 → 100644
View file @
31757a21
# Including this cmake script into your cmake project will cause visual studio
# to build your project against the static C runtime.
cmake_minimum_required
(
VERSION 2.6.4
)
if
(
POLICY CMP0054
)
cmake_policy
(
SET CMP0054 NEW
)
endif
()
if
(
MSVC OR
"
${
CMAKE_CXX_COMPILER_ID
}
"
STREQUAL
"MSVC"
)
foreach
(
flag_var
CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE
CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO
)
if
(
${
flag_var
}
MATCHES
"/MD"
)
string
(
REGEX REPLACE
"/MD"
"/MT"
${
flag_var
}
"
${${
flag_var
}}
"
)
endif
()
endforeach
(
flag_var
)
endif
()
docs/.current_minor_release_number
deleted
100644 → 0
View file @
f858ada0
17
docs/.current_release_number
deleted
100644 → 0
View file @
f858ada0
18
docs/bash_helper_functions
0 → 100755
View file @
31757a21
#/bin/sh
#
# This script defines some helper functions used by other scripts in the docs
# folder.
get_short_revision_number()
{
RESULT=`hg log -r $1 | grep changeset | awk '{print $2}' | sed -e 's/:.*//'`
}
get_last_modified_date()
{
RESULT=`hg log $1 -l1 --template '{date|date}\n' | awk '{ print $2" "$3", " $5}'`
}
get_dlib_version()
{
cat ../dlib/CMakeLists.txt | awk '/set\(CPACK_PACKAGE_VERSION_'$1'/{ match($2,"\"(.*)\"",a); print a[1]}'
}
# call like: set_dlib_version MAJOR 42
set_dlib_version()
{
sed -i -e 's/\(set(CPACK_PACKAGE_VERSION_'$1' *"\).*\(".*\)/\1'$2'\2/' ../dlib/CMakeLists.txt
}
MAJOR_NUM=`get_dlib_version MAJOR`
MINOR_NUM=`get_dlib_version MINOR`
PATCH_NUM=`get_dlib_version PATCH`
docs/docs/howto_contribute.xml
View file @
31757a21
...
...
@@ -465,34 +465,6 @@ for (int i = 0; i < my_std_vector.size(); ++i)
of the dlib supported platforms and have their project build without
needing to mess with anything.
</p>
<p>
It is also important to know that dlib is mostly a header-only library.
This is primarily a result of the heavy use of C++ templates. Because of this,
in many cases, all that is needed to use the library is to
add dlib into a compiler's include search path. However, the most important
reason you need to know this is so you don't hassle me about providing a
"shared library" version of dlib. :)
</p>
<p>
This point deserves some explaining. When you write a piece of
software that links against a shared library you need two things. First,
you need the shared library object files and second you need the header files
for the library itself so you can #include them in your application. However,
since nearly all the code in dlib is
<i>
in the header files
</i>
there isn't
any point in distributing it as a shared library.
</p>
<p>
There are also a lot of technical problems with C++ shared libraries in general.
You can read about shared libraries on
<a
href=
"http://tldp.org/HOWTO/Program-Library-HOWTO/shared-libraries.html"
>
this page
</a>
for more details. If you still think C++ template libraries like dlib should be built as
shared libraries then you should refer yourself to the following documents which
have been submitted to the C++ standards committee:
<a
href=
"http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2316.pdf"
>
N2316: Modules in C++
</a>
,
<a
href=
"http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2003/n1496.html"
>
N1496: Draft Proposal for
Dynamic Libraries in C++
</a>
, and
<a
href=
"http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2425.html"
>
N2425: Minimal Dynamic Library Support
</a>
.
</p>
</ul></li>
<li>
<b>
Don't make assumptions about how objects are laid out in memory.
</b>
<ul>
<p>
...
...
docs/makedocs
View file @
31757a21
#!/bin/bash
. bash_helper_functions
report_failure ()
{
...
...
@@ -70,11 +71,11 @@ htmlify_cmake ()
echo $1 >> $1.html;
echo "
</title></head><body
bgcolor=
'white'
><pre>
" >> $1.html;
# line 1: make comments green
# line 2: add links into the add_subdirectory directives
# line 3: make literal quotes red
# line 4: make the directives show up blue
# line 5: make variable names show up purple
# line 1: make comments green
# line 2: add links into the add_subdirectory directives
# line 3: make literal quotes red
# line 4: make the directives show up blue
# line 5: make variable names show up purple
sed -e "s/^\([ ]*#.*\)/
<font
color=
'#009900'
>
\1
<
\/
font
>
/" \
-e "s/add_subdirectory\([ ]*\)(\([ ]*\)\([^ ]*\)\([ ]*\)\([^ )]*\)/add_subdirectory\1(\2\3\4
<a
href=
'\3\/CMakeLists.txt.html'
>
\5
<
\/
a
>
/" \
-e "s/\"\([^\"]*\)\"/\"
<font
color=
'#CC0000'
>
\1
<
\/
font
>
\"/g" \
...
...
@@ -95,26 +96,15 @@ htmlify_python()
done
}
get_short_revision_number()
{
RESULT=`hg log -r $1 | grep changeset | awk '{print $2}' | sed -e 's/:.*//'`
}
get_last_modified_date()
{
RESULT=`hg log $1 -l1 --template '{date|date}\n' | awk '{ print $2" "$3", " $5}'`
}
makedocs ()
{
COUNTER_FILE=.current_release_number
MINOR_COUTNER_FILE=.current_minor_release_number
REVNUM_FILE=.logger_revnum
# figure out the short number that identifies this particular changeset
# figure out the short number that identifies this particular changeset
get_short_revision_number `cat $REVNUM_FILE`
LOGGER_REVNUM=$RESULT
...
...
@@ -124,22 +114,20 @@ makedocs ()
# The revision number we are currently at
# The revision number we are currently at
CHANGESET_ID=`hg id -i | sed -e 's/\+//'`
get_short_revision_number $CHANGESET_ID
REVISION=$RESULT
MAJOR_NUM=`cat $COUNTER_FILE`
MINOR_NUM=`cat $MINOR_COUTNER_FILE`
if [ "$1" = "makerel" ]
then
RELEASE=${MAJOR_NUM}.${MINOR_NUM}
else
RELEASE=${MAJOR_NUM}.
`echo ${MINOR_NUM}+1|bc`-RC
RELEASE=${MAJOR_NUM}.
${MINOR_NUM}.${PATCH_NUM}
fi;
# get XML versions of the change logs
# get XML versions of the change logs
BASE_LOGGER_REVNUM=`echo $LOGGER_REVNUM - 1000 | bc`
NEXT_LOGGER_REVNUM=`echo $LOGGER_REVNUM + 1 | bc`
echo Getting the mercurial change logs for revisions $NEXT_LOGGER_REVNUM:$REVISION
...
...
@@ -147,20 +135,14 @@ makedocs ()
echo Getting the mercurial change logs for revisions $BASE_LOGGER_REVNUM:$LOGGER_REVNUM
hg log -v ../dlib ../examples ../tools ../python_examples --style=xml -r$BASE_LOGGER_REVNUM:$LOGGER_REVNUM > docs/old_log.txt || report_failure
# grab a clean copy of the repository
# grab a clean copy of the repository
rm -rf docs/cache
rm -rf docs/web
rm -rf docs/chm/docs
rm -rf cache.$$
hg archive cache.$$ || report_failure
# put the stuff we need into the docs/cache folder
mkdir docs/cache
mv cache.$$/dlib docs/cache/
mv cache.$$/examples docs/cache/
mv cache.$$/python_examples docs/cache/
mv cache.$$/tools docs/cache/
rm -rf cache.$$
hg archive docs/cache || report_failure
# Don't need the docs folder in the cache, moreover, deleting it here avoids letting the makerel script include it in the dlib tar balls.
rm -rf docs/cache/docs
rm docs/cache/README.txt
echo "#ifndef DLIB_REVISION_H" > docs/cache/dlib/revision.h
echo "// Version: " $RELEASE >> docs/cache/dlib/revision.h
...
...
@@ -168,6 +150,7 @@ makedocs ()
echo "// Mercurial Revision ID: " $CHANGESET_ID >> docs/cache/dlib/revision.h
echo "#define DLIB_MAJOR_VERSION " $MAJOR_NUM >> docs/cache/dlib/revision.h
echo "#define DLIB_MINOR_VERSION " $MINOR_NUM >> docs/cache/dlib/revision.h
echo "#define DLIB_PATCH_VERSION " $PATCH_NUM >> docs/cache/dlib/revision.h
echo "#endif" >> docs/cache/dlib/revision.h
...
...
docs/makerel
View file @
31757a21
#!/bin/bash
.
bash_helper_functions
#
i
f the first argument to this script is the word major then the
# major version number is updated and the minor is set back to 0
#
I
f the first argument to this script is the word major then the
# major version number is updated and the minor is set back to 0
.
report_failure
()
{
...
...
@@ -15,44 +16,41 @@ report_failure ()
REVNUM_FILE
=
.logger_revnum
COUNTER_FILE
=
.current_release_number
MINOR_COUTNER_FILE
=
.current_minor_release_number
CHANGESET_ID
=
`
hg
id
-i
|
sed
-e
's/\+//'
`
rm
-rf
release
||
report_failure
mkdir
release
||
report_failure
RELEASE
=
`
cat
$COUNTER_FILE
|
awk
'{ print $1 + 1}'
`
if
[
"
$1
"
=
"major"
]
then
MAJOR_NUM
=
`
cat
$COUNTER_FILE
|
awk
'{print $1 + 1}'
`
MAJOR_NUM
=
`
echo
$MAJOR_NUM
+1|bc
`
MINOR_NUM
=
0
echo
$MAJOR_NUM
>
$COUNTER_FILE
echo
$MINOR_NUM
>
$MINOR_COUTNER_FILE
else
MAJOR_NUM
=
`
cat
$COUNTER_FILE
`
MINOR_NUM
=
`
cat
$MINOR_COUTNER_FILE
|
awk
'{print $1 + 1}'
`
echo
$MINOR_NUM
>
$MINOR_COUTNER_FILE
MINOR_NUM
=
`
echo
$MINOR_NUM
+1|bc
`
fi
;
./makedocs makerel
||
exit
1
rm
-rf
release
||
report_failure
mkdir
release
||
report_failure
set_dlib_version MAJOR
$MAJOR_NUM
set_dlib_version MINOR
$MINOR_NUM
set_dlib_version PATCH 0
RELEASE
=
${
MAJOR_NUM
}
.
${
MINOR_NUM
}
# Commit changes to the version numbers so that the makedocs script will use them.
echo
Create Mercurial tags and commit release
hg tag v
$RELEASE
||
report_failure
hg commit
-m
"Created release v
$RELEASE
"
||
report_failure
./makedocs makerel
||
exit
1
CHANGESET_ID
=
`
hg
id
-i
|
sed
-e
's/\+//'
`
echo
$CHANGESET_ID
>
$REVNUM_FILE
set_dlib_version PATCH 99
hg commit
-m
"Record last changeset and set PATCH version to 99"
cd
release
||
report_failure
RELDIR
=
`
echo
dlib-
$RELEASE
`
mkdir
$RELDIR
cd
$RELDIR
||
report_failure
cp
-r
../../docs/cache/dlib
.
||
report_failure
cp
-r
../../docs/cache/examples
.
||
report_failure
cp
-r
../../docs/cache/python_examples
.
||
report_failure
cp
-r
../../docs/cache/tools
.
||
report_failure
cp
-r
../../docs/cache/
*
.
||
report_failure
echo
Version:
$RELEASE
>>
dlib/README.txt
echo
"Date:
`
date
`
"
>>
dlib/README.txt
...
...
@@ -89,9 +87,5 @@ mv $SOURCE_TAR.bz2 v$RELEASE
mv
$SOURCE_ZIP
v
$RELEASE
echo
Create Mercurial tags and commit release
cd
..
hg tag v
$RELEASE
||
report_failure
hg commit
-m
"Created release v
$RELEASE
"
setup.py
View file @
31757a21
...
...
@@ -43,6 +43,7 @@ from subprocess import Popen, PIPE, STDOUT
import
signal
from
threading
import
Thread
import
time
import
re
# change directory to this module path
...
...
@@ -340,9 +341,10 @@ def readme(fname):
def
read_version
():
"""Read version information
"""
major
=
readme
(
'./docs/.current_release_number'
)
.
strip
()
minor
=
readme
(
'./docs/.current_minor_release_number'
)
.
strip
()
return
major
+
'.'
+
minor
major
=
re
.
findall
(
"set
\
(CPACK_PACKAGE_VERSION_MAJOR.*
\"
(.*)
\"
"
,
open
(
'dlib/CMakeLists.txt'
)
.
read
())[
0
]
minor
=
re
.
findall
(
"set
\
(CPACK_PACKAGE_VERSION_MINOR.*
\"
(.*)
\"
"
,
open
(
'dlib/CMakeLists.txt'
)
.
read
())[
0
]
patch
=
re
.
findall
(
"set
\
(CPACK_PACKAGE_VERSION_PATCH.*
\"
(.*)
\"
"
,
open
(
'dlib/CMakeLists.txt'
)
.
read
())[
0
]
return
major
+
'.'
+
minor
+
'.'
+
patch
def
rmtree
(
name
):
...
...
@@ -407,7 +409,7 @@ class build(_build):
# just so that we can `import dlib` and not `from dlib import dlib`
f
.
write
(
'from .dlib import *
\n
'
)
# add version here
f
.
write
(
'__version__ =
{ver}
\n
'
.
format
(
ver
=
read_version
()))
f
.
write
(
'__version__ =
"{ver}"
\n
'
.
format
(
ver
=
read_version
()))
with
open
(
os
.
path
.
join
(
dist_dir_examples
,
'__init__.py'
),
'w'
):
pass
...
...
@@ -546,7 +548,7 @@ setup(
version
=
read_version
(),
keywords
=
[
'dlib'
,
'Computer Vision'
,
'Machine Learning'
],
description
=
'A toolkit for making real world machine learning and data analysis applications'
,
long_description
=
readme
(
'
.
/README.txt'
),
long_description
=
readme
(
'
dlib
/README.txt'
),
author
=
'Davis King'
,
author_email
=
'davis@dlib.net'
,
url
=
'https://github.com/davisking/dlib'
,
...
...
@@ -567,7 +569,6 @@ setup(
'Development Status :: 5 - Production/Stable'
,
'Intended Audience :: Science/Research'
,
'Intended Audience :: Developers'
,
'License :: OSI Approved :: Boost Software License (BSL)'
,
'Operating System :: MacOS :: MacOS X'
,
'Operating System :: POSIX'
,
'Operating System :: POSIX :: Linux'
,
...
...
@@ -581,6 +582,7 @@ setup(
'Programming Language :: Python :: 3'
,
'Programming Language :: Python :: 3.4'
,
'Topic :: Scientific/Engineering'
,
'Topic :: Scientific/Engineering :: Artificial Intelligence'
,
'Topic :: Scientific/Engineering :: Image Recognition'
,
'Topic :: Software Development'
,
],
...
...
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