Skip to content
Permalink
Browse files

Converting from Subversion to Git.

Signed-off-by: Steven Noonan <steven@uplinklabs.net>
  • Loading branch information...
tycho committed Oct 18, 2008
0 parents commit 61f47a6a0284f1b8ca29bb25cd31be18d63e0529
Showing with 33,026 additions and 0 deletions.
  1. +4 −0 .gitignore
  2. +159 −0 CHANGES
  3. +177 −0 CMakeLists.txt
  4. +10 −0 COPYING
  5. +271 −0 Doxyfile
  6. +10 −0 INSTALL
  7. +2 −0 TODO
  8. +7 −0 TestSuite/.gitignore
  9. +4 −0 TestSuite/CMakeLists.txt
  10. +3 −0 TestSuite/TestSuite.xcodeproj/.gitignore
  11. +438 −0 TestSuite/TestSuite.xcodeproj/project.pbxproj
  12. +157 −0 TestSuite/avltree.cpp
  13. +19 −0 TestSuite/avltree.h
  14. +80 −0 TestSuite/bubblesort.cpp
  15. +23 −0 TestSuite/bubblesort.h
  16. +77 −0 TestSuite/combsort.cpp
  17. +19 −0 TestSuite/combsort.h
  18. +64 −0 TestSuite/compare.cpp
  19. +19 −0 TestSuite/compare.h
  20. +48 −0 TestSuite/darray.cpp
  21. +17 −0 TestSuite/darray.h
  22. +59 −0 TestSuite/datatypes.cpp
  23. +29 −0 TestSuite/datatypes.h
  24. +42 −0 TestSuite/dstack.cpp
  25. +17 −0 TestSuite/dstack.h
  26. +140 −0 TestSuite/hashtable.cpp
  27. +19 −0 TestSuite/hashtable.h
  28. +1 −0 TestSuite/header.cpp
  29. +22 −0 TestSuite/header.h
  30. +77 −0 TestSuite/heapsort.cpp
  31. +19 −0 TestSuite/heapsort.h
  32. +80 −0 TestSuite/insertionsort.cpp
  33. +23 −0 TestSuite/insertionsort.h
  34. +58 −0 TestSuite/llist.cpp
  35. +17 −0 TestSuite/llist.h
  36. +151 −0 TestSuite/main.cpp
  37. +74 −0 TestSuite/md2.cpp
  38. +21 −0 TestSuite/md2.h
  39. +70 −0 TestSuite/md4.cpp
  40. +17 −0 TestSuite/md4.h
  41. +70 −0 TestSuite/md5.cpp
  42. +17 −0 TestSuite/md5.h
  43. +81 −0 TestSuite/quicksort.cpp
  44. +19 −0 TestSuite/quicksort.h
  45. +168 −0 TestSuite/rbtree.cpp
  46. +19 −0 TestSuite/rbtree.h
  47. +61 −0 TestSuite/sha1.cpp
  48. +17 −0 TestSuite/sha1.h
  49. +61 −0 TestSuite/sha256.cpp
  50. +17 −0 TestSuite/sha256.h
  51. +62 −0 TestSuite/sha512.cpp
  52. +17 −0 TestSuite/sha512.h
  53. +77 −0 TestSuite/shellsort.cpp
  54. +19 −0 TestSuite/shellsort.h
  55. +168 −0 TestSuite/splaytree.cpp
  56. +19 −0 TestSuite/splaytree.h
  57. +38 −0 TestSuite/stopwatch.cpp
  58. +17 −0 TestSuite/stopwatch.h
  59. +3 −0 TestSuite/testfile
  60. +54 −0 TestSuite/testutils.cpp
  61. +34 −0 TestSuite/testutils.h
  62. +62 −0 TestSuite/tiger.cpp
  63. +17 −0 TestSuite/tiger.h
  64. +23 −0 clean.sh
  65. +1 −0 doc/.gitignore
  66. +6 −0 examples/.gitignore
  67. +7 −0 examples/CMakeLists.txt
  68. +7 −0 examples/CPSAT/.gitignore
  69. +4 −0 examples/CPSAT/CMakeLists.txt
  70. +12 −0 examples/CPSAT/header.cpp
  71. +17 −0 examples/CPSAT/header.h
  72. +44 −0 examples/CPSAT/main.cpp
  73. +1,421 −0 examples/CPSAT/rijndael-alg-fst.cpp
  74. +47 −0 examples/CPSAT/rijndael-alg-fst.h
  75. +472 −0 examples/CPSAT/rijndael-api-fst.cpp
  76. +107 −0 examples/CPSAT/rijndael-api-fst.h
  77. +1,012 −0 examples/CPSAT/rijndael-test-fst.c
  78. +85 −0 examples/CPSAT/rijndael.cpp
  79. +7 −0 examples/CPSAT/rijndael.h
  80. +128 −0 examples/CPSAT/table.128
  81. +128 −0 examples/CPSAT/table.192
  82. +128 −0 examples/CPSAT/table.256
  83. +7 −0 examples/CPUID/.gitignore
  84. +4 −0 examples/CPUID/CMakeLists.txt
  85. +12 −0 examples/CPUID/header.cpp
  86. +20 −0 examples/CPUID/header.h
  87. +149 −0 examples/CPUID/main.cpp
  88. +7 −0 examples/CheckMark/.gitignore
  89. +4 −0 examples/CheckMark/CMakeLists.txt
  90. +168 −0 examples/CheckMark/adler32.cpp
  91. +17 −0 examples/CheckMark/adler32.h
  92. +61 −0 examples/CheckMark/crc32.cpp
  93. +17 −0 examples/CheckMark/crc32.h
  94. +12 −0 examples/CheckMark/header.cpp
  95. +29 −0 examples/CheckMark/header.h
  96. +157 −0 examples/CheckMark/main.cpp
  97. +37 −0 examples/CheckMark/random.cpp
  98. +17 −0 examples/CheckMark/random.h
  99. +7 −0 examples/EmptyProject/.gitignore
  100. +4 −0 examples/EmptyProject/CMakeLists.txt
  101. +12 −0 examples/EmptyProject/header.cpp
  102. +17 −0 examples/EmptyProject/header.h
  103. +34 −0 examples/EmptyProject/main.cpp
  104. +7 −0 examples/GenPrime/.gitignore
  105. +4 −0 examples/GenPrime/CMakeLists.txt
  106. +12 −0 examples/GenPrime/header.cpp
  107. +20 −0 examples/GenPrime/header.h
  108. +242 −0 examples/GenPrime/main.cpp
  109. +7 −0 examples/SimpleTCPClient/.gitignore
  110. +4 −0 examples/SimpleTCPClient/CMakeLists.txt
  111. +12 −0 examples/SimpleTCPClient/header.cpp
  112. +17 −0 examples/SimpleTCPClient/header.h
  113. +72 −0 examples/SimpleTCPClient/main.cpp
  114. +7 −0 examples/SortBenchmark/.gitignore
  115. +4 −0 examples/SortBenchmark/CMakeLists.txt
  116. +5,000 −0 examples/SortBenchmark/dataset
  117. +12 −0 examples/SortBenchmark/header.cpp
  118. +20 −0 examples/SortBenchmark/header.h
  119. +146 −0 examples/SortBenchmark/main.cpp
  120. +6 −0 source/.gitignore
  121. +20 −0 source/CMakeLists.txt
  122. +511 −0 source/console.cpp
  123. +323 −0 source/core_io_reader.cpp
  124. +222 −0 source/core_io_writer.cpp
  125. +79 −0 source/core_network.cpp
  126. +341 −0 source/core_socket.cpp
  127. +985 −0 source/cpuid.cpp
  128. +3 −0 source/crisscross/.gitignore
  129. +707 −0 source/crisscross/avltree.cpp
  130. +357 −0 source/crisscross/avltree.h
  131. +64 −0 source/crisscross/bubblesort.h
  132. +80 −0 source/crisscross/combsort.h
  133. +75 −0 source/crisscross/compare.h
  134. +203 −0 source/crisscross/console.h
  135. +50 −0 source/crisscross/core_io.h
  136. +159 −0 source/crisscross/core_io_reader.h
  137. +118 −0 source/crisscross/core_io_writer.h
  138. +29 −0 source/crisscross/core_network.h
  139. +219 −0 source/crisscross/core_socket.h
  140. +158 −0 source/crisscross/cpuid.h
  141. +56 −0 source/crisscross/crisscross.h
  142. +391 −0 source/crisscross/darray.cpp
  143. +302 −0 source/crisscross/darray.h
  144. +49 −0 source/crisscross/datatypes.h
  145. +54 −0 source/crisscross/debug.h
  146. +54 −0 source/crisscross/deprecate.h
  147. +116 −0 source/crisscross/dstack.cpp
  148. +95 −0 source/crisscross/dstack.h
  149. +46 −0 source/crisscross/error.h
  150. +52 −0 source/crisscross/exception_handler.h
  151. +58 −0 source/crisscross/filereader.h
  152. +60 −0 source/crisscross/filewriter.h
  153. +87 −0 source/crisscross/hash.h
  154. +121 −0 source/crisscross/hashtable.cpp
  155. +127 −0 source/crisscross/hashtable.h
  156. +84 −0 source/crisscross/heapsort.h
  157. +60 −0 source/crisscross/insertionsort.h
  158. +99 −0 source/crisscross/internal_mem.h
  159. +365 −0 source/crisscross/llist.cpp
  160. +279 −0 source/crisscross/llist.h
  161. +119 −0 source/crisscross/md2.h
  162. +120 −0 source/crisscross/md4.h
  163. +119 −0 source/crisscross/md5.h
  164. +68 −0 source/crisscross/mini_version.h
  165. +72 −0 source/crisscross/mutex.h
  166. +205 −0 source/crisscross/node.h
  167. +255 −0 source/crisscross/platform_detect.h
  168. +72 −0 source/crisscross/quicksort.h
  169. +548 −0 source/crisscross/rbtree.cpp
  170. +249 −0 source/crisscross/rbtree.h
  171. +109 −0 source/crisscross/sha1.h
  172. +111 −0 source/crisscross/sha256.h
  173. +116 −0 source/crisscross/sha512.h
  174. +62 −0 source/crisscross/shellsort.h
  175. +76 −0 source/crisscross/sort.h
  176. +386 −0 source/crisscross/splaytree.cpp
  177. +212 −0 source/crisscross/splaytree.h
  178. +111 −0 source/crisscross/stopwatch.h
  179. +96 −0 source/crisscross/system.h
  180. +77 −0 source/crisscross/tcpsocket.h
  181. +118 −0 source/crisscross/tiger.h
  182. +64 −0 source/crisscross/udpsocket.h
  183. +384 −0 source/crisscross/universal_include.h
  184. +46 −0 source/crisscross/version.h
  185. +70 −0 source/crisscross/windows_version.h
  186. +250 −0 source/debug.cpp
  187. +151 −0 source/error.cpp
  188. +822 −0 source/exception_handler.cpp
  189. +67 −0 source/filereader.cpp
  190. +73 −0 source/filewriter.cpp
  191. +298 −0 source/md2.cpp
  192. +373 −0 source/md4.cpp
  193. +1,006 −0 source/md5.cpp
  194. +278 −0 source/mini_version.cpp
  195. +72 −0 source/mutex.cpp
  196. +266 −0 source/sha1.cpp
  197. +375 −0 source/sha256.cpp
  198. +406 −0 source/sha512.cpp
  199. +77 −0 source/stopwatch.cpp
  200. +153 −0 source/system.cpp
  201. +294 −0 source/tcpsocket.cpp
  202. +953 −0 source/tiger.cpp
  203. +135 −0 source/udpsocket.cpp
  204. +136 −0 source/uncrustify-crisscross.cfg
  205. +313 −0 source/universal_include.cpp
  206. +45 −0 source/version.cpp
  207. +104 −0 source/windows_version.cpp
  208. 0 targets/.gitignore
  209. 0 targets/vs2008/.gitignore
  210. +20 −0 targets/vs2008/CrissCross.sln
  211. +625 −0 targets/vs2008/CrissCross.vcproj
  212. +2 −0 targets/xcode/.gitignore
  213. +3 −0 targets/xcode/CrissCross.xcodeproj/.gitignore
  214. +632 −0 targets/xcode/CrissCross.xcodeproj/project.pbxproj
  215. +12 −0 targets/xcode/CrissCross_Prefix.pch
  216. 0 targets/xcode/English.lproj/.gitignore
  217. BIN targets/xcode/English.lproj/InfoPlist.strings
  218. +26 −0 targets/xcode/Info.plist
  219. +3 −0 tools/.gitignore
  220. +7 −0 tools/Build/.gitignore
  221. +83 −0 tools/Build/GenerateBuildNumber.cpp
  222. +69 −0 tools/Build/crc.cpp
  223. +18 −0 tools/Build/crc.h
  224. BIN tools/GenerateBuildNumber.exe
  225. +55 −0 tools/GenerateBuildNumber.sh
