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 # We use the lower case name
\r
13 # on UNIX systems other than Mac OS X
\r
14 if ( WIN32 OR APPLE )
\r
15 project( FlightCrew-cli )
\r
17 project( flightcrew-cli )
\r
20 file( GLOB_RECURSE SOURCES *.cpp *.h )
\r
22 #############################################################################
\r
24 # Creating source groups for VS, Xcode
\r
25 include( ${CMAKE_SOURCE_DIR}/cmake_extras/FileSystemSourceGroups.cmake )
\r
26 create_source_groups( SOURCES )
\r
28 #############################################################################
\r
30 # We need to pick up the stdafx.h file
\r
31 # and the headers for the linked-to libraries
\r
32 include_directories( ${CMAKE_CURRENT_SOURCE_DIR}
\r
33 ${BoostParts_SOURCE_DIR}
\r
34 ${FlightCrew_SOURCE_DIR}
\r
35 ${XercesExtensions_SOURCE_DIR}
\r
38 add_executable( ${PROJECT_NAME} ${SOURCES} )
\r
40 target_link_libraries( ${PROJECT_NAME} FlightCrew )
\r
42 #############################################################################
\r
44 if( BUILD_SHARED_FC )
\r
45 add_definitions( -DFC_BUILT_AS_DLL )
\r
48 #############################################################################
\r
50 # "Link time code generation" flags for MSVC
\r
51 # TODO: split into special cmake file
\r
53 add_definitions( /DUNICODE /D_UNICODE /W4 )
\r
55 set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Zc:wchar_t-" )
\r
56 set( CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Oi /GL" )
\r
57 set( CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /LTCG" )
\r
59 # "Print all warnings" flag for GCC
\r
60 elseif( CMAKE_COMPILER_IS_GNUCXX )
\r
61 add_definitions( -Wall )
\r
64 set_source_files_properties( main.cpp PROPERTIES COMPILE_DEFINITIONS FLIGHTCREW_FULL_VERSION="${FLIGHTCREW_FULL_VERSION}" )
\r
66 #############################################################################
\r
68 # You can change the install location by
\r
69 # running cmake like this:
\r
71 # cmake -DCMAKE_INSTALL_PREFIX=/new/install/prefix
\r
73 # By default, the prefix is "/usr/local"
\r
75 if( UNIX AND NOT APPLE )
\r
76 install( TARGETS ${PROJECT_NAME} RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin )
\r