Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/CMakeLists.txt b/CMakeLists.txt
- index 44422f59..4f214dc8 100644
- --- a/CMakeLists.txt
- +++ b/CMakeLists.txt
- @@ -30,8 +30,7 @@ set_directory_properties(PROPERTIES
- COMPILE_DEFINITIONS ""
- )
- -set( CMAKE_MODULE_PATH
- - ${CMAKE_MODULE_PATH}
- +list(APPEND CMAKE_MODULE_PATH
- ${PROJECT_SOURCE_DIR}/cmake/modules
- ${CMAKE_CURRENT_LIST_DIR}/cmake/modules
- )
- diff --git a/dev/CMakeLists.txt b/dev/CMakeLists.txt
- index 9085d7bc..fc94a309 100644
- --- a/dev/CMakeLists.txt
- +++ b/dev/CMakeLists.txt
- @@ -8,16 +8,17 @@ set( plugins_list
- message(STATUS "Plugins from dev subdirectory")
- # If BUILD_PLUGINS variable was set as "-plugin1;-plugin2"
- # We proceed all plugins with plugin1 and plugin2 excluded
- -string(REGEX MATCH ".*[-]*" DISABLED_PLUGINS "${BUILD_PLUGINS}")
- +string(REGEX MATCHALL "[-][^;]+" DISABLED_PLUGINS "${BUILD_PLUGINS}")
- if(NOT "${DISABLED_PLUGINS}" STREQUAL "")
- + string(REPLACE "-" "" DISABLED_LIST "${DISABLED_PLUGINS}")
- set(plugins ${plugins_list})
- - foreach(mp ${BUILD_PLUGINS})
- - string(SUBSTRING "${mp}" 0 1 FIRST_LETTER)
- - string(SUBSTRING ${mp} 1 -1 PLUGIN_BODY)
- - if(${FIRST_LETTER} STREQUAL "-")
- - message(STATUS "Exclude subdirectory: ${PLUGIN_BODY}")
- - list(REMOVE_ITEM plugins "${PLUGIN_BODY}")
- + foreach(dp ${DISABLED_LIST})
- + list(FIND plugins "${dp}" _IS_FOUND)
- + if(${_IS_FOUND} GREATER_EQUAL 0)
- + message(STATUS "Exclude subdirectory: ${dp}")
- + list(REMOVE_ITEM plugins "${dp}")
- endif()
- + unset(_IS_FOUND)
- endforeach()
- else()
- if( "${BUILD_PLUGINS}" STREQUAL "ALL" )
- @@ -27,11 +28,13 @@ else()
- endif()
- endif()
- -foreach( plugin ${plugins_list} )
- - foreach( subdir ${plugins} )
- - if( ${plugin} STREQUAL ${subdir} )
- - message(STATUS "Add subdirectory: ${plugin}")
- - add_subdirectory("${CMAKE_CURRENT_LIST_DIR}/${plugin}")
- - endif()
- - endforeach()
- +foreach(plugin ${plugins})
- + list(FIND plugins_list "${plugin}" _IS_FOUND)
- + if(${_IS_FOUND} GREATER_EQUAL 0)
- + message(STATUS "Add subdirectory: ${plugin}")
- + add_subdirectory("${CMAKE_CURRENT_LIST_DIR}/${plugin}")
- + else()
- + message(WARNING "Plugin ${plugin} set by BUILD_PLUGINS variable not found")
- + endif()
- + unset(_IS_FOUND)
- endforeach()
- diff --git a/generic/CMakeLists.txt b/generic/CMakeLists.txt
- index 3b7b313d..3b691d85 100644
- --- a/generic/CMakeLists.txt
- +++ b/generic/CMakeLists.txt
- @@ -46,16 +46,17 @@ endif()
- message(STATUS "Plugins from generic subdirectory")
- # If BUILD_PLUGINS variable was set as "-plugin1;-plugin2"
- # We proceed all plugins with plugin1 and plugin2 excluded
- -string(REGEX MATCH ".*[-]+" DISABLED_PLUGINS "${BUILD_PLUGINS}")
- +string(REGEX MATCHALL "[-][^;]+" DISABLED_PLUGINS "${BUILD_PLUGINS}")
- if(NOT "${DISABLED_PLUGINS}" STREQUAL "")
- + string(REPLACE "-" "" DISABLED_LIST "${DISABLED_PLUGINS}")
- set(plugins ${plugins_list})
- - foreach(mp ${BUILD_PLUGINS})
- - string(SUBSTRING "${mp}" 0 1 FIRST_LETTER)
- - string(SUBSTRING ${mp} 1 -1 PLUGIN_BODY)
- - if(${FIRST_LETTER} STREQUAL "-")
- - message(STATUS "Exclude subdirectory: ${PLUGIN_BODY}")
- - list(REMOVE_ITEM plugins "${PLUGIN_BODY}")
- + foreach(dp ${DISABLED_LIST})
- + list(FIND plugins "${dp}" _IS_FOUND)
- + if(${_IS_FOUND} GREATER_EQUAL 0)
- + message(STATUS "Exclude subdirectory: ${dp}")
- + list(REMOVE_ITEM plugins "${dp}")
- endif()
- + unset(_IS_FOUND)
- endforeach()
- else()
- if( "${BUILD_PLUGINS}" STREQUAL "ALL" )
- @@ -65,11 +66,13 @@ else()
- endif()
- endif()
- -foreach(plugin ${plugins_list})
- - foreach(subdir ${plugins})
- - if( ${plugin} STREQUAL ${subdir} )
- - message(STATUS "Add subdirectory: ${plugin}")
- - add_subdirectory("${CMAKE_CURRENT_LIST_DIR}/${plugin}")
- - endif()
- - endforeach()
- +foreach(plugin ${plugins})
- + list(FIND plugins_list "${plugin}" _IS_FOUND)
- + if(${_IS_FOUND} GREATER_EQUAL 0)
- + message(STATUS "Add subdirectory: ${plugin}")
- + add_subdirectory("${CMAKE_CURRENT_LIST_DIR}/${plugin}")
- + else()
- + message(WARNING "Plugin ${plugin} set by BUILD_PLUGINS variable not found")
- + endif()
- + unset(_IS_FOUND)
- endforeach()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement