1 ########################################################
\r
3 # This is a CMake configuration file.
\r
4 # To use it you need CMake which can be
\r
5 # downloaded from here:
\r
6 # http://www.cmake.org/cmake/resources/software.html
\r
8 #########################################################
\r
10 cmake_minimum_required( VERSION 2.8 )
\r
14 file( GLOB_RECURSE SOURCES *.cpp *.h )
\r
16 # We need to pick up the stdafx.h file
\r
17 # and the headers for the linked-to libraries
\r
18 include_directories( ${CMAKE_CURRENT_SOURCE_DIR}
\r
19 ${BoostParts_SOURCE_DIR}
\r
24 link_directories ( ${PROJECT_BINARY_DIR}/lib )
\r
26 add_library( ${PROJECT_NAME} ${SOURCES} )
\r
28 target_link_libraries( ${PROJECT_NAME} zlib BoostParts )
\r
30 #############################################################################
\r
32 # "Link time code generation" flags for MSVC
\r
33 # TODO: split into special cmake file
\r
35 add_definitions( /DUNICODE /D_UNICODE /D_CRT_SECURE_NO_DEPRECATE )
\r
37 # This warning is present only at the highest warning level (/W4)
\r
38 # and is routinely disabled because it complains about valid
\r
39 # constructs like "while (true)"
\r
40 add_definitions( /wd4127 )
\r
41 set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Zc:wchar_t-" )
\r
42 set( CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Oi /GL" )
\r
43 set_target_properties( ${PROJECT_NAME} PROPERTIES STATIC_LIBRARY_FLAGS "/LTCG" )
\r
45 # "Print all warnings" flag for GCC
\r
46 elseif( CMAKE_COMPILER_IS_GNUCXX )
\r
47 add_definitions( -Wall )
\r