Added windows support to the standarized location

This commit is contained in:
Sean Qureshi 2013-08-18 03:12:55 -07:00
parent 31e29c46c5
commit ab830825bd
2 changed files with 3 additions and 2 deletions

View File

@ -5,7 +5,8 @@ cmake_policy(SET CMP0011 NEW)
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/DHT_bootstrap.cmake) include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/DHT_bootstrap.cmake)
if(WIN32) if(WIN32)
#Setup standard file locations for windows file(MAKE_DIRECTORY %appdata%/.tox)
file(INSTALL DHTservers DESTINATION %appdata%/.tox)
else() else()
set(HOME "$ENV{HOME}") set(HOME "$ENV{HOME}")
file(MAKE_DIRECTORY ${HOME}/.tox) file(MAKE_DIRECTORY ${HOME}/.tox)

View File

@ -93,7 +93,7 @@ int init_connection(void)
return 0; return 0;
#if defined(WIN32) || defined(_WIN32) || defined(__WIN32) && !defined(__CYGWIN__) #if defined(WIN32) || defined(_WIN32) || defined(__WIN32) && !defined(__CYGWIN__)
FILE *fp = fopen("DHTservers", "r"); FILE *fp = fopen("%appdata%/.tox/DHTservers", "r");
#else #else
FILE *fp = fopen("~/.tox/DHTservers", "r"); FILE *fp = fopen("~/.tox/DHTservers", "r");
#endif #endif