mirror of
https://git.mirrors.martin98.com/https://github.com/google/draco
synced 2025-08-17 02:25:56 +08:00
Merge branch 'master' into v157_snapshot
This commit is contained in:
commit
dcce9d0b3a
@ -23,6 +23,7 @@ include(GNUInstallDirs)
|
|||||||
# Sets up the draco install targets. Must be called after the static library
|
# Sets up the draco install targets. Must be called after the static library
|
||||||
# target is created.
|
# target is created.
|
||||||
macro(draco_setup_install_target)
|
macro(draco_setup_install_target)
|
||||||
|
if(DRACO_INSTALL)
|
||||||
set(bin_path "${CMAKE_INSTALL_BINDIR}")
|
set(bin_path "${CMAKE_INSTALL_BINDIR}")
|
||||||
set(data_path "${CMAKE_INSTALL_DATAROOTDIR}")
|
set(data_path "${CMAKE_INSTALL_DATAROOTDIR}")
|
||||||
set(includes_path "${CMAKE_INSTALL_INCLUDEDIR}")
|
set(includes_path "${CMAKE_INSTALL_INCLUDEDIR}")
|
||||||
@ -118,4 +119,5 @@ macro(draco_setup_install_target)
|
|||||||
install(FILES "${draco_build}/draco-config.cmake"
|
install(FILES "${draco_build}/draco-config.cmake"
|
||||||
"${draco_build}/draco-config-version.cmake"
|
"${draco_build}/draco-config-version.cmake"
|
||||||
DESTINATION "${data_path}/cmake/draco")
|
DESTINATION "${data_path}/cmake/draco")
|
||||||
|
endif(DRACO_INSTALL)
|
||||||
endmacro()
|
endmacro()
|
||||||
|
@ -131,6 +131,10 @@ macro(draco_set_default_options)
|
|||||||
NAME DRACO_DEBUG_COMPILER_WARNINGS
|
NAME DRACO_DEBUG_COMPILER_WARNINGS
|
||||||
HELPSTRING "Turn on more warnings."
|
HELPSTRING "Turn on more warnings."
|
||||||
VALUE OFF)
|
VALUE OFF)
|
||||||
|
draco_option(
|
||||||
|
NAME DRACO_INSTALL
|
||||||
|
HELPSTRING "Enable installation."
|
||||||
|
VALUE ON)
|
||||||
draco_check_deprecated_options()
|
draco_check_deprecated_options()
|
||||||
endmacro()
|
endmacro()
|
||||||
|
|
||||||
|
@ -38,11 +38,10 @@ bool DirectoryExists(const std::string &path_arg) {
|
|||||||
struct stat path_stat;
|
struct stat path_stat;
|
||||||
std::string path = path_arg;
|
std::string path = path_arg;
|
||||||
|
|
||||||
#if defined(_WIN32) && not defined(__MINGW32__)
|
#if defined(_WIN32) && !defined(__MINGW32__)
|
||||||
// Avoid a silly windows issue: stat() will fail on a drive letter missing the
|
// Avoid a silly windows issue: stat() will fail on a drive letter missing the
|
||||||
// trailing slash.
|
// trailing slash. To keep it simple, append a path separator to all paths.
|
||||||
if (path.size() > 0 && path[path.size()] != '\\' &&
|
if (!path.empty() && path.back() != '\\' && path.back() != '/') {
|
||||||
path[path.size()] != '/') {
|
|
||||||
path.append("\\");
|
path.append("\\");
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -68,9 +67,7 @@ bool CheckAndCreatePathForFile(const std::string &filename) {
|
|||||||
const ghc::filesystem::path ghc_path(path);
|
const ghc::filesystem::path ghc_path(path);
|
||||||
ghc::filesystem::create_directories(ghc_path);
|
ghc::filesystem::create_directories(ghc_path);
|
||||||
#endif // DRACO_TRANSCODER_SUPPORTED
|
#endif // DRACO_TRANSCODER_SUPPORTED
|
||||||
const bool directory_exists = DirectoryExists(path);
|
return DirectoryExists(path);
|
||||||
|
|
||||||
return directory_exists;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace draco
|
} // namespace draco
|
||||||
|
Loading…
x
Reference in New Issue
Block a user