Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
574f011a
Commit
574f011a
authored
Sep 09, 2013
by
Roman Donchenko
Committed by
OpenCV Buildbot
Sep 09, 2013
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1410 from SpecLad:module-samples
parents
2208248d
e5735282
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
0 deletions
+44
-0
OpenCVModule.cmake
cmake/OpenCVModule.cmake
+44
-0
No files found.
cmake/OpenCVModule.cmake
View file @
574f011a
...
...
@@ -33,6 +33,7 @@
# <add extra installation rules>
# ocv_add_accuracy_tests(<extra dependencies>)
# ocv_add_perf_tests(<extra dependencies>)
# ocv_add_samples(<extra dependencies>)
#
#
# If module have no "extra" then you can define it in one line:
...
...
@@ -578,6 +579,7 @@ macro(ocv_define_module module_name)
ocv_add_accuracy_tests
()
ocv_add_perf_tests
()
ocv_add_samples
()
endmacro
()
# ensures that all passed modules are available
...
...
@@ -722,6 +724,48 @@ function(ocv_add_accuracy_tests)
endif
()
endfunction
()
function
(
ocv_add_samples
)
set
(
samples_path
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/samples"
)
string
(
REGEX REPLACE
"^opencv_"
""
module_id
${
the_module
}
)
if
(
BUILD_EXAMPLES AND EXISTS
"
${
samples_path
}
"
)
set
(
samples_deps
${
the_module
}
${
OPENCV_MODULE_
${
the_module
}
_DEPS
}
opencv_highgui
${
ARGN
}
)
ocv_check_dependencies
(
${
samples_deps
}
)
if
(
OCV_DEPENDENCIES_FOUND
)
file
(
GLOB sample_sources
"
${
samples_path
}
/*.cpp"
)
ocv_include_modules
(
${
OPENCV_MODULE_
${
the_module
}
_DEPS
}
)
foreach
(
source
${
sample_sources
}
)
get_filename_component
(
name
"
${
source
}
"
NAME_WE
)
set
(
the_target
"example_
${
module_id
}
_
${
name
}
"
)
add_executable
(
${
the_target
}
"
${
source
}
"
)
target_link_libraries
(
${
the_target
}
${
samples_deps
}
)
set_target_properties
(
${
the_target
}
PROPERTIES PROJECT_LABEL
"(sample)
${
name
}
"
)
if
(
ENABLE_SOLUTION_FOLDERS
)
set_target_properties
(
${
the_target
}
PROPERTIES
OUTPUT_NAME
"
${
module_id
}
-example-
${
name
}
"
FOLDER
"samples/
${
module_id
}
"
)
endif
()
if
(
WIN32
)
install
(
TARGETS
${
the_target
}
RUNTIME DESTINATION
"samples/
${
module_id
}
"
COMPONENT main
)
endif
()
endforeach
()
endif
()
endif
()
if
(
INSTALL_C_EXAMPLES AND NOT WIN32 AND EXISTS
"
${
samples_path
}
"
)
file
(
GLOB sample_files
"
${
samples_path
}
/*"
)
install
(
FILES
${
sample_files
}
DESTINATION share/OpenCV/samples/
${
module_id
}
PERMISSIONS OWNER_READ GROUP_READ WORLD_READ
)
endif
()
endfunction
()
# internal macro; finds all link dependencies of the module
# should be used at the end of CMake processing
macro
(
__ocv_track_module_link_dependencies the_module optkind
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment