mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2025-01-12 02:10:34 +00:00
Allow volk-gnsssdr to be built with std::experimental::filesystem if found
This commit is contained in:
parent
d89710e375
commit
c9822a435c
@ -229,8 +229,12 @@ if(CXX_FILESYSTEM_HAVE_FS)
|
||||
endif()
|
||||
|
||||
if(can_link)
|
||||
add_library(std::filesystem INTERFACE IMPORTED)
|
||||
target_compile_features(std::filesystem INTERFACE cxx_std_17)
|
||||
if(CMAKE_VERSION VERSION_LESS 3.12)
|
||||
add_library(std::filesystem INTERFACE IMPORTED GLOBAL)
|
||||
else()
|
||||
add_library(std::filesystem INTERFACE IMPORTED)
|
||||
target_compile_features(std::filesystem INTERFACE cxx_std_17)
|
||||
endif()
|
||||
set(_found TRUE)
|
||||
|
||||
if(CXX_FILESYSTEM_NO_LINK_NEEDED)
|
||||
|
@ -80,7 +80,7 @@ set(CMAKE_CXX_EXTENSIONS OFF)
|
||||
if(CMAKE_VERSION VERSION_LESS 3.8)
|
||||
set(FILESYSTEM_FOUND FALSE)
|
||||
else()
|
||||
find_package(FILESYSTEM)
|
||||
find_package(FILESYSTEM COMPONENTS Final Experimental)
|
||||
endif()
|
||||
|
||||
if((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32)
|
||||
|
@ -60,6 +60,9 @@ add_executable(volk_gnsssdr_profile
|
||||
|
||||
if(${FILESYSTEM_FOUND})
|
||||
add_definitions(-DHAS_STD_FILESYSTEM=1)
|
||||
if(${find_experimental})
|
||||
add_definitions(-DHAS_STD_FILESYSTEM_EXPERIMENTAL=1)
|
||||
endif()
|
||||
target_link_libraries(volk_gnsssdr_profile PRIVATE std::filesystem)
|
||||
endif()
|
||||
|
||||
|
@ -23,7 +23,11 @@
|
||||
#include "volk_gnsssdr/volk_gnsssdr_prefs.h" // for volk_gnsssdr_get_config_path
|
||||
#include "volk_gnsssdr_option_helpers.h" // for option_list, option_t
|
||||
#if HAS_STD_FILESYSTEM
|
||||
#if HAS_STD_FILESYSTEM_EXPERIMENTAL
|
||||
#include <experimental/filesystem>
|
||||
#else
|
||||
#include <filesystem>
|
||||
#endif
|
||||
#else
|
||||
#include <boost/filesystem/operations.hpp> // for create_directories, exists
|
||||
#include <boost/filesystem/path.hpp> // for path, operator<<
|
||||
@ -38,7 +42,11 @@
|
||||
#include <vector> // for vector, vector<>::const_..
|
||||
|
||||
#if HAS_STD_FILESYSTEM
|
||||
#if HAS_STD_FILESYSTEM_EXPERIMENTAL
|
||||
namespace fs = std::experimental::filesystem;
|
||||
#else
|
||||
namespace fs = std::filesystem;
|
||||
#endif
|
||||
#else
|
||||
namespace fs = boost::filesystem;
|
||||
#endif
|
||||
|
@ -228,8 +228,12 @@ if(CXX_FILESYSTEM_HAVE_FS)
|
||||
endif()
|
||||
|
||||
if(can_link)
|
||||
add_library(std::filesystem INTERFACE IMPORTED)
|
||||
target_compile_features(std::filesystem INTERFACE cxx_std_17)
|
||||
if(CMAKE_VERSION VERSION_LESS 3.12)
|
||||
add_library(std::filesystem INTERFACE IMPORTED GLOBAL)
|
||||
else()
|
||||
add_library(std::filesystem INTERFACE IMPORTED)
|
||||
target_compile_features(std::filesystem INTERFACE cxx_std_17)
|
||||
endif()
|
||||
set(_found TRUE)
|
||||
|
||||
if(CXX_FILESYSTEM_NO_LINK_NEEDED)
|
||||
|
Loading…
Reference in New Issue
Block a user