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 include(FindPkgConfig)
19 pkg_check_modules(AFB REQUIRED libafbwsc)
20 pkg_check_modules(SD REQUIRED libsystemd>=222)
22 set(TARGET_LIBWM windowmanager)
24 add_library(${TARGET_LIBWM} SHARED
28 target_include_directories(${TARGET_LIBWM}
33 target_link_libraries(${TARGET_LIBWM}
39 target_compile_definitions(${TARGET_LIBWM}
41 _GNU_SOURCE) # XXX should I define this here?!
43 if(NOT ${CMAKE_BUILD_TYPE} STREQUAL "Release")
44 target_compile_definitions(${TARGET_LIBWM}
49 target_compile_options(${TARGET_LIBWM}
51 -Wall -Wextra -Wno-unused-parameter -Wno-comment)
53 set_target_properties(${TARGET_LIBWM}
55 # INTERPROCEDURAL_OPTIMIZATION ON
58 CXX_STANDARD_REQUIRED ON)
61 set_target_properties(${TARGET_LIBWM}
66 if (NOT ${SANITIZER_MODE} STREQUAL "none" AND NOT ${SANITIZER_MODE} STREQUAL "")
67 target_compile_options(${TARGET_LIBWM}
69 -fsanitize=${SANITIZER_MODE} -g -fno-omit-frame-pointer)
70 set_target_properties(${TARGET_LIBWM}
72 LINK_FLAGS "-fsanitize=${SANITIZER_MODE} -g")
76 TARGETS ${TARGET_LIBWM}
77 DESTINATION ${CMAKE_INSTALL_LIBDIR}
81 FILES libwindowmanager.h
82 DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
83 COMPONENT "development")