Changeset 656
- Timestamp:
- 03/23/07 01:20:19 (17 months ago)
- Location:
- branches/newnet/museekd
- Files:
-
- 4 modified
-
. (modified) (1 prop)
-
CMakeLists.txt (modified) (1 diff)
-
Mucipher/CMakeLists.txt (modified) (2 diffs)
-
museekd/CMakeLists.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/newnet/museekd
- Property svn:externals
-
old new 1 NewNet -r6 69https://svn.thegraveyard.org:8043/repos/NewNet/trunk/NewNet1 NewNet -r673 https://svn.thegraveyard.org:8043/repos/NewNet/trunk/NewNet
-
- Property svn:externals
-
branches/newnet/museekd/CMakeLists.txt
r655 r656 1 PROJECT(museekd) 1 project(museekd) 2 3 # Include some cmake checks. 4 include(CheckIncludeFiles) 5 include(CheckTypeSize) 6 include(CheckFunctionExists) 7 include(CheckLibraryExists) 8 include(CheckCXXSourceCompiles) 2 9 3 10 # Enable NewNet's smart-pointer debugging capabilities. 4 ADD_DEFINITIONS(-DNN_PTR_DEBUG -DNN_PTR_DEBUG_ASSERT)11 add_definitions(-DNN_PTR_DEBUG -DNN_PTR_DEBUG_ASSERT) 5 12 6 INCLUDE_DIRECTORIES(.) 13 # Add top source directory to the include path. 14 include_directories(.) 7 15 8 INCLUDE(CheckIncludeFiles) 9 INCLUDE(CheckTypeSize) 10 INCLUDE(CheckFunctionExists) 11 INCLUDE(CheckLibraryExists) 12 INCLUDE(CheckCXXSourceCompiles) 13 14 # Check for common include files 15 CHECK_INCLUDE_FILES(stdlib.h HAVE_STDLIB_H) 16 CHECK_INCLUDE_FILES(stdint.h HAVE_STDINT_H) 17 CHECK_INCLUDE_FILES(stddef.h HAVE_STDDEF_H) 18 CHECK_INCLUDE_FILES(unistd.h HAVE_UNISTD_H) 19 CHECK_INCLUDE_FILES(string.h HAVE_STRING_H) 20 CHECK_INCLUDE_FILES(errno.h HAVE_ERRNO_H) 21 CHECK_INCLUDE_FILES(fcntl.h HAVE_FCNTL_H) 22 CHECK_INCLUDE_FILES(netdb.h HAVE_NETDB_H) 23 CHECK_INCLUDE_FILES(sys/types.h HAVE_SYS_TYPES_H) 24 CHECK_INCLUDE_FILES(sys/time.h HAVE_SYS_TIME_H) 25 CHECK_INCLUDE_FILES(sys/select.h HAVE_SYS_SELECT_H) 26 CHECK_INCLUDE_FILES(sys/socket.h HAVE_SYS_SOCKET_H) 27 CHECK_INCLUDE_FILES(sys/un.h HAVE_SYS_UN_H) 28 CHECK_INCLUDE_FILES(sys/stat.h HAVE_SYS_STAT_H) 29 CHECK_INCLUDE_FILES(netinet/in.h HAVE_NETINET_IN_H) 30 CHECK_INCLUDE_FILES(netinet/tcp.h HAVE_NETINET_TCP_H) 31 CHECK_INCLUDE_FILES(windows.h HAVE_WINDOWS_H) 32 CHECK_INCLUDE_FILES(winsock.h HAVE_WINSOCK_H) 16 # Check for common include files. 17 check_include_files(stdlib.h HAVE_STDLIB_H) 18 check_include_files(stdint.h HAVE_STDINT_H) 19 check_include_files(stddef.h HAVE_STDDEF_H) 20 check_include_files(unistd.h HAVE_UNISTD_H) 21 check_include_files(string.h HAVE_STRING_H) 22 check_include_files(errno.h HAVE_ERRNO_H) 23 check_include_files(fcntl.h HAVE_FCNTL_H) 24 check_include_files(netdb.h HAVE_NETDB_H) 25 check_include_files(sys/types.h HAVE_SYS_TYPES_H) 26 check_include_files(sys/time.h HAVE_SYS_TIME_H) 27 check_include_files(sys/select.h HAVE_SYS_SELECT_H) 28 check_include_files(sys/socket.h HAVE_SYS_SOCKET_H) 29 check_include_files(sys/un.h HAVE_SYS_UN_H) 30 check_include_files(sys/stat.h HAVE_SYS_STAT_H) 31 check_include_files(netinet/in.h HAVE_NETINET_IN_H) 32 check_include_files(netinet/tcp.h HAVE_NETINET_TCP_H) 33 check_include_files(windows.h HAVE_WINDOWS_H) 34 check_include_files(winsock.h HAVE_WINSOCK_H) 33 35 34 36 # Check for some standard types and type sizes 35 CHECK_TYPE_SIZE("unsigned char" UNSIGNED_CHAR)36 CHECK_TYPE_SIZE("unsigned short" UNSIGNED_SHORT)37 CHECK_TYPE_SIZE("unsigned int" UNSIGNED_INT)38 CHECK_TYPE_SIZE("unsigned long" UNSIGNED_LONG)39 CHECK_TYPE_SIZE("unsigned long long" UNSIGNED_LONG_LONG)40 CHECK_TYPE_SIZE("uint" UINT)41 CHECK_TYPE_SIZE("uint32" UINT32)37 check_type_size("unsigned char" UNSIGNED_CHAR) 38 check_type_size("unsigned short" UNSIGNED_SHORT) 39 check_type_size("unsigned int" UNSIGNED_INT) 40 check_type_size("unsigned long" UNSIGNED_LONG) 41 check_type_size("unsigned long long" UNSIGNED_LONG_LONG) 42 check_type_size("uint" UINT) 43 check_type_size("uint32" UINT32) 42 44 43 45 # Determine the type to use as uint32. 44 IF(HAVE_UINT32)45 SET(UINT32_TYPE uint32)46 ELSEIF(UNSIGNED_CHAR EQUAL 4)47 SET(UINT32_TYPE "unsigned char")48 ELSEIF(UNSIGNED_SHORT EQUAL 4)49 SET(UINT32_TYPE "unsigned short")50 ELSEIF(UNSIGNED_INT EQUAL 4)51 SET(UINT32_TYPE "unsigned int")52 ELSEIF(UNSIGNED_LONG EQUAL 4)53 SET(UINT32_TYPE "unsigned long")54 ELSEIF(UNSIGNED_LONG_LONG EQUAL 4)55 SET(UINT32_TYPE "unsigned long long")56 ELSE(UNSIGNED_LONG_LONG EQUAL 4)57 FATAL_ERROR("Couldn't determine 32bit unsigned interger type.")58 ENDIF(HAVE_UINT32)46 if(HAVE_UINT32) 47 set(UINT32_TYPE uint32) 48 elseif(UNSIGNED_CHAR EQUAL 4) 49 set(UINT32_TYPE "unsigned char") 50 elseif(UNSIGNED_SHORT EQUAL 4) 51 set(UINT32_TYPE "unsigned short") 52 elseif(UNSIGNED_INT EQUAL 4) 53 set(UINT32_TYPE "unsigned int") 54 elseif(UNSIGNED_LONG EQUAL 4) 55 set(UINT32_TYPE "unsigned long") 56 elseif(UNSIGNED_LONG_LONG EQUAL 4) 57 set(UINT32_TYPE "unsigned long long") 58 else(UNSIGNED_LONG_LONG EQUAL 4) 59 message(FATAL_ERROR "Couldn't determine 32bit unsigned interger type.") 60 endif(HAVE_UINT32) 59 61 60 62 # Check for iconv.h 61 CHECK_INCLUDE_FILES(iconv.h HAVE_ICONV_H)62 IF(NOT HAVE_ICONV_H)63 FATAL_ERROR("Could not find iconv.h.")64 ENDIF(NOT HAVE_ICONV_H)63 check_include_files(iconv.h HAVE_ICONV_H) 64 if(NOT HAVE_ICONV_H) 65 MESSAGE(FATAL_ERROR "Could not find iconv.h.") 66 endif(NOT HAVE_ICONV_H) 65 67 66 68 # Check for iconv library (if we need it) 67 CHECK_FUNCTION_EXISTS(iconv HAVE_ICONV_BUILTIN)68 IF(HAVE_ICONV_BUILTIN)69 SET(ICONV_LIBRARIES "")70 ELSE(HAVE_ICONV_BUILTIN)71 FIND_LIBRARY(ICONV_LIBRARIES NAMES iconv PATHS /usr/lib /usr/local/lib)72 IF(NOT ICONV_LIBRARIES)73 MESSAGE(FATAL_ERROR "Couldn't find iconv library.")74 ENDIF(NOT ICONV_LIBRARIES)75 ENDIF(HAVE_ICONV_BUILTIN)69 check_function_exists(iconv HAVE_ICONV_BUILTIN) 70 if(HAVE_ICONV_BUILTIN) 71 set(ICONV_LIBRARIES "") 72 else(HAVE_ICONV_BUILTIN) 73 find_library(ICONV_LIBRARIES NAMES iconv PATHS /usr/lib /usr/local/lib) 74 if(NOT ICONV_LIBRARIES) 75 message(FATAL_ERROR "Couldn't find iconv library.") 76 endif(NOT ICONV_LIBRARIES) 77 endif(HAVE_ICONV_BUILTIN) 76 78 77 # Check if iconv() takes const char ** 78 SET(CMAKE_REQUIRED_LIBRARIES ${ICONV_LIBRARIES}) 79 CHECK_CXX_SOURCE_COMPILES(" 79 # Use the iconv library (if any) for the following tests. 80 set(CMAKE_REQUIRED_LIBRARIES ${ICONV_LIBRARIES}) 81 82 # Check if iconv() takes const char **. 83 check_cxx_source_compiles(" 80 84 #include <iconv.h> 81 int main() 82 { 83 return iconv(0, (const char **)0, 0, (char**)0, 0); 84 } 85 int main(int argc, char ** argv) 86 { return iconv(0, (const char **)0, 0, (char**)0, 0); } 85 87 " ICONV_CONST) 86 88 87 # Check if iconv() takes char ** 88 CHECK_CXX_SOURCE_COMPILES("89 # Check if iconv() takes char **. 90 check_cxx_source_compiles(" 89 91 #include <iconv.h> 90 int main() 91 { 92 return iconv(0, (char **)0, 0, (char**)0, 0); 93 } 92 int main(int argc, char ** argv) 93 { return iconv(0, (char **)0, 0, (char**)0, 0); } 94 94 " ICONV_NON_CONST) 95 95 96 # Not const char ** AND not char **? Uhh.. 97 IF(NOT ICONV_CONST AND NOT ICONV_NON_CONST) 98 FATAL_ERROR("Problem with iconv: could not determine iconv() input type.") 99 ENDIF(NOT ICONV_CONST AND NOT ICONV_NON_CONST) 100 SET(CMAKE_REQUIRED_LIBRARIES) 96 # Not const char ** AND not char **? Uhh.. That's bad mmkay. 97 if(NOT ICONV_CONST AND NOT ICONV_NON_CONST) 98 message(FATAL_ERROR "Problem with iconv: could not determine iconv() input type.") 99 endif(NOT ICONV_CONST AND NOT ICONV_NON_CONST) 100 101 # Clean up after iconv tests. 102 set(CMAKE_REQUIRED_LIBRARIES) 101 103 102 104 # Process config.h.cmake to config.h. 103 CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h)105 configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h) 104 106 # Add -DHAVE_CONFIG_H. 105 ADD_DEFINITIONS(-DHAVE_CONFIG_H)107 add_definitions(-DHAVE_CONFIG_H) 106 108 # Make sure config.h can be found. 107 INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR})109 include_directories(${CMAKE_CURRENT_BINARY_DIR}) 108 110 109 # Check for some OS specific libraries 110 IF(WIN32) 111 SET(OS_LIBRARIES ole32 shell32 wsock32) 112 ELSE(WIN32) 113 SET(OS_LIBRARIES "") 114 ENDIF(WIN32) 111 # Set up new net libraries variable. 112 set(NEWNET_LIBRARIES NewNet) 113 if(WIN32 AND NOT CYGWIN) 114 set(NEWNET_LIBRARIES ${NEWNET_LIBRARIES} wsock32) 115 endif(WIN32 AND NOT CYGWIN) 115 116 116 117 # Where the wild things are... 117 SUBDIRS(NewNet Mucipher museekd) 118 add_subdirectory(NewNet) 119 add_subdirectory(Mucipher) 120 add_subdirectory(museekd) -
branches/newnet/museekd/Mucipher/CMakeLists.txt
r653 r656 1 PROJECT(Mucipher C)2 SET(MUCIPHER_SRCS1 project(Mucipher C) 2 set(MUCIPHER_SOURCES 3 3 aes.c 4 4 hexdigest.c … … 7 7 sha256.c 8 8 ) 9 ADD_LIBRARY(Mucipher STATIC ${MUCIPHER_SRCS})9 add_library(Mucipher STATIC ${MUCIPHER_SOURCES}) -
branches/newnet/museekd/museekd/CMakeLists.txt
r655 r656 1 PROJECT(museekd CXX)1 project(museekd CXX) 2 2 3 FIND_PACKAGE(ZLIB REQUIRED) 4 FIND_PACKAGE(LibXml2 REQUIRED) 3 # Find ZLib 4 find_package(ZLIB REQUIRED) 5 include_directories(${ZLIB_INCLUDE_DIR}) 5 6 6 INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIR} ${LIBXML2_INCLUDE_DIR}) 7 ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) 7 # Find LibXml2 8 find_package(LibXml2 REQUIRED) 9 include_directories(${LIBXML2_INCLUDE_DIR}) 10 add_definitions(${LIBXML2_DEFINITIONS}) 8 11 9 SET(MUSEEKD_SRCS 12 # Check for some OS specific libraries 13 set(OS_LIBRARIES "") 14 if(WIN32 AND NOT CYGWIN) 15 set(OS_LIBRARIES ${OS_LIBRARIES} ole32 shell32) 16 endif(WIN32 AND NOT CYGWIN) 17 18 # Select some source files. 19 set(MUSEEKD_SOURCES 10 20 codesetmanager.cpp ifacemanager.cpp peermanager.cpp 11 21 configmanager.cpp ifacesocket.cpp peersocket.cpp … … 15 25 handshakesocket.cpp networkmessage.cpp usersocket.cpp 16 26 ) 17 ADD_EXECUTABLE(museekd ${MUSEEKD_SRCS}) 18 TARGET_LINK_LIBRARIES(museekd Mucipher NewNet ${ZLIB_LIBRARIES} ${LIBXML2_LIBRARIES} ${ICONV_LIBRARIES} ${OS_LIBRARIES}) 19 INSTALL(TARGETS museekd DESTINATION bin) 27 28 # Build the museekd binary. 29 add_executable(museekd ${MUSEEKD_SOURCES}) 30 31 # Link the museekd binary to some libraries. 32 target_link_libraries( 33 museekd 34 Mucipher 35 ${NEWNET_LIBRARIES} 36 ${ZLIB_LIBRARIES} 37 ${LIBXML2_LIBRARIES} 38 ${ICONV_LIBRARIES} 39 ${OS_LIBRARIES} 40 ) 41 42 # Install the museekd binary to the 'bin' directory. 43 install( 44 TARGETS museekd 45 DESTINATION bin 46 )