@@ -0,0 +1,4 @@
CMakeCache.txt
CMakeFiles
cmake_install.cmake
Makefile
159 CHANGES
@@ -0,0 +1,159 @@
VERSION 0.7.2 (r???)
* Old (and buggy) build system removed in favor of CMake.
* Fixed a few memory leaks in CPUID.
* Added support for DEC Alpha and Sun SPARC.
* Documentation is now more verbose and has been clarified in some areas.
* Added an optional preprocessor definition "DISABLE_DEPRECATED_CODE" to disable MD2, slow sorts, etc.
* CPUID test application now reports any oddities (such as: the processor is multicore but only 1 virtual processor was detected).
* Added 'flushArray' and 'flush' to DArray to allow for simpler deletion of contained data.
* Stopwatch::Clocks() removed because it was too platform-specific and only Windows seemed to have decent support.
* HashTable is now usable and is no longer considered experimental.
* A major AVLTree::findRecursive() bug (in which the result might not actually be found) has been corrected.
* A major RedBlackTree::findRecursive() bug (in which the result might not actually be found) has been corrected.
* A major SplayTree::findRecursive() bug (in which the result might not actually be found) has been corrected.
* Test suite is now a bit more zealous about checking everything.

VERSION 0.7.1 (r768)
* Added Objective-C support via the NSApplicationMain entry point. Define COCOA_APPLICATION in universal_include.h to use.
* In-progress connections now report EINPROGRESS instead of EWOULDBLOCK.
* TCPSockets generally overhauled after lots of practical use of them in ARC++.
* FG_YELLOW now exists as an alias of FG_BROWN | FG_INTENSITY.
* GenerateBuildNumber.exe is now statically linked.
* Stopwatch now calls Start() on initialization (largely for cases such as static instantiations of the class).
* Removed an extra semicolon which caused compiler errors on newer versions of GCC.
* Removed the largely unimplemented "ban" system in sockets.
* Renamed the internal strdup macro to cc_strdup to avoid conflicts.
* Fixed a critical bug in RedBlackTree where a null pointer is dereferenced.
* Fixed a bug in AVLTree where the size may be incorrectly reported.
* Fixed a few compiler warnings.
* Fixed ThreadSleep on Mac OS X.
* Coding style changes implemented in the uncrustify config.

