Properly handle when the build directory has spaces in its name.

This commit is contained in:
Ryan Curtin
2016-09-16 18:28:09 -04:00
parent f13e7f33c8
commit 7b1c09a2c0
2 changed files with 6 additions and 5 deletions
+4 -3
View File
@@ -5,12 +5,13 @@
# And our goal in this file is to generate/configure mlpack.pc.
# First, we need to extract the version string.
if (NOT EXISTS "${MLPACK_SOURCE_DIR}/mlpack/core/util/version.hpp")
if (NOT EXISTS "${CMAKE_BINARY_DIR}/include/mlpack/core/util/version.hpp")
message(FATAL_ERROR "Cannot open "
"${MLPACK_SOURCE_DIR}/mlpack/core/util/version.hpp to extract version!")
"${CNAKE_BINARY_DIR}/include/mlpack/core/util/version.hpp to extract "
"version!")
endif ()
file(READ "${MLPACK_SOURCE_DIR}/mlpack/core/util/version.hpp"
file(READ "${CMAKE_BINARY_DIR}/include/mlpack/core/util/version.hpp"
VERSION_HPP_CONTENTS)
string(REGEX REPLACE ".*#define MLPACK_VERSION_MAJOR ([0-9]+).*" "\\1"
MLPACK_VERSION_MAJOR "${VERSION_HPP_CONTENTS}")
+2 -2
View File
@@ -534,10 +534,10 @@ if (PKG_CONFIG_FOUND)
add_custom_target(pkgconfig ALL
${CMAKE_COMMAND}
-D MLPACK_SOURCE_DIR="${CMAKE_BINARY_DIR}/include/"
-P "${CMAKE_CURRENT_SOURCE_DIR}/CMake/GeneratePkgConfig.cmake"
DEPENDS mlpack_headers
COMMENT "Generating mlpack.pc (pkg-config) file.")
COMMENT "Generating mlpack.pc (pkg-config) file."
VERBATIM)
# Do we need a different directory?
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/lib/pkgconfig/mlpack.pc