2017-08-15 20:40:39 +02:00
|
|
|
CMAKE_MINIMUM_REQUIRED(VERSION 3.2 FATAL_ERROR)
|
2017-08-04 23:50:35 +02:00
|
|
|
|
2017-09-01 16:15:31 +02:00
|
|
|
OPTION(PERFORMANCE "Enable/Disable performance subdirectory" OFF)
|
|
|
|
|
2017-08-04 23:50:35 +02:00
|
|
|
# BUILD_SHARED_LIBS can controll build type!
|
|
|
|
PROJECT(EventBus
|
2017-11-24 12:55:33 +01:00
|
|
|
VERSION 2.2.0
|
2017-08-04 23:50:35 +02:00
|
|
|
LANGUAGES CXX
|
|
|
|
)
|
|
|
|
|
|
|
|
ADD_LIBRARY(EventBus
|
2017-08-05 00:36:05 +02:00
|
|
|
src/eventbus/EventCollector.cpp include/eventbus/EventCollector.h
|
2017-08-06 00:14:35 +02:00
|
|
|
include/eventbus/EventBus.h
|
2017-08-04 23:50:35 +02:00
|
|
|
)
|
|
|
|
ADD_LIBRARY(Dexode::EventBus ALIAS EventBus)
|
|
|
|
|
2017-08-05 00:36:05 +02:00
|
|
|
TARGET_INCLUDE_DIRECTORIES(EventBus PUBLIC
|
|
|
|
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include/>
|
|
|
|
$<INSTALL_INTERFACE:include/>
|
|
|
|
PRIVATE src/
|
|
|
|
)
|
2017-08-04 23:50:35 +02:00
|
|
|
|
2017-09-10 13:05:36 +02:00
|
|
|
TARGET_COMPILE_OPTIONS(EventBus PRIVATE
|
|
|
|
-Wall -pedantic
|
|
|
|
-Wno-unused-private-field
|
|
|
|
-Wnon-virtual-dtor
|
|
|
|
-Wno-gnu
|
2017-08-06 17:13:00 +02:00
|
|
|
-Werror
|
2017-08-06 00:14:35 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
SET_TARGET_PROPERTIES(EventBus PROPERTIES
|
|
|
|
CXX_STANDARD 14
|
2017-08-04 23:50:35 +02:00
|
|
|
)
|
|
|
|
|
2017-09-01 16:15:31 +02:00
|
|
|
IF(NOT CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
|
|
|
|
TARGET_COMPILE_FEATURES(EventBus
|
|
|
|
PUBLIC cxx_auto_type
|
|
|
|
)
|
|
|
|
ENDIF()
|
2017-08-04 23:50:35 +02:00
|
|
|
|
2017-08-05 00:36:05 +02:00
|
|
|
INSTALL(TARGETS EventBus EXPORT EventBusConfig
|
|
|
|
ARCHIVE DESTINATION lib/
|
|
|
|
LIBRARY DESTINATION lib/
|
|
|
|
RUNTIME DESTINATION bin/
|
|
|
|
INCLUDES DESTINATION include/
|
|
|
|
)
|
|
|
|
INSTALL(DIRECTORY ${CMAKE_SOURCE_DIR}/include/ DESTINATION include/ FILES_MATCHING PATTERN "*.h*")
|
|
|
|
INSTALL(EXPORT EventBusConfig
|
|
|
|
DESTINATION cmake/
|
|
|
|
NAMESPACE Dexode::
|
|
|
|
)
|
|
|
|
EXPORT(TARGETS EventBus FILE EventBusConfig.cmake)
|
2017-08-05 12:15:33 +02:00
|
|
|
|
2017-11-24 12:40:16 +01:00
|
|
|
IF(BUILD_TESTING)
|
|
|
|
ADD_SUBDIRECTORY(test/)
|
|
|
|
ENDIF()
|
2017-09-01 16:15:31 +02:00
|
|
|
|
|
|
|
IF(PERFORMANCE)
|
|
|
|
ADD_SUBDIRECTORY(performance/)
|
|
|
|
ENDIF()
|