Skip to content

Commit 60cbc46

Browse files
committed
Merge pull request opencv#9886 from mshabunin:remove-cmake-submodules
2 parents 9e6ef99 + b1fe298 commit 60cbc46

File tree

4 files changed

+13
-83
lines changed

4 files changed

+13
-83
lines changed

cmake/OpenCVGenPkgconfig.cmake

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,17 +57,12 @@ ocv_get_all_libs(_modules _extra _3rdparty)
5757
# when linking against static libraries, if libfoo depends on libbar, then
5858
# libfoo must come first in the linker flags.
5959

60-
# world and contrib_world are special targets whose library should come first,
60+
# world is a special target whose library should come first,
6161
# especially for static link.
6262
if(_modules MATCHES "opencv_world")
6363
set(_modules "opencv_world")
6464
endif()
6565

66-
if(_modules MATCHES "opencv_contrib_world")
67-
list(REMOVE_ITEM _modules "opencv_contrib_world")
68-
list(INSERT _modules 0 "opencv_contrib_world")
69-
endif()
70-
7166
set(HELPER_SCRIPT "")
7267
ocv_cmake_script_append_var(HELPER_SCRIPT
7368
BUILD_SHARED_LIBS

cmake/OpenCVModule.cmake

Lines changed: 11 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
# OPENCV_MODULE_${the_module}_PRIVATE_OPT_DEPS
2121
# OPENCV_MODULE_${the_module}_IS_PART_OF_WORLD
2222
# OPENCV_MODULE_${the_module}_CUDA_OBJECTS - compiled CUDA objects list
23-
# OPENCV_MODULE_${the_module}_CHILDREN - list of submodules for compound modules (cmake >= 2.8.8)
2423
# OPENCV_MODULE_${the_module}_WRAPPERS - list of wrappers supporting this module
2524
# HAVE_${the_module} - for fast check of module availability
2625

@@ -30,7 +29,6 @@
3029
# OPENCV_MODULE_TYPE - STATIC|SHARED - set to force override global settings for current module
3130
# OPENCV_MODULE_IS_PART_OF_WORLD - ON|OFF (default ON) - should the module be added to the opencv_world?
3231
# BUILD_${the_module}_INIT - ON|OFF (default ON) - initial value for BUILD_${the_module}
33-
# OPENCV_MODULE_CHILDREN - list of submodules
3432

3533
# The verbose template for OpenCV module:
3634
#
@@ -208,9 +206,6 @@ macro(ocv_add_module _name)
208206
set(OPENCV_MODULES_DISABLED_USER ${OPENCV_MODULES_DISABLED_USER} "${the_module}" CACHE INTERNAL "List of OpenCV modules explicitly disabled by user")
209207
endif()
210208

211-
# add submodules if any
212-
set(OPENCV_MODULE_${the_module}_CHILDREN "${OPENCV_MODULE_CHILDREN}" CACHE INTERNAL "List of ${the_module} submodules")
213-
214209
# add reverse wrapper dependencies
215210
foreach (wrapper ${OPENCV_MODULE_${the_module}_WRAPPERS})
216211
ocv_add_dependencies(opencv_${wrapper} OPTIONAL ${the_module})
@@ -372,7 +367,7 @@ function(__ocv_sort_modules_by_deps __lst)
372367
if (NOT ";${result};" MATCHES ";${m};")
373368
# scan through module dependencies...
374369
set(unresolved_deps_found FALSE)
375-
foreach (d ${OPENCV_MODULE_${m}_CHILDREN} ${OPENCV_MODULE_${m}_DEPS})
370+
foreach (d ${OPENCV_MODULE_${m}_DEPS})
376371
# ... which are not already in the result and are enabled
377372
if ((NOT ";${result};" MATCHES ";${d};") AND HAVE_${d})
378373
set(unresolved_deps_found TRUE)
@@ -791,21 +786,6 @@ macro(_ocv_create_module)
791786
get_native_precompiled_header(${the_module} precomp.hpp)
792787
endif()
793788

794-
set(sub_objs "")
795-
set(cuda_objs "")
796-
if (OPENCV_MODULE_${the_module}_CHILDREN)
797-
message(STATUS "Complex module ${the_module}")
798-
foreach (m ${OPENCV_MODULE_${the_module}_CHILDREN})
799-
if (BUILD_${m} AND TARGET ${m}_object)
800-
list(APPEND sub_objs $<TARGET_OBJECTS:${m}_object>)
801-
message(STATUS " + ${m}")
802-
else()
803-
message(STATUS " - ${m}")
804-
endif()
805-
list(APPEND cuda_objs ${OPENCV_MODULE_${m}_CUDA_OBJECTS})
806-
endforeach()
807-
endif()
808-
809789
if(WIN32
810790
AND (BUILD_SHARED_LIBS AND NOT "x${OPENCV_MODULE_TYPE}" STREQUAL "xSTATIC")
811791
AND NOT OPENCV_VS_VERSIONINFO_SKIP)
@@ -834,17 +814,10 @@ macro(_ocv_create_module)
834814
source_group("Src" FILES "${${the_module}_pch}")
835815
ocv_add_library(${the_module} ${OPENCV_MODULE_TYPE} ${OPENCV_MODULE_${the_module}_HEADERS} ${OPENCV_MODULE_${the_module}_SOURCES}
836816
"${OPENCV_CONFIG_FILE_INCLUDE_DIR}/cvconfig.h" "${OPENCV_CONFIG_FILE_INCLUDE_DIR}/opencv2/opencv_modules.hpp"
837-
${${the_module}_pch} ${sub_objs}
817+
${${the_module}_pch}
838818
${_VS_VERSION_FILE}
839819
)
840820

841-
if (cuda_objs)
842-
target_link_libraries(${the_module} LINK_PRIVATE ${cuda_objs})
843-
endif()
844-
845-
unset(sub_objs)
846-
unset(cuda_objs)
847-
848821
set_target_properties(${the_module} PROPERTIES LABELS "${OPENCV_MODULE_${the_module}_LABEL};Module")
849822
set_source_files_properties(${OPENCV_MODULE_${the_module}_HEADERS} ${OPENCV_MODULE_${the_module}_SOURCES} ${${the_module}_pch}
850823
PROPERTIES LABELS "${OPENCV_MODULE_${the_module}_LABEL};Module")
@@ -913,31 +886,17 @@ macro(_ocv_create_module)
913886
LIBRARY DESTINATION ${OPENCV_LIB_INSTALL_PATH} COMPONENT dev NAMELINK_ONLY)
914887
endif()
915888

