Rename sample & tutorial executables
authorAndrey Kamaev <andrey.kamaev@itseez.com>
Thu, 8 Nov 2012 07:41:27 +0000 (11:41 +0400)
committerAndrey Kamaev <andrey.kamaev@itseez.com>
Fri, 9 Nov 2012 06:15:48 +0000 (10:15 +0400)
samples/c/CMakeLists.txt
samples/cpp/CMakeLists.txt
samples/gpu/CMakeLists.txt

index 411e185..dfab5e0 100644 (file)
@@ -27,7 +27,7 @@ if(BUILD_EXAMPLES AND OCV_DEPENDENCIES_FOUND)
     target_link_libraries(${the_target} ${OPENCV_LINKER_LIBS} ${OPENCV_C_SAMPLES_REQUIRED_DEPS})
 
     set_target_properties(${the_target} PROPERTIES
-      OUTPUT_NAME "${name}"
+      OUTPUT_NAME "c-example-${name}"
       PROJECT_LABEL "(EXAMPLE) ${name}")
 
     if(ENABLE_SOLUTION_FOLDERS)
@@ -47,7 +47,7 @@ if(BUILD_EXAMPLES AND OCV_DEPENDENCIES_FOUND)
 
   foreach(sample_filename ${cpp_samples})
     get_filename_component(sample ${sample_filename} NAME_WE)
-    OPENCV_DEFINE_C_EXAMPLE(${sample}  ${sample_filename})
+    OPENCV_DEFINE_C_EXAMPLE(${sample} ${sample_filename})
   endforeach()
 endif()
 
index 1ed0d2c..2004857 100644 (file)
@@ -28,7 +28,16 @@ if(BUILD_EXAMPLES AND OCV_DEPENDENCIES_FOUND)
   #      Define executable targets
   # ---------------------------------------------
   MACRO(OPENCV_DEFINE_CPP_EXAMPLE name srcs)
-    set(the_target "example_${name}")
+
+    if("${srcs}" MATCHES "tutorial_code")
+      set(sample_kind tutorial)
+      set(sample_KIND TUTORIAL)
+    else()
+      set(sample_kind example)
+      set(sample_KIND EXAMPLE)
+    endif()
+
+    set(the_target "${sample_kind}_${name}")
     add_executable(${the_target} ${srcs})
     target_link_libraries(${the_target} ${OPENCV_LINKER_LIBS} ${OPENCV_CPP_SAMPLES_REQUIRED_DEPS})
 
@@ -37,11 +46,11 @@ if(BUILD_EXAMPLES AND OCV_DEPENDENCIES_FOUND)
     endif()
 
     set_target_properties(${the_target} PROPERTIES
-      OUTPUT_NAME "${name}"
-      PROJECT_LABEL "(EXAMPLE) ${name}")
+      OUTPUT_NAME "cpp-${sample_kind}-${name}"
+      PROJECT_LABEL "(${sample_KIND}) ${name}")
 
     if(ENABLE_SOLUTION_FOLDERS)
-      set_target_properties(${the_target} PROPERTIES FOLDER "samples//cpp")
+      set_target_properties(${the_target} PROPERTIES FOLDER "${sample_kind}s//cpp")
     endif()
 
     if(WIN32)
@@ -49,7 +58,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 "samples/cpp" COMPONENT main)
+              RUNTIME DESTINATION "${sample_kind}s/cpp" COMPONENT main)
     endif()
   ENDMACRO()
 
index 2bf069e..6abb7e5 100644 (file)
@@ -35,7 +35,7 @@ if(BUILD_EXAMPLES AND OCV_DEPENDENCIES_FOUND)
     target_link_libraries(${the_target} ${OPENCV_LINKER_LIBS} ${OPENCV_GPU_SAMPLES_REQUIRED_DEPS})
 
     set_target_properties(${the_target} PROPERTIES
-      OUTPUT_NAME "${name}_${project}"
+      OUTPUT_NAME "${project}-example-${name}"
       PROJECT_LABEL "(EXAMPLE_${project_upper}) ${name}")
 
     if(ENABLE_SOLUTION_FOLDERS)