25da12263202fa6c415d47dc27c24ebbad8362cb
[apps/mixer.git] / app / CMakeLists.txt
1 ###########################################################################
2 # Copyright 2018 IoT.bzh
3 #
4 # author: Loïc Collignon <loic.collignon@iot.bzh>
5 #
6 # Licensed under the Apache License, Version 2.0 (the "License");
7 # you may not use this file except in compliance with the License.
8 # You may obtain a copy of the License at
9 #
10 #     http://www.apache.org/licenses/LICENSE-2.0
11 #
12 # Unless required by applicable law or agreed to in writing, software
13 # distributed under the License is distributed on an "AS IS" BASIS,
14 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 # See the License for the specific language governing permissions and
16 # limitations under the License.
17 ###########################################################################
18
19 set(CMAKE_INCLUDE_CURRENT_DIR ON)
20 set(CMAKE_AUTOMOC ON)
21 set(CMAKE_CXX_STANDARD 14)
22
23 find_package(Qt5 COMPONENTS Core Gui QuickControls2 WebSockets QuickWidgets REQUIRED)
24 qt5_add_resources(RESOURCES Mixer.qrc)
25
26 PROJECT_TARGET_ADD(mixer)
27
28 option(NATIVE_BUILD "Build for native environment, without homescreen and window manager" OFF)
29 if(NATIVE_BUILD)
30     message(STATUS "Native build is ON")
31     add_definitions(-DNATIVE_BUILD)
32 endif()
33
34 add_executable(mixer
35         main.cpp
36         mixer.cpp
37         ${RESOURCES}
38 )
39
40 set_target_properties(mixer PROPERTIES
41         LABELS "EXECUTABLE"
42         PREFIX ""
43         COMPILE_FLAGS "${EXTRAS_CFLAGS} -DFOR_AFB_BINDING"
44         LINK_FLAGS "${BINDINGS_LINK_FLAG}"
45         LINK_LIBRARIES "${EXTRAS_LIBRARIES}"
46         OUTPUT_NAME "${TARGET_NAME}"
47 )
48
49 target_link_libraries(mixer
50         Qt5::QuickControls2
51         Qt5::WebSockets
52         homescreen
53         qtWindowmanagerWrapper
54         json-c
55         afb-helpers
56 )
57
58 if(NOT NATIVE_BUILD)
59     target_link_libraries(mixer
60         homescreen
61         qtWindowmanagerWrapper
62     )
63 endif()