Merge pull request #3779 from opentx/mhotar/fullczcharset
[opentx.git] / CMakeLists.txt
blob9b775bbc8a62968b32630798408efb983ed95b50
1 project(OpenTX)
3 set(VERSION_MAJOR "2")
4 set(VERSION_MINOR "2")
5 set(VERSION_REVISION "0")
6 set(VERSION_SUFFIX $ENV{OPENTX_VERSION_SUFFIX})
7 set(VERSION_FAMILY ${VERSION_MAJOR}.${VERSION_MINOR})
8 set(VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_REVISION}${VERSION_SUFFIX})
9 message(STATUS "OpenTX ${VERSION}")
11 cmake_minimum_required(VERSION 2.8)
12 cmake_policy(SET CMP0020 NEW)
13 cmake_policy(SET CMP0023 OLD)
14 if(POLICY CMP0043)
15   cmake_policy(SET CMP0043 NEW)
16 endif()
18 set(CMAKE_CXX_STANDARD 11)
20 set(RADIO_DIRECTORY ${PROJECT_SOURCE_DIR}/radio)
21 set(RADIO_SRC_DIRECTORY ${RADIO_DIRECTORY}/src)
22 set(COMPANION_SRC_DIRECTORY ${PROJECT_SOURCE_DIR}/companion/src)
24 set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR})
25 set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR})
26 set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/cmake)
28 find_package(Qt5Widgets)
29 find_package(Qt5Xml)
30 find_package(Qt5LinguistTools)
31 find_package(Qt5PrintSupport)
32 find_package(Qt5Multimedia)
34 message(STATUS "Looking for SDL ")
35 find_package(Sdl)
36 if(SDL_FOUND)
37   message("SDL Include Path: " ${SDL_INCLUDE_DIR})
38 else()
39   message("SDL not found! Joysticks support will be disabled. Simulator audio will not work.")
40 endif()
42 message(STATUS "Looking for FOX ")
43 find_package(Fox)
44 if ((NOT FOX_FOUND) AND (NOT WIN32))
45   message("Libfox not found, simu target will not be available")
46 endif()
48 include(Macros)
49 today(DATE)
50 now(TIME)
51 git_id(GIT_STR)
53 add_subdirectory(${RADIO_SRC_DIRECTORY})
55 if(Qt5Widgets_FOUND)
56   add_subdirectory(${COMPANION_SRC_DIRECTORY})
57 endif()