abbc03b804ef7844b7325ff9de0b986943ea4549
[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_AUTORCC ON)
22 set(CMAKE_CXX_STANDARD 14)
23 set(CMAKE_CXX_STANDARD_REQUIRED ON)
24
25 find_package(Qt5 COMPONENTS Core Quick QuickControls2 WebSockets REQUIRED)
26
27 PROJECT_TARGET_ADD(mixer)
28
29 option(NATIVE_BUILD "Build for native environment, without homescreen and window manager" OFF)
30 if(NATIVE_BUILD)
31     message(STATUS "Native build is ON")
32     add_definitions(-DNATIVE_BUILD)
33 endif()
34
35 add_executable(mixer
36         "main.cpp"
37         "mixer.cpp"
38         "Mixer.qrc"
39 )
40
41 set_target_properties(mixer PROPERTIES
42         LABELS "EXECUTABLE"
43         PREFIX ""
44         COMPILE_FLAGS "${EXTRAS_CFLAGS} -DFOR_AFB_BINDING"
45         LINK_FLAGS "${BINDINGS_LINK_FLAG}"
46         LINK_LIBRARIES "${EXTRAS_LIBRARIES}"
47         OUTPUT_NAME "${TARGET_NAME}"
48 )
49
50 target_link_libraries(mixer
51     Qt5::Core
52         Qt5::Quick
53         Qt5::QuickControls2
54         Qt5::WebSockets
55         json-c
56         afb-helpers
57 )
58
59 if(NOT NATIVE_BUILD)
60     target_link_libraries(mixer
61         homescreen
62                 qtWindowmanager
63     )
64 endif()