Shortened cmake script for opencv_world

pull/2/head
Andrey Kamaev 13 years ago
parent 58aac7ea98
commit c5df95d5a9
  1. 31
      modules/world/CMakeLists.txt

@ -1,12 +1,12 @@
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)
if(IOS)
set(BUILD_WORLD_AS_STATIC 1)
endif()
if(NOT BUILD_WORLD_AS_STATIC)
set(OPENCV_MODULE_TYPE SHARED)
if(IOS OR NOT BUILD_SHARED_LIBS)
set(OPENCV_MODULE_TYPE STATIC)
set(OPENCV_WORLD_FLAGS_PROPERTY STATIC_LIBRARY_FLAGS)
else()
set(OPENCV_WORLD_FLAGS_PROPERTY LINK_FLAGS)
endif()
ocv_add_module(world opencv_core)
@ -85,25 +85,14 @@ string(REPLACE ";" " " objlist "${objlist}")
if(have_cfg)
string(REGEX REPLACE "<CONFIGURATION>" "Debug" objlist_dbg "${objlist}")
string(REGEX REPLACE "<CONFIGURATION>" "Release" objlist_rls "${objlist}")
if(BUILD_WORLD_AS_STATIC)
set_target_properties(${the_module} PROPERTIES
STATIC_LIBRARY_FLAGS_DEBUG ${objlist_dbg}
STATIC_LIBRARY_FLAGS_RELEASE ${objlist_rls})
else()
set_target_properties(${the_module} PROPERTIES
LINK_FLAGS_DEBUG ${objlist_dbg}
LINK_FLAGS_RELEASE ${objlist_rls})
endif()
set_target_properties(${the_module} PROPERTIES
${OPENCV_WORLD_FLAGS_PROPERTY}_DEBUG ${objlist_dbg}
${OPENCV_WORLD_FLAGS_PROPERTY}_RELEASE ${objlist_rls})
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)
if(BUILD_WORLD_AS_STATIC)
set_target_properties(${the_module} PROPERTIES
STATIC_LIBRARY_FLAGS "@${CMAKE_CURRENT_BINARY_DIR}/world_objects.rsp")
else()
set_target_properties(${the_module} PROPERTIES
LINK_FLAGS "@${CMAKE_CURRENT_BINARY_DIR}/world_objects.rsp")
endif()
set_target_properties(${the_module} PROPERTIES
${OPENCV_WORLD_FLAGS_PROPERTY} "@${CMAKE_CURRENT_BINARY_DIR}/world_objects.rsp")
endif()
ocv_add_precompiled_headers(${the_module})

Loading…
Cancel
Save