update cmake 'install' target for Windows platform

Allow to build samples via OpenCV binaries from distribution package
(find_package with OpenCV_DIR).
This commit is contained in:
Alexander Alekhin
2013-08-07 12:53:48 +04:00
parent e3b42ed137
commit 555c505b70
25 changed files with 448 additions and 285 deletions

View File

@@ -32,11 +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")
set(sample_subfolder "tutorials")
else()
set(sample_kind example)
set(sample_KIND EXAMPLE)
set(sample_folder "samples//cpp")
set(sample_subfolder "cpp")
endif()
set(the_target "${sample_kind}_${name}")
@@ -52,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_folder}")
set_target_properties(${the_target} PROPERTIES FOLDER "samples/${sample_subfolder}")
endif()
if(WIN32)
@@ -60,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_folder}" COMPONENT main)
RUNTIME DESTINATION "${OPENCV_SAMPLES_BIN_INSTALL_PATH}/${sample_subfolder}" COMPONENT main)
endif()
ENDMACRO()