forked from gelldur/EventBus
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
66 lines (55 loc) · 1.49 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
CMAKE_MINIMUM_REQUIRED(VERSION 3.2 FATAL_ERROR)
OPTION(PERFORMANCE "Enable/Disable performance subdirectory" OFF)
# BUILD_SHARED_LIBS can controll build type!
PROJECT(EventBus
VERSION 2.2.0
LANGUAGES CXX
)
ADD_LIBRARY(EventBus
src/eventbus/EventCollector.cpp include/eventbus/EventCollector.h
include/eventbus/EventBus.h
)
ADD_LIBRARY(Dexode::EventBus ALIAS EventBus)
TARGET_INCLUDE_DIRECTORIES(EventBus PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include/>
$<INSTALL_INTERFACE:include/>
PRIVATE src/
)
TARGET_COMPILE_OPTIONS(EventBus PRIVATE
-Wall -pedantic
-Wnon-virtual-dtor
-Werror
-Wno-error=deprecated-declarations
)
IF(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
TARGET_COMPILE_OPTIONS(EventBus PRIVATE
-Wno-error=unknown-argument
-Wno-error=unused-command-line-argument
)
ENDIF()
SET_TARGET_PROPERTIES(EventBus PROPERTIES
CXX_STANDARD 14
)
IF(NOT CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
TARGET_COMPILE_FEATURES(EventBus
PUBLIC cxx_auto_type
)
ENDIF()
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)
IF(BUILD_TESTING)
ADD_SUBDIRECTORY(test/)
ENDIF()
IF(PERFORMANCE)
ADD_SUBDIRECTORY(performance/)
ENDIF()