Skip to content

Commit 08bb3a3

Browse files
committed
fixup! General CMakeLists improvements - cmake v2→v3
1 parent 051c59b commit 08bb3a3

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

CMakeLists.txt

+14-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
55

66
cmake_minimum_required(VERSION 3.13)
7+
8+
cmake_policy(SET CMP0177 OLD)
9+
cmake_policy(SET CMP0167 NEW)
10+
711
project(vsomeip)
812

913
set(VSOMEIP_NAME vsomeip3)
@@ -108,6 +112,7 @@ add_library(DL_INTERFACE INTERFACE IMPORTED)
108112
find_package(
109113
Boost 1.66 REQUIRED
110114
COMPONENTS system thread filesystem
115+
CONFIG
111116
)
112117

113118
include(CMakeDependentOption)
@@ -210,7 +215,7 @@ elseif(${CMAKE_SYSTEM_NAME} MATCHES "QNX")
210215
# QNX specific socket lib
211216
set(VSOMEIP_SOCKET_LIB
212217
"socket"
213-
CACHE "Default socket library for QNX" STRING
218+
CACHE STRING "Default socket library for QNX"
214219
)
215220
target_link_libraries(RT_INTERFACE INTERFACE $<$<PLATFORM_ID:QNX>:${VSOMEIP_SOCKET_LIB}>)
216221

@@ -673,6 +678,7 @@ message("Predefined wait times for internal communication ports (TCP):\
673678
# ######################################################################################################################
674679
# Installation
675680
# ######################################################################################################################
681+
676682
set(INCLUDE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/interface/vsomeip")
677683

678684
file(
@@ -686,13 +692,20 @@ list(SORT vsomeip_INCLUDE)
686692

687693
foreach(file ${vsomeip_INCLUDE})
688694
get_filename_component(dir ${file} DIRECTORY)
695+
# The destination contains non-normalized paths, this is deprecated. Until
696+
# CMake 3.23 is the minimum version and FILE_SETs can be used, we're relying
697+
# on using the old CMP0177 policy.
689698
install(
690699
FILES "${INCLUDE_PATH}/${file}"
691700
DESTINATION "${INSTALL_INCLUDE_DIR}/vsomeip/${dir}"
692701
COMPONENT dev
693702
)
694703
endforeach()
695704

705+
unset(INCLUDE_PATH)
706+
unset(vsomeip_INCLUDE)
707+
unset(file)
708+
696709
install(
697710
TARGETS vsomeip3
698711
# IMPORTANT: Add the vsomeip library to the "export-set"

0 commit comments

Comments
 (0)