Browse Source

Merge pull request #51 from cpubug/master

CMAKE support
pull/59/head
orignal 11 years ago
parent
commit
13b2036e52
  1. 2
      .gitignore
  2. 94
      build/CMakeLists.txt
  3. 28
      build/cmake_modules/FindCryptoPP.cmake

2
.gitignore vendored

@ -53,7 +53,6 @@ local.properties
[Dd]ebug/ [Dd]ebug/
[Rr]elease/ [Rr]elease/
x64/ x64/
build/
[Bb]in/ [Bb]in/
[Oo]bj/ [Oo]bj/
@ -200,7 +199,6 @@ $RECYCLE.BIN/
*.egg *.egg
*.egg-info *.egg-info
dist/ dist/
build/
eggs/ eggs/
parts/ parts/
var/ var/

94
build/CMakeLists.txt

@ -0,0 +1,94 @@
cmake_minimum_required ( VERSION 2.8 )
project ( i2pd )
set ( SRC_DIR ".." )
set ( INC_DIR ".." )
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
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
)
set ( HEADERS
AddressBook.h
Garlic.h
HTTPServer.h
Identity.h
Log.h
NTCPSession.h
RouterContext.h
SSU.h
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
)
source_group ("Header Files" FILES ${HEADERS})
source_group ("Source Files" FILES ${SOURCES})
find_package ( Threads REQUIRED )
find_package ( Boost COMPONENTS system filesystem regex program_options REQUIRED )
set ( CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules" )
find_package ( CryptoPP REQUIRED )
include_directories ( ${Boost_INCLUDE_DIRS} ${CryptoPP_INCLUDE_DIRS})
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} ${CryptoPP_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} )

28
build/cmake_modules/FindCryptoPP.cmake

@ -0,0 +1,28 @@
# Find Crypto++ library
#
# Output variables :
# CryptoPP_FOUND
# CryptoPP_INCLUDE_DIRS
# CryptoPP_LIBRARIES
#
FIND_PATH( CryptoPP_INCLUDE_DIR cryptopp/dsa.h )
FIND_LIBRARY( CryptoPP_LIBRARY NAMES cryptopp )
# handle the QUIETLY and REQUIRED arguments and set CRYPTOPP_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(${CMAKE_ROOT}/Modules/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(CryptoPP DEFAULT_MSG CryptoPP_LIBRARY CryptoPP_INCLUDE_DIR)
set ( CryptoPP_FOUND FALSE )
if ( ${CRYPTOPP_FOUND} )
set ( CryptoPP_FOUND TRUE )
set ( CryptoPP_INCLUDE_DIRS ${CryptoPP_INCLUDE_DIR} )
set ( CryptoPP_LIBRARIES ${CryptoPP_LIBRARY} )
endif ()
MARK_AS_ADVANCED(CryptoPP_INCLUDE_DIR CryptoPP_LIBRARY)
Loading…
Cancel
Save