VERSION 0.7.0 (r684)
* Added several checksum methods:
- MD2
- MD4
- MD5
- SHA-1
- SHA-256
- SHA-512
- Tiger
* Nintendo DS homebrew support added (compile with 'make BUILDFORNDS=1')
- Copyright changed to fit Nintendo DS screen.
- Cross-compiling is possible with devkitPro.
- Console class supports libnds console features.
* Fixed ANSI reset color code.
* GenPrime algorithm updated slightly to improve speed.
* SplayTree can't handle duplicate keys properly, so 1:1 compatibility with AVLTree/RedBlackTree has been broken to disable certain duplicate key handling functions.
* CPUID updated with December 2007 Intel CPUID specification.
* Rare bug in AVLTree corrected.
* Renamed TextReader and TextWriter to FileReader and FileWriter, respectively.

VERSION 0.6.6 (r593)
* Visual Studio 2008 support added.
* More example projects added.
* CPUID now detects AMD cache descriptors.
* ConvertToDArray and ConvertIndexToDArray functions optimized, deprecation notice removed
* Fixed Stopwatch on FreeBSD, NetBSD and OpenBSD
* Added AVLTree, SplayTree, ShellSort, InsertionSort, and BubbleSort (the last two for educational purposes only)
* Added a basic HashTable implementation.
* AVLTree, RedBlackTree, and SplayTree have close-to-identical (if not perfectly identical) APIs.
* Cleaned up some 'using namespace' statements that were causing hard-to-detect errors.
* Many, many minor fixes.
* Doxygen config updated to v1.5.4

