This commit is contained in:
2020-10-10 09:56:42 +08:00
parent deb1de2b61
commit 5b0b5aa819
2 changed files with 22 additions and 0 deletions
+7
View File
@@ -0,0 +1,7 @@
cmake_minimum_required(VERSION 3.12)
project(test_env)
set(CMAKE_CXX_STANDARD 14)
add_executable(test_env main.cpp)
target_link_libraries(test_env boost_system boost_filesystem)
+15
View File
@@ -0,0 +1,15 @@
#include <iostream>
#include <cstdlib>
#include <boost/filesystem.hpp>
using namespace std;
int main() {
boost::filesystem::path keyStorePath;
if (std::getenv("HOME") != nullptr) {
keyStorePath = boost::filesystem::path(std::getenv("HOME")) / ".ndn";
} else {
keyStorePath = boost::filesystem::current_path() / ".ndn";
}
cout << keyStorePath.string() << endl;
return 0;
}