i2pd/build/CMakeLists.txt

130 lines
2.6 KiB
CMake
Raw Normal View History

2014-04-03 19:54:43 +00:00
cmake_minimum_required ( VERSION 2.8 )
project ( i2pd )
2014-04-04 00:08:39 +00:00
# Default build is Debug
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wall")
#set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -Wall")
2014-04-03 19:54:43 +00:00
set ( SRC_DIR ".." )
set ( INC_DIR ".." )
2014-04-03 19:54:43 +00:00
add_definitions ( "-std=c++0x -Wall" )
set ( SOURCES
AddressBook.cpp
Garlic.cpp
HTTPServer.cpp
i2p.cpp
Identity.cpp
Log.cpp
NTCPSession.cpp
RouterContext.cpp
SSU.cpp
2014-04-23 18:48:02 +00:00
SSUData.cpp
2014-04-03 19:54:43 +00:00
TransitTunnel.cpp
Tunnel.cpp
TunnelGateway.cpp
UPnP.cpp
base64.cpp
HTTPProxy.cpp
I2NPProtocol.cpp
LeaseSet.cpp
NetDb.cpp
Reseed.cpp
RouterInfo.cpp
Streaming.cpp
Transports.cpp
TunnelEndpoint.cpp
TunnelPool.cpp
util.cpp
aes.cpp
2014-04-23 18:48:02 +00:00
Daemon.cpp
2014-07-14 17:06:16 +00:00
SOCKS.cpp
2014-04-03 19:54:43 +00:00
)
set ( HEADERS
AddressBook.h
Garlic.h
HTTPServer.h
Identity.h
Log.h
NTCPSession.h
RouterContext.h
SSU.h
2014-04-23 18:48:02 +00:00
SSUData.h
2014-04-03 19:54:43 +00:00
TransitTunnel.h
Tunnel.h
TunnelGateway.h
UPnP.h
base64.h
HTTPProxy.h
I2NPProtocol.h
LeaseSet.h
NetDb.h
Reseed.h
RouterInfo.h
Streaming.h
Transports.h
TunnelEndpoint.h
TunnelPool.h
util.h
aes.h
2014-04-23 18:48:02 +00:00
Daemon.h
2014-07-14 17:06:16 +00:00
SOCKS.h
2014-04-03 19:54:43 +00:00
)
2014-04-23 18:48:02 +00:00
if (WIN32)
list (APPEND SOURCES DeamonWin32.cpp)
else ()
list (APPEND SOURCES DaemonLinux.cpp)
endif ()
2014-04-03 19:54:43 +00:00
source_group ("Header Files" FILES ${HEADERS})
source_group ("Source Files" FILES ${SOURCES})
set ( CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules" )
2014-04-03 19:54:43 +00:00
find_package ( Threads REQUIRED )
find_package ( Boost COMPONENTS system filesystem regex program_options REQUIRED )
find_package ( CryptoPP REQUIRED )
# Check for libraries
if(NOT DEFINED Boost_INCLUDE_DIRS)
message(FATAL_ERROR "Boost is not found, or your boost version was bellow 1.46. Please download Boost!")
return()
endif()
if(NOT DEFINED CRYPTO++_INCLUDE_DIR)
message(FATAL_ERROR "Could not find Crypto++. Please download and install it first!")
return()
endif()
# End checks
include_directories ( ${Boost_INCLUDE_DIRS} ${CRYPTO++_INCLUDE_DIR})
2014-04-03 19:54:43 +00:00
unset ( TMP )
foreach ( src ${SOURCES} )
list ( APPEND TMP "${SRC_DIR}/${src}" )
endforeach ()
set ( SOURCES ${TMP} )
unset ( TMP )
foreach ( hdr ${HEADERS} )
list ( APPEND TMP "${INC_DIR}/${hdr}" )
endforeach ()
set ( HEADERS ${TMP} )
add_executable ( ${PROJECT_NAME} WIN32 ${HEADERS} ${SOURCES} )
target_link_libraries( ${PROJECT_NAME} ${Boost_LIBRARIES} ${CRYPTO++_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} )