VERSION 0.6.5 (r427)
* CrissCross::Data::Compare now can compare C-style strings.
* x64 target added for Visual Studio 2005 projects.
* New crisscross/crisscross.h added which basically includes every common CrissCross header.
* RedBlackTree now works with char* string keys.
* No longer needlessly recompiles on Mac OS X (build_number.h regeneration caused a recompile).
* QuickSort::Sort is now marked deprecated with _CC_DEPRECATE_SLOW as a warning to those who use it.
* CoreIOWriter had a few functions which had std::string passed by value rather than by reference.
* DStack::peek() function added.
* FastestSort and MemoryEfficientSort aliases added by request.
* BTree alias for RedBlackTree added.
* Cleaned data structure function names a bit (getData() is now simply get(), etc).
* Added compatibility with Tosser data structure library, allowing CrissCross to be used with the Onlink project.
* Added XCrashReports support for release builds.
* _CC_DEPRECATE_SLOW changed for Windows builds to indicate severity of the slowdown.
* Improved speed and size of CoreAssert and made it more CrissCross-like for its stderr output.
* Major time-critical Stopwatch functions are now inlined (Start/Stop functions).
* Corrected an error with ThreadSleep which caused it to sleep forever if a value less than zero was passed to it.
* crisscross/sort.h is now all that needs to be included for use of CombSort, QuickSort, and HeapSort.
* Disabled core/thread detection in CPUID, because of varying results (can't yet interpret what they mean.
* Added a few more cache descriptors to CPUID (Core 2 related ones).

VERSION 0.6.0
* CrissCross test suite added (tests a majority of the features).
* Added QuickSort and CombSort.
* Doxygen config updated to v1.5.2
* Enabled man page generation on Doxygen config.
* Documentation updated and clarified.
* Fastdep and CCDV removed.
* New build number system added (based on SVN revision number).
* Visual C++ 2003 project added.
* XCode project added.
* Visual C++ 6.0 project removed.
* Headers in all files reduced in size.
* New CoreIOReader ReadLine added.
* Flush added in CoreIOWriter::Write (some platforms wouldn't display written data until a newline).
* Winsock 2.2 is now used in Windows builds (instead of 2.0)
* CoreSocket::Close no longer attempts to close an invalid socket (which would cause errno to give an error value).
* Various UDPSocket functions no longer return false errors.
* SDL_APPLICATION preprocessor definition available for SDL applications with the SDLmain entry point.
* Windows memory leak checking improved and no longer causes weird crashes.
* Switched to STL for memory leak check file parsing.
* Stale ENABLE_DEBUGLOG #ifdefs removed.
* Option to disable C++ exception handler (decreases executable size among other things) available now.
* CrissCross::Data::Compare is now a template function.
* CoreMutex is now called Mutex.
* CoreConsole is now called Console.
* DArray, LList and RedBlackTree function calls are converted to a more standard naming system.
* A dangerous flaw in the Stopwatch class causing a crash and a bad compile was corrected.
* Platform detection improved and cleaned up.
* Made several changes for GCC 4.3.0 (SVN) compatibility.
* Gentoo ebuild is available on uplinklabs.net portage overlay.

VERSION 0.5.2
* Split CoreIO into CoreIOReader and CoreIOWriter.
* CoreConsole now accepts input.
* All unicode support removed until it is further researched.
* Several documentation errors were corrected.
* CoreIOReader and CoreIOWriter now check to see if the file is open before attempting read or write operations.
* Makefiles improved to allow 'make -j#' builds.
* Added Visual C++ 6 project files, but there's no guarantee they work perfectly.
* Moved data structures to the main include directory.
* Including CrissCross files with #include <crisscross/foo> now works properly without adding -I/usr/include/crisscross to the GCC command line.
* Fixed CCDV to say 'Compiling' rather than 'Linking' for precompiled headers.
* CPUID now detects SSSE3 (Supplemental SSE3 instructions).
* CPUID now properly detects CMP (Core Multi Processing, a.k.a. dual core)
* Sockets heavily edited, allowing for better error handling.
* TCPSocket::Accept() syntax changed.

VERSION 0.5.1
* Fixed Makefiles to work on any previously non-working platforms (OS X, mainly).
* Disabled CPUID on BSD. BSD lacks affinity control, and therefore doesn't work.

VERSION 0.5.0 ( MILESTONE 2, Codename "Loki" )
* Cleanup
Much of the existing code was disorganized, and was re-categorized into other namespaces.
* Documentation
o All namespaces
o Stopwatch class
o LList class
o RedBlackTree class
Some classes that showed up in documentation are now hidden.
o CrissCross::System::param
o CrissCross::Data::LListItem< T >
o CrissCross::Data::RedBlackTree< dataType, keyType >::nodeType
* Conventionalization
Existing code is now consistent in it's conventions.
* Bugfixes
Bugs discovered during the v0.4.x testing cycle have been corrected (details unnecessary for pre-release code).
* Examples
v0.5.0 is the first public release. Examples are now provided for reference.
* Cross-Platform Fixes
Functions in CoreConsole that previously did nothing on non-Windows platforms now do what they should.
* UTF-8 Support ( partially implemented and is untested)
WCHAR and so on need to be supported. We're working on this right now, so please don't #define ENABLE_UNICODE unless you're brave.
@@ -0,0 +1,177 @@
cmake_minimum_required (VERSION 2.4)

if(COMMAND cmake_policy)
cmake_policy(VERSION 2.6)
endif(COMMAND cmake_policy)

project (CrissCross)

set(CMAKE_BUILD_TYPE RelWithDebInfo)

# - Try to find precompiled headers support for GCC 3.4 and 4.x
# Once done this will define:
#
# Variable:
# PCHSupport_FOUND
#
# Macro:
# ADD_PRECOMPILED_HEADER

IF(CMAKE_COMPILER_IS_GNUCXX)
EXEC_PROGRAM(
${CMAKE_CXX_COMPILER}
ARGS --version
OUTPUT_VARIABLE _compiler_output)
STRING(REGEX REPLACE ".* ([0-9]\\.[0-9]\\.[0-9]) .*" "\\1"
gcc_compiler_version ${_compiler_output})
#MESSAGE("GCC Version: ${gcc_compiler_version}")
IF(gcc_compiler_version MATCHES "4\\.[0-9]\\.[0-9]")
SET(PCHSupport_FOUND TRUE)
ELSE(gcc_compiler_version MATCHES "4\\.[0-9]\\.[0-9]")
IF(gcc_compiler_version MATCHES "3\\.4\\.[0-9]")
SET(PCHSupport_FOUND TRUE)
ENDIF(gcc_compiler_version MATCHES "3\\.4\\.[0-9]")
ENDIF(gcc_compiler_version MATCHES "4\\.[0-9]\\.[0-9]")
ENDIF(CMAKE_COMPILER_IS_GNUCXX)

MACRO(ADD_PRECOMPILED_HEADER _targetName _header _source)
IF(MSVC)
STRING(REPLACE "${CMAKE_CURRENT_SOURCE_DIR}/" "" _headerName "${_header}")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /Yu\"${_headerName}\"")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Yu\"${_headerName}\"")
GET_FILENAME_COMPONENT(_sourceFile ${_source} NAME)
MESSAGE(STATUS "${_sourceFile}")
set_source_files_properties("${_sourceFile}"
COMPILE_FLAGS "/Yc\"${_headerName}\""
)
ENDIF(MSVC)
IF(CMAKE_COMPILER_IS_GNUCXX AND NOT XCODE)
IF(NOT CMAKE_BUILD_TYPE)
MESSAGE(FATAL_ERROR
"This is the ADD_PRECOMPILED_HEADER macro. "
"You must set CMAKE_BUILD_TYPE!"
)
ENDIF(NOT CMAKE_BUILD_TYPE)

