3 cmake_minimum_required(VERSION 2.6)
6 set(KHOPPER_VERSION_MAJOR "0")
7 set(KHOPPER_VERSION_MINOR "2")
8 set(KHOPPER_VERSION_PATCH "60")
9 set(KHOPPER_VERSION "${KHOPPER_VERSION_MAJOR}.${KHOPPER_VERSION_MINOR}.${KHOPPER_VERSION_PATCH}")
11 set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules")
13 find_package(Qt4 4.6 COMPONENTS Phonon Xml REQUIRED)
15 include(${QT_USE_FILE})
16 include_directories(${Boost_INCLUDE_DIRS})
18 add_definitions(-DKHOPPER_VERSION=${KHOPPER_VERSION})
19 if(CMAKE_BUILD_TYPE STREQUAL "Release" OR CMAKE_BUILD_TYPE STREQUAL "MinSizeRel")
20 add_definitions(-DQT_NO_DEBUG -DQT_NO_DEBUG_OUTPUT)
22 if(CMAKE_COMPILER_IS_GNUCXX)
23 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x -Wextra -Wall")
25 add_definitions("/D__STDC_CONSTANT_MACROS")
26 if(CMAKE_CXX_FLAGS MATCHES "/W[0-4]")
27 string(REGEX REPLACE "/W[0-4]" "/W4" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
29 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4")
31 if(CMAKE_CXX_FLAGS_RELEASE MATCHES "/O.")
32 string(REGEX REPLACE "/O." "/Ox" CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}")
34 set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Ox")
36 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Zc:wchar_t- /wd4127;4819 /MP")
38 set(CMAKE_DEBUG_POSTFIX d)
40 add_subdirectory(core)
42 list(APPEND KHOPPER_OPTIONAL_FOUND "Qt Phonon module for GUI module.")
43 add_subdirectory(main)
45 list(APPEND KHOPPER_OPTIONAL_NOT_FOUND "Qt Phonon module for GUI module.")
47 add_subdirectory(plugins)
49 list(LENGTH KHOPPER_OPTIONAL_FOUND length)
50 if(NOT ${length} EQUAL 0)
51 message("[Find the fallowing build dependencies:]")
52 foreach(msg ${KHOPPER_OPTIONAL_FOUND})
56 list(LENGTH KHOPPER_OPTIONAL_NOT_FOUND length)
57 if(NOT ${length} EQUAL 0)
58 message("[The fallowing build dependencies are not found:]")
59 foreach(msg ${KHOPPER_OPTIONAL_NOT_FOUND})