-
Notifications
You must be signed in to change notification settings - Fork 108
/
Copy pathCMakeLists.txt
81 lines (72 loc) · 3.27 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#
# This file is part of Corrade.
#
# Copyright © 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016,
# 2017, 2018, 2019, 2020, 2021, 2022, 2023
# Vladimír Vondruš <[email protected]>
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
# DEALINGS IN THE SOFTWARE.
#
# IDE folder in VS, Xcode etc. CMake 3.12+, older versions have only the FOLDER
# property that would have to be set on each target separately.
set(CMAKE_FOLDER "Corrade/Interconnect")
set(CorradeInterconnect_SRCS
Connection.cpp
Emitter.cpp
Receiver.cpp)
set(CorradeInterconnect_HEADERS
Connection.h
Emitter.h
Interconnect.h
Receiver.h
StateMachine.h
visibility.h)
set(CorradeInterconnect_PRIVATE_HEADERS
Implementation/ReceiverConnection.h)
# Interconnect library
add_library(CorradeInterconnect ${SHARED_OR_STATIC}
${CorradeInterconnect_SRCS}
${CorradeInterconnect_HEADERS}
${CorradeInterconnect_PRIVATE_HEADERS})
set_target_properties(CorradeInterconnect PROPERTIES DEBUG_POSTFIX "-d")
if(NOT CORRADE_BUILD_STATIC)
set_target_properties(CorradeInterconnect PROPERTIES VERSION ${CORRADE_LIBRARY_VERSION} SOVERSION ${CORRADE_LIBRARY_SOVERSION})
elseif(CORRADE_BUILD_STATIC_PIC)
set_target_properties(CorradeInterconnect PROPERTIES POSITION_INDEPENDENT_CODE ON)
endif()
target_link_libraries(CorradeInterconnect PUBLIC CorradeUtility)
# Disable /OPT:ICF on MSVC, which merges functions with identical contents and
# thus breaks signal comparison
if(CORRADE_TARGET_WINDOWS AND CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
if(CMAKE_VERSION VERSION_LESS 3.13)
target_link_libraries(CorradeInterconnect INTERFACE "-OPT:NOICF,REF")
else()
target_link_options(CorradeInterconnect INTERFACE "/OPT:NOICF,REF")
endif()
endif()
install(TARGETS CorradeInterconnect
RUNTIME DESTINATION ${CORRADE_BINARY_INSTALL_DIR}
LIBRARY DESTINATION ${CORRADE_LIBRARY_INSTALL_DIR}
ARCHIVE DESTINATION ${CORRADE_LIBRARY_INSTALL_DIR})
install(FILES ${CorradeInterconnect_HEADERS} DESTINATION ${CORRADE_INCLUDE_INSTALL_DIR}/Interconnect)
if(CORRADE_BUILD_TESTS)
add_subdirectory(Test ${EXCLUDE_FROM_ALL_IF_TEST_TARGET})
endif()
# Corrade::Interconnect target alias for superprojects
add_library(Corrade::Interconnect ALIAS CorradeInterconnect)