2 # Copyright (c) 2017 TOYOTA MOTOR CORPORATION
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
8 # http://www.apache.org/licenses/LICENSE-2.0
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
17 cmake_minimum_required(VERSION 2.8)
19 project(WindowManagerTMC)
21 set(PACKAGE_VERSION_MAJOR 0)
22 set(PACKAGE_VERSION_MINOR 0)
23 set(PACKAGE_VERSION_REVISION 1)
24 set(PACKAGE_VERSION "${PACKAGE_VERSION_MAJOR}.${PACKAGE_VERSION_MINOR}.${PACKAGE_VERSION_REVISION}")
26 find_package(PkgConfig REQUIRED)
27 include(GNUInstallDirs)
29 macro(wlproto var_basename proto_xml_basename)
30 if("${WLSCAN}" STREQUAL "")
31 find_program(WLSCAN NAMES wayland-scanner)
34 if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/protocol)
35 set(proto_dir "${CMAKE_CURRENT_SOURCE_DIR}/protocol")
36 elseif(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/../protocol)
37 set(proto_dir "${CMAKE_CURRENT_SOURCE_DIR}/../protocol")
39 message(FATAL_ERROR "Could not find ${CMAKE_CURRENT_SOURCE_DIR}/protocol or ${CMAKE_CURRENT_SOURCE_DIR}/../protocol")
44 ${proto_xml_basename}-protocol.c
45 #${proto_xml_basename}-server-protocol.h
46 ${proto_xml_basename}-client-protocol.h
47 MAIN_DEPENDENCY ${proto_dir}/${proto_xml_basename}.xml
48 COMMAND ${WLSCAN} code < ${proto_dir}/${proto_xml_basename}.xml > ${proto_xml_basename}-protocol.c
49 #COMMAND ${WLSCAN} server-header < ${proto_dir}/${proto_xml_basename}.xml > ${proto_xml_basename}-server-protocol.h
50 COMMAND ${WLSCAN} client-header < ${proto_dir}/${proto_xml_basename}.xml > ${proto_xml_basename}-client-protocol.h
53 set(${var_basename}_PROTO ${CMAKE_CURRENT_BINARY_DIR}/${proto_xml_basename}-protocol.c)
54 set(${var_basename}_CLIENT ${CMAKE_CURRENT_BINARY_DIR}/${proto_xml_basename}-client-protocol.h)
55 #set(${var_basename}_SERVER ${CMAKE_CURRENT_BINARY_DIR}/${proto_xml_basename}-server-protocol.h)
57 include_directories(${CMAKE_CURRENT_BINARY_DIR})
60 set(SANITIZER_MODE "none" CACHE STRING "Build using a specific sanitizer (e.g. 'address', 'thread', 'leak', 'undefined'), depends on compiler; default none")
62 set(LINK_LIBCXX OFF CACHE BOOL "Link against LLVMs libc++")
64 # Add PolicyManager as plugin
65 set(PLUGIN_PM policy_manager)
66 add_subdirectory(${PLUGIN_PM})