GET_FILENAME_COMPONENT(_name ${_header} NAME)
GET_FILENAME_COMPONENT(_path ${_header} PATH)
SET(_outdir "${CMAKE_CURRENT_BINARY_DIR}/${_name}.gch")
SET(_output "${_outdir}/${CMAKE_BUILD_TYPE}.c++")

ADD_CUSTOM_COMMAND(
OUTPUT ${_outdir}
COMMAND mkdir ${_outdir} # TODO: {CMAKE_COMMAND} -E ...
)
#MAKE_DIRECTORY(${_outdir})

STRING(TOUPPER "CMAKE_CXX_FLAGS_${CMAKE_BUILD_TYPE}" _flags_var_name)
SET(_compile_FLAGS ${${_flags_var_name}})
GET_DIRECTORY_PROPERTY(_directory_flags INCLUDE_DIRECTORIES)

SET(_CMAKE_CURRENT_BINARY_DIR_included_before_path FALSE)
FOREACH(item ${_directory_flags})
IF(${item} STREQUAL ${_path} AND NOT _CMAKE_CURRENT_BINARY_DIR_included_before_path )
MESSAGE(FATAL_ERROR
"This is the ADD_PRECOMPILED_HEADER macro. "
"CMAKE_CURRENT_BINARY_DIR has to mentioned at INCLUDE_DIRECTORIES's argument list before ${_path}, where ${_name} is located"
)
ENDIF(${item} STREQUAL ${_path} AND NOT _CMAKE_CURRENT_BINARY_DIR_included_before_path )

