Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
otb
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Main Repositories
otb
Commits
561fb597
Commit
561fb597
authored
8 years ago
by
Rashad Kanavath
Browse files
Options
Downloads
Patches
Plain Diff
COMP: add FindGBenchmark.cmake and put find_package there
parent
aa14a3e0
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
CMake/FindGBenchmark.cmake
+29
-0
29 additions, 0 deletions
CMake/FindGBenchmark.cmake
Modules/ThirdParty/OssimPlugins/test/CMakeLists.txt
+24
-74
24 additions, 74 deletions
Modules/ThirdParty/OssimPlugins/test/CMakeLists.txt
with
53 additions
and
74 deletions
CMake/FindGBenchmark.cmake
0 → 100644
+
29
−
0
View file @
561fb597
# Find the Google Benchmark library
# Defines:
# GBENCHMARK_INCLUDE_DIR - gbenchmark include directory
# GBENCHMARK_LIBRARY - gbenchmark library file
# GBENCHMARK_FOUND - TRUE if gbenchmark is found
if
(
GBENCHMARK_INCLUDE_DIR
)
#check cache
set
(
GBENCHMARK_FIND_QUIETLY TRUE
)
endif
()
if
(
NOT GBENCHMARK_INCLUDE_DIR
)
find_path
(
GBENCHMARK_INCLUDE_DIR NAMES benchmark.h PATH_SUFFIXES benchmark
)
set
(
GBENCHMARK_INCLUDE_DIR
${
GBENCHMARK_INCLUDE_DIR
}
/benchmark CACHE PATH
"Google.benchmark include direcory"
)
endif
()
mark_as_advanced
(
GBENCHMARK_INCLUDE_DIR
)
find_library
(
GBENCHMARK_LIBRARY NAMES benchmark
)
mark_as_advanced
(
GBENCHMARK_LIBRARY
)
include
(
FindPackageHandleStandardArgs
)
FIND_PACKAGE_HANDLE_STANDARD_ARGS
(
GBENCHMARK
REQUIRED_VARS GBENCHMARK_LIBRARY GBENCHMARK_INCLUDE_DIR
)
#VERSION_VAR GBENCHMARK_VERSION_STRING
set
(
GBENCHMARK_LIBRARIES
${
GBENCHMARK_LIBRARY
}
)
set
(
GBENCHMARK_INCLUDE_DIRS
${
GBENCHMARK_INCLUDE_DIR
}
)
This diff is collapsed.
Click to expand it.
Modules/ThirdParty/OssimPlugins/test/CMakeLists.txt
+
24
−
74
View file @
561fb597
# cmake_minimum_required(VERSION 2.6)
# SET(CMAKE_MODULE_PATH "${${PROJECT_NAME}_SOURCE_DIR}/cmake;${CMAKE_MODULE_PATH}")
otb_module_test
()
message
(
STATUS
"UT:
${
Boost_UNIT_TEST_FRAMEWORK_LIBRARY
}
"
)
#===== find_cots function
include
(
FindPackageHandleStandardArgs
)
function
(
find_cots NAME inc_file lib_file target
)
string
(
TOLOWER
${
NAME
}
name
)
MESSAGE
(
STATUS
"search:
${
NAME
}
/
${
name
}
in: VAR=
${${
NAME
}
_DIR
}
$VAR=$ENV{
${
NAME
}
_DIR}"
)
set
(
THE_ENV
"$ENV{
${
NAME
}
_DIR}"
)
# MESSAGE(STATUS "THE_ENV: ${THE_ENV}")
# The root directory
if
((
NOT
"
${${
NAME
}
_DIR
}
"
STREQUAL
""
)
AND EXISTS
"
${${
NAME
}
_DIR
}
"
AND IS_DIRECTORY
"
${${
NAME
}
_DIR
}
"
)
set
(
DIR
"
${${
NAME
}
_DIR
}
"
)
# nothing more to do
elseif
((
NOT
"
${
THE_ENV
}
"
STREQUAL
""
)
AND EXISTS
"
${
THE_ENV
}
"
AND IS_DIRECTORY
"
${
THE_ENV
}
"
)
# MESSAGE(STATUS "setting from ${NAME}_DIR: ${THE_ENV}")
set
(
DIR
"
${
THE_ENV
}
"
)
endif
()
# MESSAGE(STATUS "DIR: ${DIR}")
set
(
${
NAME
}
_DIR
${
DIR
}
)
# The include/ dir
find_path
(
${
NAME
}
_INCLUDE_DIR
NAMES
${
inc_file
}
HINTS
${
DIR
}
/include
PATHS
${
DIR
}
/include
)
# The lib/ dir
find_library
(
${
NAME
}
_LIBRARY
NAMES
${
lib_file
}
HINTS
${
DIR
}
/lib
PATHS
${
DIR
}
/lib
)
find_package_handle_standard_args
(
${
NAME
}
DEFAULT_MSG
${
NAME
}
_DIR
${
NAME
}
_LIBRARY
${
NAME
}
_INCLUDE_DIR
)
if
(
FIND_COTS_DEBUG
)
message
(
STATUS
"
${
NAME
}
_DIR:
${${
NAME
}
_DIR
}
"
)
message
(
STATUS
"
${
NAME
}
_INCLUDE_DIR:
${${
NAME
}
_INCLUDE_DIR
}
"
)
message
(
STATUS
"
${
NAME
}
_LIBRARY:
${${
NAME
}
_LIBRARY
}
"
)
endif
()
if
(
${
NAME
}
_FOUND
)
set
(
${
NAME
}
_DIR
${${
NAME
}
_DIR
}
CACHE PATH
"Path to
${
NAME
}
root installation directory"
FORCE
)
set
(
${
NAME
}
_LIBRARY_DIRS
${${
NAME
}
_DIR
}
/lib CACHE PATH
"Path to
${
NAME
}
libraries"
FORCE
)
endif
()
# set(${NAME}_INCLUDE_DIR ${NAME}_INCLUDE_DIR PARENT_SCOPE)
# set(${NAME}_LIBRARY ${NAME}_LIBRARY PARENT_SCOPE)
set
(
${
NAME
}
_FOUND
${${
NAME
}
_FOUND
}
PARENT_SCOPE
)
endfunction
()
# Common dirs
include_directories
(
${
PROJECT_SOURCE_DIR
}
/Modules/ThirdParty/OssimPlugins/src/ossim
${
OSSIM_INCLUDE_DIR
}
)
#include_directories(${PROJECT_SOURCE_DIR}/Modules/ThirdParty/OssimPlugins/src/ossim ${OSSIM_INCLUDE_DIR})
#==== UT for utilities
add_executable
(
ossimStringUtilitiesTest ossimStringUtilitiesTest.cpp
)
target_link_libraries
(
ossimStringUtilitiesTest
otbossimplugins
${
Boost_UNIT_TEST_FRAMEWORK_LIBRARY
}
)
otb_module_target_label
(
ossimStringUtilitiesTest
)
otb_add_test
(
NAME ossimStringUtilitiesTest COMMAND ossimStringUtilitiesTest
)
add_executable
(
ossimTimeUtilitiesTest ossimTimeUtilitiesTest.cpp
)
target_link_libraries
(
ossimTimeUtilitiesTest
# ${OTBOssim_LIBRARIES}
otbossimplugins
${
Boost_UNIT_TEST_FRAMEWORK_LIBRARY
}
)
otb_module_target_label
(
ossimTimeUtilitiesTest
)
otb_add_test
(
NAME ossimTimeUtilitiesTest COMMAND ossimTimeUtilitiesTest
)
if
(
Boost_UNIT_TEST_FRAMEWORK_FOUND
)
add_executable
(
ossimStringUtilitiesTest ossimStringUtilitiesTest.cpp
)
target_link_libraries
(
ossimStringUtilitiesTest
otbossimplugins
${
Boost_UNIT_TEST_FRAMEWORK_LIBRARY
}
)
otb_module_target_label
(
ossimStringUtilitiesTest
)
otb_add_test
(
NAME ossimStringUtilitiesTest COMMAND ossimStringUtilitiesTest
)
add_executable
(
ossimTimeUtilitiesTest ossimTimeUtilitiesTest.cpp
)
target_link_libraries
(
ossimTimeUtilitiesTest
# ${OTBOssim_LIBRARIES}
otbossimplugins
${
Boost_UNIT_TEST_FRAMEWORK_LIBRARY
}
)
otb_module_target_label
(
ossimTimeUtilitiesTest
)
otb_add_test
(
NAME ossimTimeUtilitiesTest COMMAND ossimTimeUtilitiesTest
)
else
()
message
(
STATUS
"Boost unit test framework not found, ossimStringUtilitiesTest and ossimTimeUtilitiesTest will be skipped."
)
endif
()
#==== Benchmarking Time conversion
# (requires google.benchmark)
find_cots
(
GBenchmark benchmark/benchmark.h benchmark
"OSSIM Time utilities"
)
if
(
GBenchmark_FOUND
)
find_package
(
GBenchmark
)
if
(
GBENCHMARK_FOUND
)
add_executable
(
ossimTimeUtilitiesBench ossimTimeUtilitiesBench.cpp
)
include_directories
(
${
GB
enchmark
_INCLUDE_DIR
}
)
include_directories
(
${
GB
ENCHMARK
_INCLUDE_DIR
S
}
)
target_link_libraries
(
ossimTimeUtilitiesBench
otbossimplugins
${
GB
enchmark
_LIBRAR
Y
}
)
${
GB
ENCHMARK
_LIBRAR
IES
}
)
otb_module_target_label
(
ossimTimeUtilitiesBench
)
else
()
message
(
STATUS
"Google.benchmark not found,
OSSIM
Time
u
tilities
b
ench
marking ignor
ed."
)
message
(
STATUS
"Google.benchmark not found,
ossim
Time
U
tilities
B
ench
will be skipp
ed."
)
endif
()
...
...
@@ -102,8 +54,6 @@ add_executable(ossimTerraSarXSarSensorModelTest ossimTerraSarXSarSensorModelTest
target_link_libraries
(
ossimTerraSarXSarSensorModelTest otbossimplugins
)
otb_module_target_label
(
ossimTerraSarXSarSensorModelTest
)
#Use ctest
# enable_testing()
otb_add_test
(
NAME ossimSarSensorModelTest COMMAND ossimSarSensorModelTest
)
#S1 tests
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment