From 4d7a593c254657cd41e4c1659ac5420ef7082d8f Mon Sep 17 00:00:00 2001 From: Anatoly Baksheev Date: Wed, 12 Mar 2014 16:21:36 +0400 Subject: [PATCH] minor cmake fix fo macos --- cmake/OpenCVModule.cmake | 8 ++------ modules/viz/CMakeLists.txt | 4 ++++ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cmake/OpenCVModule.cmake b/cmake/OpenCVModule.cmake index 6f727af..05faa35 100644 --- a/cmake/OpenCVModule.cmake +++ b/cmake/OpenCVModule.cmake @@ -484,7 +484,7 @@ macro(ocv_glob_module_sources) file(GLOB_RECURSE lib_int_hdrs "src/*.hpp" "src/*.h") file(GLOB lib_hdrs "include/opencv2/${name}/*.hpp" "include/opencv2/${name}/*.h") file(GLOB lib_hdrs_detail "include/opencv2/${name}/detail/*.hpp" "include/opencv2/${name}/detail/*.h") - file(GLOB_RECURSE lib_srcs_apple "src/*.m*") + file(GLOB_RECURSE lib_srcs_apple "src/*.mm") if (APPLE) list(APPEND lib_srcs ${lib_srcs_apple}) endif() @@ -748,12 +748,8 @@ function(ocv_add_accuracy_tests) endif() get_native_precompiled_header(${the_target} test_precomp.hpp) + add_executable(${the_target} ${OPENCV_TEST_${the_module}_SOURCES} ${${the_target}_pch}) - if(APPLE AND ${the_target} STREQUAL "opencv_test_viz") - add_executable(${the_target} MACOSX_BUNDLE ${OPENCV_TEST_${the_module}_SOURCES} ${${the_target}_pch}) - else() - add_executable(${the_target} ${OPENCV_TEST_${the_module}_SOURCES} ${${the_target}_pch}) - endif() target_link_libraries(${the_target} ${OPENCV_MODULE_${the_module}_DEPS} ${test_deps} ${OPENCV_LINKER_LIBS}) add_dependencies(opencv_tests ${the_target}) diff --git a/modules/viz/CMakeLists.txt b/modules/viz/CMakeLists.txt index 7ccd079..d839491 100644 --- a/modules/viz/CMakeLists.txt +++ b/modules/viz/CMakeLists.txt @@ -9,3 +9,7 @@ ocv_define_module(viz opencv_core ${VTK_LIBRARIES}) if(APPLE AND BUILD_opencv_viz) target_link_libraries(opencv_viz "-framework Cocoa") endif() + +if(TARGET opencv_test_viz) + set_target_properties(opencv_test_viz PROPERTIES MACOSX_BUNDLE TRUE) +endif() -- 2.7.4