Properly handle when the build directory has spaces in its name.
This commit is contained in:
@@ -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
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user