@ -11,6 +11,7 @@ option(WITH_UPNP "Include support for UPnP client" OFF)
@@ -11,6 +11,7 @@ option(WITH_UPNP "Include support for UPnP client" OFF)
option ( WITH_TESTS "Build unit tests" OFF )
option ( WITH_BENCHMARK "Build benchmarking code" OFF )
option ( WITH_OPTIMIZE "Optimization flags" OFF )
option ( I2PD_DATA_PATH "The path to the i2pd data folder" )
set ( CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/build/cmake_modules" )
set ( CMAKE_RUNTIME_OUTPUT_DIRECTORY ${ CMAKE_BINARY_DIR } )
@ -153,6 +154,18 @@ include_directories(
@@ -153,6 +154,18 @@ include_directories(
" c o r e / "
)
if ( I2PD_DATA_PATH )
set ( I2PD_DATA_DIR ${ I2PD_DATA_PATH } )
# U s i n g c u s t o m p a t h , m a k e s u r e t h e c o d e k n o w s a b o u t t h i s
add_definitions ( -DI2PD_CUSTOM_DATA_PATH= "${I2PD_DATA_PATH}" )
elseif ( CMAKE_SYSTEM_NAME STREQUAL "Windows" )
set ( I2PD_DATA_DIR "$ENV{APPDATA}\i2pd" )
elseif ( CMAKE_SYSTEM_NAME STREQUAL "Darwin" )
set ( I2PD_DATA_DIR "$ENV{HOME}/Library/Application Support/i2pd" )
else ( )
set ( I2PD_DATA_DIR "$ENV{HOME}/.i2pd" )
endif ( )
# S h o w s u m m a r y
message ( STATUS "---------------------------------------" )
message ( STATUS "Build type : ${CMAKE_BUILD_TYPE}" )
@ -160,6 +173,7 @@ message(STATUS "Compiler vendor : ${CMAKE_CXX_COMPILER_ID}")
@@ -160,6 +173,7 @@ message(STATUS "Compiler vendor : ${CMAKE_CXX_COMPILER_ID}")
message ( STATUS "Compiler version : ${CMAKE_CXX_COMPILER_VERSION}" )
message ( STATUS "Compiler path : ${CMAKE_CXX_COMPILER}" )
message ( STATUS "Install prefix: : ${CMAKE_INSTALL_PREFIX}" )
message ( STATUS "I2PD data directory: ${I2PD_DATA_DIR}" )
message ( STATUS "Options:" )
message ( STATUS " AESNI : ${WITH_AESNI}" )
message ( STATUS " HARDENING : ${WITH_HARDENING}" )
@ -183,3 +197,8 @@ add_subdirectory(core)
@@ -183,3 +197,8 @@ add_subdirectory(core)
add_subdirectory ( client )
add_subdirectory ( tests )
add_subdirectory ( benchmark )
if ( WITH_BINARY )
file ( MAKE_DIRECTORY "${I2PD_DATA_DIR}/webui" )
file ( COPY "${CMAKE_CURRENT_SOURCE_DIR}/webui" DESTINATION "${I2PD_DATA_DIR}" )
endif ( )