916-
foreach(m ${OPENCV_MODULE_${the_module}_CHILDREN} ${the_module})
917-
# only "public" headers need to be installed
918-
if(OPENCV_MODULE_${m}_HEADERS AND ";${OPENCV_MODULES_PUBLIC};" MATCHES ";${m};")
919-
foreach(hdr ${OPENCV_MODULE_${m}_HEADERS})
920-
string(REGEX REPLACE "^.*opencv2/" "opencv2/" hdr2 "${hdr}")
921-
if(NOT hdr2 MATCHES "private" AND hdr2 MATCHES "^(opencv2/?.*)/[^/]+.h(..)?$" )
922-
install(FILES ${hdr} OPTIONAL DESTINATION "${OPENCV_INCLUDE_INSTALL_PATH}/${CMAKE_MATCH_1}" COMPONENT dev)
923-
endif()
924-
endforeach()
925-
endif()
926-
endforeach()
889+
# only "public" headers need to be installed
890+
if(OPENCV_MODULE_${the_module}_HEADERS AND ";${OPENCV_MODULES_PUBLIC};" MATCHES ";${the_module};")
891+
foreach(hdr ${OPENCV_MODULE_${the_module}_HEADERS})
892+
string(REGEX REPLACE "^.*opencv2/" "opencv2/" hdr2 "${hdr}")
893+
if(NOT hdr2 MATCHES "private" AND hdr2 MATCHES "^(opencv2/?.*)/[^/]+.h(..)?$" )
894+
install(FILES ${hdr} OPTIONAL DESTINATION "${OPENCV_INCLUDE_INSTALL_PATH}/${CMAKE_MATCH_1}" COMPONENT dev)
895+
endif()
896+
endforeach()
897+
endif()
927898

