|
|
|
@ -1,6 +1,7 @@ |
|
|
|
|
set(the_description "All the selected OpenCV modules in a single binary") |
|
|
|
|
set(OPENCV_MODULE_IS_PART_OF_WORLD FALSE) |
|
|
|
|
set(BUILD_opencv_world_INIT OFF) |
|
|
|
|
set(OPENCV_MODULE_TYPE SHARED) |
|
|
|
|
|
|
|
|
|
ocv_add_module(world opencv_core) |
|
|
|
|
|
|
|
|
@ -41,21 +42,27 @@ foreach(m ${OPENCV_MODULE_${the_module}_DEPS}) |
|
|
|
|
endif() |
|
|
|
|
|
|
|
|
|
string(REGEX REPLACE "<MODULE_NAME>" "${m}" objpath1 "${${m}_BINARY_DIR}/${objpath0}") |
|
|
|
|
foreach(src ${OPENCV_MODULE_${m}_SOURCES}) |
|
|
|
|
if(IS_ABSOLUTE "${src}") |
|
|
|
|
file(RELATIVE_PATH srcname "${OPENCV_MODULE_${m}_LOCATION}" "${src}") |
|
|
|
|
else() |
|
|
|
|
set(srcname "${src}") |
|
|
|
|
endif() |
|
|
|
|
string(REPLACE ".." "__" srcname "${srcname}") |
|
|
|
|
if(srcname MATCHES "\\.(cpp|mm|c|cxx|cc)$") |
|
|
|
|
get_filename_component(srcname_we ${srcname} NAME_WE) |
|
|
|
|
string(REGEX REPLACE <SRC_NAME_WE> "${srcname_we}" objpath2 "${objpath1}") |
|
|
|
|
string(REGEX REPLACE <RELATIVE_SRC_NAME> "${srcname}" objpath3 "${objpath2}") |
|
|
|
|
if(CMAKE_GENERATOR MATCHES Xcode) |
|
|
|
|
set(objpath4 ${objpath3}) |
|
|
|
|
foreach(srcname ${OPENCV_MODULE_${m}_SOURCES}) |
|
|
|
|
if(srcname MATCHES "\\.(cpp|mm|c|cxx|cc|o|obj)$") |
|
|
|
|
if(srcname MATCHES "\\.(o|obj)$") |
|
|
|
|
if(IS_ABSOLUTE "${srcname}") |
|
|
|
|
set(objpath3 "${srcname}") |
|
|
|
|
else() |
|
|
|
|
set(objpath3 "${${m}_SOURCE_DIR}/${srcname}") |
|
|
|
|
endif() |
|
|
|
|
else() |
|
|
|
|
if(IS_ABSOLUTE "${srcname}") |
|
|
|
|
file(RELATIVE_PATH srcname "${OPENCV_MODULE_${m}_LOCATION}" "${srcname}") |
|
|
|
|
endif() |
|
|
|
|
string(REPLACE ".." "__" srcname "${srcname}") |
|
|
|
|
get_filename_component(srcname_we ${srcname} NAME_WE) |
|
|
|
|
string(REGEX REPLACE <SRC_NAME_WE> "${srcname_we}" objpath2 "${objpath1}") |
|
|
|
|
string(REGEX REPLACE <RELATIVE_SRC_NAME> "${srcname}" objpath3 "${objpath2}") |
|
|
|
|
endif() |
|
|
|
|
if(CMAKE_GENERATOR MATCHES Makefiles) |
|
|
|
|
file(RELATIVE_PATH objpath4 "${CMAKE_CURRENT_BINARY_DIR}" "${objpath3}") |
|
|
|
|
else() |
|
|
|
|
set(objpath4 ${objpath3}) |
|
|
|
|
endif() |
|
|
|
|
list(APPEND objlist "\"${objpath4}\"") |
|
|
|
|
endif() |
|
|
|
@ -74,7 +81,7 @@ else() |
|
|
|
|
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/world_objects.list" "${objlist}") |
|
|
|
|
execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different "${CMAKE_CURRENT_BINARY_DIR}/world_objects.list" "${CMAKE_CURRENT_BINARY_DIR}/world_objects.rsp" OUTPUT_QUIET) |
|
|
|
|
set_target_properties(${the_module} PROPERTIES |
|
|
|
|
LINK_FLAGS @world_objects.rsp) |
|
|
|
|
LINK_FLAGS "@${CMAKE_CURRENT_BINARY_DIR}/world_objects.rsp") |
|
|
|
|
endif() |
|
|
|
|
|
|
|
|
|
ocv_add_precompiled_headers(${the_module}) |
|
|
|
|