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
Sébastien Peillet
otb
Commits
91082e8d
Commit
91082e8d
authored
9 years ago
by
Rashad Kanavath
Browse files
Options
Downloads
Patches
Plain Diff
ENH: build examples as standalone project
parent
9a90d4f2
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Examples/CMakeLists.txt
+90
-2
90 additions, 2 deletions
Examples/CMakeLists.txt
with
90 additions
and
2 deletions
Examples/CMakeLists.txt
+
90
−
2
View file @
91082e8d
##### check if standalone project ######
if
(
NOT PROJECT_NAME
)
if
(
WIN32
)
cmake_minimum_required
(
VERSION 2.8.8 FATAL_ERROR
)
else
()
cmake_minimum_required
(
VERSION 2.8.6 FATAL_ERROR
)
endif
()
project
(
OTBExamples
)
endif
()
if
(
PROJECT_NAME STREQUAL
"OTBExamples"
)
set
(
BUILD_TESTING ON
)
include
(
CTest
)
include
(
${
CMAKE_CURRENT_SOURCE_DIR
}
/../CMake/OTBManageLargeInputPaths.cmake
)
endif
()
##### check if standalone project ######
if
(
NOT OTB_BUILD_DEFAULT_MODULES
)
message
(
FATAL_ERROR
"BUILD_EXAMPLES requires OTB_BUILD_DEFAULT_MODULES to be ON"
)
endif
()
...
...
@@ -12,11 +30,81 @@ endforeach()
find_package
(
OTB REQUIRED
)
include
(
${
OTB_USE_FILE
}
)
# TODO : build as standalone project
message
(
STATUS
"Found OTB:
${
OTB_USE_FILE
}
"
)
set
(
OTB_TEST_DRIVER otbTestDriver
)
if
(
BUILD_APPLICATIONS
)
########################## shamelessly copied from OTB/CMakeLists.txt ##########################
#Generate cmake variables with a set of largeinput data used in tests
set
(
BASELINE
${
OTB_DATA_ROOT
}
/Baseline/OTB/Images
)
set
(
BASELINE_FILES
${
OTB_DATA_ROOT
}
/Baseline/OTB/Files
)
set
(
INPUTDATA
${
OTB_DATA_ROOT
}
/Input
)
set
(
TEMP
${
OTB_BINARY_DIR
}
/Testing/Temporary
)
set
(
EXAMPLEDATA
${
OTB_DATA_ROOT
}
/Examples
)
set
(
OTBAPP_BASELINE
${
OTB_DATA_ROOT
}
/Baseline/OTB-Applications/Images
)
set
(
OTBAPP_BASELINE_FILES
${
OTB_DATA_ROOT
}
/Baseline/OTB-Applications/Files
)
set
(
NOTOL 0.0
)
set
(
EPSILON_1 0.1
)
set
(
EPSILON_2 0.01
)
set
(
EPSILON_3 0.001
)
set
(
EPSILON_4 0.0001
)
set
(
EPSILON_5 0.00001
)
set
(
EPSILON_6 0.000001
)
set
(
EPSILON_7 0.0000001
)
set
(
EPSILON_8 0.00000001
)
set
(
EPSILON_9 0.000000001
)
set
(
EPSILON_10 0.0000000001
)
set
(
EPSILON_11 0.00000000001
)
set
(
EPSILON_12 0.000000000001
)
set
(
EPSILON_13 0.0000000000001
)
set
(
EPSILON_14 0.00000000000001
)
set
(
EPSILON_15 0.000000000000001
)
#-----------------------------------------------------------------------------
# OTB wrapper for add_test that automatically sets the test's LABELS property
# to the value of its containing module.
#
function
(
otb_add_test
)
set
(
largeinput_regex
"LARGEINPUT{([^;{}
\r\n
]*)}"
)
set
(
_depends_on_largeinput OFF
)
foreach
(
arg IN LISTS ARGN
)
if
(
"x
${
arg
}
"
MATCHES
"
${
largeinput_regex
}
"
)
string
(
REGEX REPLACE
"
${
largeinput_regex
}
"
"
\\
1"
largeinput_relative_path
"
${
arg
}
"
)
set
(
_fullpath
"
${
OTB_DATA_LARGEINPUT_ROOT
}
/
${
largeinput_relative_path
}
"
)
list
(
APPEND _out_arg
${
_fullpath
}
)
set
(
_depends_on_largeinput ON
)
else
()
list
(
APPEND _out_arg
${
arg
}
)
endif
()
endforeach
()
if
(
_depends_on_largeinput AND NOT OTB_DATA_USE_LARGEINPUT
)
return
()
endif
()
add_test
(
${
_out_arg
}
)
if
(
"NAME"
STREQUAL
"
${
ARGV0
}
"
)
set
(
_iat_testname
${
ARGV1
}
)
else
()
set
(
_iat_testname
${
ARGV0
}
)
endif
()
if
(
otb-module
)
set
(
_label
${
otb-module
}
)
else
()
set
(
_label
${
main_project_name
}
)
endif
()
set_property
(
TEST
${
_iat_testname
}
PROPERTY LABELS
${
_label
}
)
endfunction
()
########################## end copied from OTB/CMakeLists.txt ##########################
if
(
OTBApplicationEngine_LOADED
)
add_subdirectory
(
Application
)
endif
()
add_subdirectory
(
BasicFilters
)
...
...
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