Fixed the cmake files to avoid getting an error if the word cmake or various

other words appear in the file path to the source code.
This commit is contained in:
Davis King 2014-08-18 20:18:06 -04:00
parent 9069f30a6d
commit 5ff02a2a2a
2 changed files with 5 additions and 5 deletions

View File

@ -51,7 +51,7 @@ if (CMAKE_COMPILER_IS_GNUCXX)
endif() endif()
# include dlib so we can link against it # include dlib so we can link against it
string(REPLACE "add_python_module" "" dlib_path ${CMAKE_CURRENT_LIST_FILE}) string(REGEX REPLACE "add_python_module$" "" dlib_path ${CMAKE_CURRENT_LIST_FILE})
include(${dlib_path}/cmake) include(${dlib_path}/cmake)
# We put the extra _ on the end of the name just so it's possible to # We put the extra _ on the end of the name just so it's possible to
@ -86,7 +86,7 @@ macro(add_python_module module_name module_sources )
macro(install_${module_name}_to path) macro(install_${module_name}_to path)
# Determine the path to our CMakeLists.txt file. # Determine the path to our CMakeLists.txt file.
string(REPLACE "CMakeLists.txt" "" base_path ${CMAKE_CURRENT_LIST_FILE}) string(REGEX REPLACE "CMakeLists.txt$" "" base_path ${CMAKE_CURRENT_LIST_FILE})
INSTALL(TARGETS ${module_name}_ INSTALL(TARGETS ${module_name}_
DESTINATION "${base_path}/${path}" DESTINATION "${base_path}/${path}"
) )
@ -97,8 +97,8 @@ macro(add_python_module module_name module_sources )
if (WIN32) if (WIN32)
list(GET Boost_LIBRARIES 1 boostlibs1) list(GET Boost_LIBRARIES 1 boostlibs1)
list(GET Boost_LIBRARIES 3 boostlibs2) list(GET Boost_LIBRARIES 3 boostlibs2)
string(REPLACE ".lib" ".dll" boostdlls1 ${boostlibs1}) string(REGEX REPLACE ".lib$" ".dll" boostdlls1 ${boostlibs1})
string(REPLACE ".lib" ".dll" boostdlls2 ${boostlibs2}) string(REGEX REPLACE ".lib$" ".dll" boostdlls2 ${boostlibs2})
INSTALL(FILES ${boostdlls1} ${boostdlls2} INSTALL(FILES ${boostdlls1} ${boostdlls2}
DESTINATION "${base_path}/${path}" DESTINATION "${base_path}/${path}"
) )

View File

@ -3,7 +3,7 @@
if (NOT TARGET dlib) if (NOT TARGET dlib)
# Determine the path to dlib. # Determine the path to dlib.
string(REPLACE "cmake" "" dlib_path ${CMAKE_CURRENT_LIST_FILE}) string(REGEX REPLACE "cmake$" "" dlib_path ${CMAKE_CURRENT_LIST_FILE})
if (CMAKE_COMPILER_IS_GNUCXX) if (CMAKE_COMPILER_IS_GNUCXX)
# By default, g++ won't warn or error if you forget to return a value in a # By default, g++ won't warn or error if you forget to return a value in a