928899
_ocv_add_precompiled_headers(${the_module})
929-
930-
if (TARGET ${the_module}_object)
931-
# copy COMPILE_DEFINITIONS
932-
get_target_property(main_defs ${the_module} COMPILE_DEFINITIONS)
933-
if (main_defs)
934-
set_target_properties(${the_module}_object PROPERTIES COMPILE_DEFINITIONS ${main_defs})
935-
endif()
936-
# use same PCH
937-
if (TARGET pch_Generate_${the_module})
938-
add_dependencies(${the_module}_object pch_Generate_${the_module} )
939-
endif()
940-
endif()
941900
endmacro()
942901

943902
# opencv precompiled headers macro (can add pch to modules and tests)

cmake/OpenCVUtils.cmake

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -949,9 +949,6 @@ endfunction()
949949
function(_ocv_append_target_includes target)
950950
if(DEFINED OCV_TARGET_INCLUDE_DIRS_${target})
951951
target_include_directories(${target} PRIVATE ${OCV_TARGET_INCLUDE_DIRS_${target}})
952-
if (TARGET ${target}_object)
953-
target_include_directories(${target}_object PRIVATE ${OCV_TARGET_INCLUDE_DIRS_${target}})
954-
endif()
955952
if(OPENCV_DEPENDANT_TARGETS_${target})
956953
foreach(t ${OPENCV_DEPENDANT_TARGETS_${target}})
957954
target_include_directories(${t} PRIVATE ${OCV_TARGET_INCLUDE_DIRS_${target}})
@@ -975,27 +972,6 @@ function(ocv_add_library target)
975972

976973
add_library(${target} ${ARGN} ${cuda_objs})
977974

978-
# Add OBJECT library (added in cmake 2.8.8) to use in compound modules
979-
if (NOT CMAKE_VERSION VERSION_LESS "2.8.8" AND OPENCV_ENABLE_OBJECT_TARGETS
980-
AND NOT OPENCV_MODULE_${target}_CHILDREN
981-
AND NOT OPENCV_MODULE_${target}_CLASS STREQUAL "BINDINGS"
982-
AND NOT ${target} STREQUAL "opencv_ts"
983-
AND (NOT BUILD_opencv_world OR NOT HAVE_CUDA)
984-
)
985-
set(sources ${ARGN})
986-
ocv_list_filterout(sources "\\\\.(cl|inc|cu)$")
987-
add_library(${target}_object OBJECT ${sources})
988-
set_target_properties(${target}_object PROPERTIES
989-
EXCLUDE_FROM_ALL True
990-
EXCLUDE_FROM_DEFAULT_BUILD True
991-
POSITION_INDEPENDENT_CODE True
992-
)
993-
if (ENABLE_SOLUTION_FOLDERS)
994-
set_target_properties(${target}_object PROPERTIES FOLDER "object_libraries")
995-
endif()
996-
unset(sources)
997-
endif()
998-
999975
if(APPLE_FRAMEWORK AND BUILD_SHARED_LIBS)
1000976
message(STATUS "Setting Apple target properties for ${target}")
1001977

doc/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ endif(HAVE_DOC_GENERATOR)
3333

3434
if(BUILD_DOCS AND DOXYGEN_FOUND)
3535
# not documented modules list
36-
list(APPEND blacklist "ts" "java" "python2" "python3" "js" "world" "contrib_world")
36+
list(APPEND blacklist "ts" "java" "python2" "python3" "js" "world")
3737
unset(CMAKE_DOXYGEN_TUTORIAL_CONTRIB_ROOT)
3838
unset(CMAKE_DOXYGEN_TUTORIAL_JS_ROOT)
3939

0 commit comments

Comments
 (0)