IF(${item} STREQUAL ${CMAKE_CURRENT_BINARY_DIR})
SET(_CMAKE_CURRENT_BINARY_DIR_included_before_path TRUE)
ENDIF(${item} STREQUAL ${CMAKE_CURRENT_BINARY_DIR})

LIST(APPEND _compile_FLAGS "-I${item}")
ENDFOREACH(item)

GET_DIRECTORY_PROPERTY(_directory_flags DEFINITIONS)
LIST(APPEND _compile_FLAGS ${_directory_flags})
LIST(APPEND _compile_FLAGS ${CMAKE_CXX_FLAGS} )

SEPARATE_ARGUMENTS(_compile_FLAGS)
#MESSAGE("_compiler_FLAGS: ${_compiler_FLAGS}")
#message(${_compile_FLAGS} )
#message("COMMAND ${CMAKE_CXX_COMPILER} ${_compile_FLAGS} -x c++-header -o ${_output} ${_header}")

ADD_CUSTOM_COMMAND(
OUTPUT ${_output}
COMMAND ${CMAKE_CXX_COMPILER}
${_compile_FLAGS}
-x c++-header
-o ${_output}
${_header}
DEPENDS ${_header} ${_outdir}
)
ADD_CUSTOM_TARGET(${_targetName}_gch
DEPENDS ${_output}
)
ADD_DEPENDENCIES(${_targetName} ${_targetName}_gch)
ADD_DEPENDENCIES(${_targetName}_gch BuildNumber)
SET_TARGET_PROPERTIES(${_targetName}
PROPERTIES
COMPILE_FLAGS "-include ${_header} -Winvalid-pch"
)
ENDIF(CMAKE_COMPILER_IS_GNUCXX AND NOT XCODE)
ENDMACRO(ADD_PRECOMPILED_HEADER)

