build: cmake 3.1 compatibility
* fix problem with REMOVE_DUPLICATES on undefined lists
* since 3.1 file(GLOB FILEPATHS RELATIVE .. returns single / instead of // as
previously - necessary adoptions for regex and matches done. Should
work with all cmake versions.
Tested with 3.1.0-rc3
(cherry picked from commit 1b663ceffe
)
Conflicts:
client/CMakeLists.txt
server/CMakeLists.txt
This commit is contained in:
parent
6c6fb62029
commit
b065492890
@ -202,8 +202,8 @@ set(FILENAME "ChannelOptions.cmake")
|
||||
file(GLOB FILEPATHS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*/${FILENAME}")
|
||||
|
||||
foreach(FILEPATH ${FILEPATHS})
|
||||
if(${FILEPATH} MATCHES "^([^/]*)//${FILENAME}")
|
||||
string(REGEX REPLACE "^([^/]*)//${FILENAME}" "\\1" DIR ${FILEPATH})
|
||||
if(${FILEPATH} MATCHES "^([^/]*)/+${FILENAME}")
|
||||
string(REGEX REPLACE "^([^/]*)/+${FILENAME}" "\\1" DIR ${FILEPATH})
|
||||
set(CHANNEL_OPTION)
|
||||
include(${FILEPATH})
|
||||
if(${CHANNEL_OPTION})
|
||||
|
@ -30,7 +30,9 @@ set(${MODULE_PREFIX}_SRCS
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/channels.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/channels.h)
|
||||
|
||||
if(CHANNEL_STATIC_CLIENT_ENTRIES)
|
||||
list(REMOVE_DUPLICATES CHANNEL_STATIC_CLIENT_ENTRIES)
|
||||
endif()
|
||||
|
||||
foreach(STATIC_ENTRY ${CHANNEL_STATIC_CLIENT_ENTRIES})
|
||||
foreach(STATIC_MODULE ${CHANNEL_STATIC_CLIENT_MODULES})
|
||||
|
@ -57,4 +57,4 @@ endif()
|
||||
|
||||
if (WITH_DOTNET)
|
||||
add_subdirectory(DotNetClient)
|
||||
endif()
|
||||
endif()
|
||||
|
6
third-party/CMakeLists.txt
vendored
6
third-party/CMakeLists.txt
vendored
@ -22,11 +22,11 @@
|
||||
file(GLOB all_valid_subdirs RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*/CMakeLists.txt")
|
||||
|
||||
foreach(dir ${all_valid_subdirs})
|
||||
if(${dir} MATCHES "^([^/]*)//CMakeLists.txt")
|
||||
string(REGEX REPLACE "^([^/]*)//CMakeLists.txt" "\\1" dir_trimmed ${dir})
|
||||
if(${dir} MATCHES "^([^/]*)/+CMakeLists.txt")
|
||||
string(REGEX REPLACE "^([^/]*)/+CMakeLists.txt" "\\1" dir_trimmed ${dir})
|
||||
message(STATUS "Adding third-party component ${dir_trimmed}")
|
||||
add_subdirectory(${dir_trimmed})
|
||||
endif()
|
||||
endforeach(dir)
|
||||
|
||||
set(THIRD_PARTY_INCLUDES ${THIRD_PARTY_INCLUDES} PARENT_SCOPE)
|
||||
set(THIRD_PARTY_INCLUDES ${THIRD_PARTY_INCLUDES} PARENT_SCOPE)
|
||||
|
Loading…
Reference in New Issue
Block a user