Ticket #32528: patch-CMakeLists.txt.diff
File patch-CMakeLists.txt.diff, 3.1 KB (added by marin.saric@…, 13 years ago) |
---|
-
CMakeLists.txt
old new 74 74 # ---------------------------------------------------------------------------- 75 75 set(BUILD_SHARED_LIBS ON CACHE BOOL "Build shared libraries (.dll/.so) instead of static ones (.lib/.a)") 76 76 77 # Allow for building both dynamic and static libraries by running 78 # cmake multiple times 79 set(OPENCV_BUILT_SHARED_AND_STATIC OFF CACHE BOOL 80 "OpenCV is built both shared and static by successive calls to cmake") 81 82 # Link static libraries against other static libraries on MacOS, if possible 83 if(APPLE AND NOT BUILD_SHARED_LIBS) 84 set(CMAKE_FIND_LIBRARY_SUFFIXES ".a;.framework;.dylib") 85 endif() 86 77 87 # ---------------------------------------------------------------------------- 78 88 # Include debug info into debug libs? 79 89 # Default: yes … … 439 449 macro(CHECK_MODULE module_name define) 440 450 set(${define} 0) 441 451 if(PKG_CONFIG_FOUND) 452 if (BUILD_SHARED_LIBS) 453 set(ALIAS_PKG_BUILD_MODE "") 454 else() 455 set(ALIAS_PKG_BUILD_MODE "_STATIC") 456 endif() 442 457 set(ALIAS ALIASOF_${module_name}) 443 458 set(ALIAS_FOUND ${ALIAS}_FOUND) 444 459 set(ALIAS_INCLUDE_DIRS ${ALIAS}_INCLUDE_DIRS) 445 set(ALIAS_LIBRARY_DIRS ${ALIAS}_ LIBRARY_DIRS)446 set(ALIAS_LIBRARIES ${ALIAS} _LIBRARIES)460 set(ALIAS_LIBRARY_DIRS ${ALIAS}_${ALIAS_PKG_BUILD_MODE}_LIBRARY_DIRS) 461 set(ALIAS_LIBRARIES ${ALIAS}${ALIAS_PKG_BUILD_MODE}_LIBRARIES) 447 462 448 463 PKG_CHECK_MODULES(${ALIAS} ${module_name}) 449 464 … … 461 476 endif() 462 477 endforeach() 463 478 464 list(APPEND HIGHGUI_LIBRARIES ${${ALIAS_LIBRARIES}}) 479 foreach(TMP_LIB_NAME ${${ALIAS_LIBRARIES}}) 480 FIND_LIBRARY(${TMP_LIB_NAME}_LIBRARY 481 NAMES ${TMP_LIB_NAME} 482 PATHS ${${ALIAS_LIBRARY_DIRS}}) 483 list(APPEND HIGHGUI_LIBRARIES ${${TMP_LIB_NAME}_LIBRARY}) 484 endforeach() 465 485 endif() 466 486 endif() 467 487 endmacro() … … 509 529 CHECK_MODULE(libavformat HAVE_FFMPEG_FORMAT) 510 530 CHECK_MODULE(libavutil HAVE_FFMPEG_UTIL) 511 531 CHECK_MODULE(libswscale HAVE_FFMPEG_SWSCALE) 532 CHECK_MODULE(orc-0.4 HAVE_ORC_04) 512 533 CHECK_INCLUDE_FILE(libavformat/avformat.h HAVE_GENTOO_FFMPEG) 513 534 CHECK_INCLUDE_FILE(ffmpeg/avformat.h HAVE_FFMPEG_FFMPEG) 514 535 if(NOT HAVE_GENTOO_FFMPEG AND NOT HAVE_FFMPEG_FFMPEG) … … 702 723 set(HAVE_SPHINX 0) 703 724 if(SPHINX_PROCESS EQUAL 0) 704 725 find_host_program(SPHINX_BUILD sphinx-build) 726 if (NOT SPHINX_BUILD) 727 find_host_program(SPHINX_BUILD sphinx-build-${PYTHON_VERSION_MAJOR_MINOR}) 728 endif() 705 729 if(SPHINX_BUILD) 706 730 set(HAVE_SPHINX 1) 707 731 message(STATUS " Found Sphinx ${SPHINX_VERSION}: ${SPHINX_BUILD}") … … 1539 1563 add_subdirectory(data) 1540 1564 add_subdirectory(3rdparty) 1541 1565 1542 if(BUILD_EXAMPLES OR BUILD_ANDROID_EXAMPLES OR INSTALL_PYTHON_EXAMPLES) 1566 if(BUILD_EXAMPLES OR BUILD_ANDROID_EXAMPLES OR INSTALL_PYTHON_EXAMPLES 1567 OR INSTALL_C_EXAMPLES) 1543 1568 add_subdirectory(samples) 1544 1569 endif() 1545 1570