MACRO(ADD_FLAG where flag)
SET(${where} "${flag} ${${where}}")
ENDMACRO(ADD_FLAG)

if(CMAKE_COMPILER_IS_GNUCXX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++98 -ggdb -fno-rtti -fno-exceptions -rdynamic -Wall -Wno-long-long -pedantic")
endif(CMAKE_COMPILER_IS_GNUCXX)

# settings for Microsoft Visual C
IF(MSVC)
IF(NOT WITH_SHARED_LIBS)
IF(CMAKE_GENERATOR STREQUAL "Visual Studio 7" OR CMAKE_GENERATOR STREQUAL "Visual Studio 7 .NET 2003")
SET(CMAKE_C_FLAGS "/nologo /W3 /Gy /Gm /G6 /GS- /Zi")
SET(CMAKE_C_FLAGS_DEBUG "/MTd /Zi /Od")
SET(CMAKE_C_FLAGS_RELEASE "/MT /O2 /Ot")
SET(CMAKE_C_FLAGS_MINSIZEREL "/MT /O2 /Os")
SET(CMAKE_C_FLAGS_RELWITHDEBINFO "/MTd /Od")
ENDIF(CMAKE_GENERATOR STREQUAL "Visual Studio 7" OR CMAKE_GENERATOR STREQUAL "Visual Studio 7 .NET 2003")
IF(CMAKE_GENERATOR STREQUAL "Visual Studio 8 2005" OR CMAKE_GENERATOR STREQUAL "Visual Studio 9 2008")
SET(CMAKE_C_FLAGS "/nologo /W3 /Gy /Gm /GS- /Zi")
SET(CMAKE_C_FLAGS_DEBUG "/MTd /Od")
SET(CMAKE_C_FLAGS_RELEASE "/MT /O2 /Ot")
SET(CMAKE_C_FLAGS_MINSIZEREL "/MT /O2 /Os")
SET(CMAKE_C_FLAGS_RELWITHDEBINFO "/MTd /Od")
ENDIF(CMAKE_GENERATOR STREQUAL "Visual Studio 8 2005" OR CMAKE_GENERATOR STREQUAL "Visual Studio 9 2008")
ENDIF(NOT WITH_SHARED_LIBS)
ENDIF(MSVC)
# settings for Microsoft Visual C++
IF(MSVC)
IF(NOT WITH_SHARED_LIBS)
IF(CMAKE_GENERATOR STREQUAL "Visual Studio 7" OR CMAKE_GENERATOR STREQUAL "Visual Studio 7 .NET 2003")
SET(CMAKE_CXX_FLAGS "/nologo /W3 /Gy /G6 /Gm /GS- /Zi /EHa")
SET(CMAKE_CXX_FLAGS_DEBUG "/MTd /Od")
SET(CMAKE_CXX_FLAGS_RELEASE "/MT /O2 /Ot")
SET(CMAKE_CXX_FLAGS_MINSIZEREL "/MT /O2 /Os")
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "/MTd /Od")
ENDIF(CMAKE_GENERATOR STREQUAL "Visual Studio 7" OR CMAKE_GENERATOR STREQUAL "Visual Studio 7 .NET 2003")
IF(CMAKE_GENERATOR STREQUAL "Visual Studio 8 2005" OR CMAKE_GENERATOR STREQUAL "Visual Studio 9 2008")
SET(CMAKE_CXX_FLAGS "/nologo /W3 /Gy /Gm /GS- /Zi /EHa")
SET(CMAKE_CXX_FLAGS_DEBUG "/MTd /Od")
SET(CMAKE_CXX_FLAGS_RELEASE "/MT /O2 /Ot")
SET(CMAKE_CXX_FLAGS_MINSIZEREL "/MT /O2 /Os")
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "/MTd /Od")
ENDIF(CMAKE_GENERATOR STREQUAL "Visual Studio 8 2005" OR CMAKE_GENERATOR STREQUAL "Visual Studio 9 2008")
ENDIF(NOT WITH_SHARED_LIBS)
ENDIF(MSVC)

include_directories (
${CrissCross_BINARY_DIR}
${CrissCross_BINARY_DIR}/source
${CrissCross_SOURCE_DIR}/source
.)

add_subdirectory (source)
add_subdirectory (TestSuite)
add_subdirectory (examples)

IF(NOT MSVC)
get_target_property (tspath TestSuite LOCATION)
add_custom_target (check COMMAND ${tspath} DEPENDS TestSuite)
ENDIF(NOT MSVC)
10 COPYING
@@ -0,0 +1,10 @@
Copyright (c) 2006-2008 Steven Noonan <steven@uplinklabs.net>.
All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
* Neither the name of Uplink Laboratories nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

0 comments on commit 61f47a6

Please sign in to comment.
You can’t perform that action at this time.