From f282498b1d4b3a93f306c7d8da9c0dc547949156 Mon Sep 17 00:00:00 2001 From: Andrey Kamaev Date: Mon, 25 Mar 2013 21:57:53 +0400 Subject: [PATCH] Drop outdated targets and fix solution folders --- cmake/OpenCVExtraTargets.cmake | 54 ++------------------------------ cmake/OpenCVModule.cmake | 3 -- modules/java/test/CMakeLists.txt | 4 +++ samples/cpp/CMakeLists.txt | 6 ++-- 4 files changed, 10 insertions(+), 57 deletions(-) diff --git a/cmake/OpenCVExtraTargets.cmake b/cmake/OpenCVExtraTargets.cmake index 936e3a2635..b4d339155a 100644 --- a/cmake/OpenCVExtraTargets.cmake +++ b/cmake/OpenCVExtraTargets.cmake @@ -13,57 +13,7 @@ endif() # ---------------------------------------------------------------------------- -# Source package, for "make package_source" -# ---------------------------------------------------------------------------- -if(BUILD_PACKAGE) - set(TARBALL_NAME "${CMAKE_PROJECT_NAME}-${OPENCV_VERSION}") - if (NOT WIN32) - if(APPLE) - set(TAR_CMD gnutar) - else() - set(TAR_CMD tar) - endif() - set(TAR_TRANSFORM "\"s,^,${TARBALL_NAME}/,\"") - add_custom_target(package_source - #TODO: maybe we should not remove dll's - COMMAND ${TAR_CMD} --transform ${TAR_TRANSFORM} -cjpf ${CMAKE_CURRENT_BINARY_DIR}/${TARBALL_NAME}.tar.bz2 --exclude=".svn" --exclude=".git" --exclude="*.pyc" --exclude="*.vcproj" --exclude="*/lib/*" --exclude="*.dll" ./ - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) - else() - add_custom_target(package_source - COMMAND zip -9 -r ${CMAKE_CURRENT_BINARY_DIR}/${TARBALL_NAME}.zip . -x '*/.svn/*' '*/.git/*' '*.vcproj' '*.pyc' - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) - endif() - if(ENABLE_SOLUTION_FOLDERS) - set_target_properties(package_source PROPERTIES FOLDER "extra") - endif() -endif() - - -# ---------------------------------------------------------------------------- -# performance tests, for "make perf" -# ---------------------------------------------------------------------------- -if(BUILD_PERF_TESTS AND PYTHON_EXECUTABLE) - if(CMAKE_VERSION VERSION_GREATER "2.8.2") - add_custom_target(perf - ${PYTHON_EXECUTABLE} "${OpenCV_SOURCE_DIR}/modules/ts/misc/run.py" --configuration $ "${CMAKE_BINARY_DIR}" - WORKING_DIRECTORY "${CMAKE_BINARY_DIR}" - DEPENDS "${OpenCV_SOURCE_DIR}/modules/ts/misc/run.py" - ) - else() - add_custom_target(perf - ${PYTHON_EXECUTABLE} "${OpenCV_SOURCE_DIR}/modules/ts/misc/run.py" "${CMAKE_BINARY_DIR}" - WORKING_DIRECTORY "${CMAKE_BINARY_DIR}" - DEPENDS "${OpenCV_SOURCE_DIR}/modules/ts/misc/run.py" - ) - endif() - if(ENABLE_SOLUTION_FOLDERS) - set_target_properties(perf PROPERTIES FOLDER "extra") - endif() -endif() - - -# ---------------------------------------------------------------------------- -# spefial targets to build all OpenCV modules +# target building all OpenCV modules # ---------------------------------------------------------------------------- add_custom_target(opencv_modules) if(ENABLE_SOLUTION_FOLDERS) @@ -72,7 +22,7 @@ endif() # ---------------------------------------------------------------------------- -# spefial targets to build all tests +# targets building all tests # ---------------------------------------------------------------------------- if(BUILD_TESTS) add_custom_target(opencv_tests) diff --git a/cmake/OpenCVModule.cmake b/cmake/OpenCVModule.cmake index abb0393956..90b4863405 100644 --- a/cmake/OpenCVModule.cmake +++ b/cmake/OpenCVModule.cmake @@ -635,9 +635,6 @@ function(ocv_add_perf_tests) ocv_add_precompiled_headers(${the_target}) - if (PYTHON_EXECUTABLE) - add_dependencies(perf ${the_target}) - endif() else(OCV_DEPENDENCIES_FOUND) # TODO: warn about unsatisfied dependencies endif(OCV_DEPENDENCIES_FOUND) diff --git a/modules/java/test/CMakeLists.txt b/modules/java/test/CMakeLists.txt index 8f3021991d..122aae22a0 100644 --- a/modules/java/test/CMakeLists.txt +++ b/modules/java/test/CMakeLists.txt @@ -75,3 +75,7 @@ add_custom_command(OUTPUT "${opencv_test_java_bin_dir}/build/jar/opencv-test.jar add_custom_target(${PROJECT_NAME} ALL SOURCES "${opencv_test_java_bin_dir}/build/jar/opencv-test.jar") add_dependencies(${PROJECT_NAME} ${the_module}) + +if(ENABLE_SOLUTION_FOLDERS) + set_target_properties(${PROJECT_NAME} PROPERTIES FOLDER "tests accuracy") +endif() diff --git a/samples/cpp/CMakeLists.txt b/samples/cpp/CMakeLists.txt index f69382ac66..ac61ec359e 100644 --- a/samples/cpp/CMakeLists.txt +++ b/samples/cpp/CMakeLists.txt @@ -32,9 +32,11 @@ if(BUILD_EXAMPLES AND OCV_DEPENDENCIES_FOUND) if("${srcs}" MATCHES "tutorial_code") set(sample_kind tutorial) set(sample_KIND TUTORIAL) + set(sample_folder "samples//tutorials") else() set(sample_kind example) set(sample_KIND EXAMPLE) + set(sample_folder "samples//cpp") endif() set(the_target "${sample_kind}_${name}") @@ -50,7 +52,7 @@ if(BUILD_EXAMPLES AND OCV_DEPENDENCIES_FOUND) PROJECT_LABEL "(${sample_KIND}) ${name}") if(ENABLE_SOLUTION_FOLDERS) - set_target_properties(${the_target} PROPERTIES FOLDER "${sample_kind}s//cpp") + set_target_properties(${the_target} PROPERTIES FOLDER "${sample_folder}") endif() if(WIN32) @@ -58,7 +60,7 @@ if(BUILD_EXAMPLES AND OCV_DEPENDENCIES_FOUND) set_target_properties(${the_target} PROPERTIES LINK_FLAGS "/NODEFAULTLIB:atlthunk.lib /NODEFAULTLIB:atlsd.lib /DEBUG") endif() install(TARGETS ${the_target} - RUNTIME DESTINATION "${sample_kind}s/cpp" COMPONENT main) + RUNTIME DESTINATION "${sample_folder}" COMPONENT main) endif() ENDMACRO()