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
12 project( XercesExtensions )
\r
14 file( GLOB 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
22 link_directories ( ${PROJECT_BINARY_DIR}/lib )
\r
24 add_library( ${PROJECT_NAME} ${SOURCES} )
\r
26 target_link_libraries( ${PROJECT_NAME} Xerces )
\r
28 #############################################################################
\r
30 # "Link time code generation" flags for MSVC
\r
31 # TODO: split into special cmake file
\r
33 add_definitions( /DUNICODE /D_UNICODE /W4 )
\r
35 # This warning is present only at the highest warning level (/W4)
\r
36 # and is routinely disabled because it complains about valid
\r
37 # constructs like "while (true)"
\r
38 add_definitions( /wd4127 )
\r
40 # The /Zc:wchar_t- flag can't go into add_definitions
\r
41 # because the RC compiler picks it up too and it provokes a name clash
\r
42 set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Zc:wchar_t-")
\r
43 set( CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Oi /GL" )
\r
44 set_target_properties( ${PROJECT_NAME} PROPERTIES STATIC_LIBRARY_FLAGS "/LTCG" )
\r
46 # "Print all warnings" flag for GCC
\r
47 elseif( CMAKE_COMPILER_IS_GNUCXX )
\r
48 add_definitions( -Wall )
\r
51 # needed for correct Xerces header inclusion
\r
52 add_definitions( -DXERCES_STATIC_LIBRARY )
\r