-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
69 lines (56 loc) · 3.62 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
cmake_minimum_required( VERSION 3.10 )
find_package( brainvisa-cmake REQUIRED )
BRAINVISA_PROJECT()
enable_testing()
BRAINVISA_FIND_PACKAGE( capsul REQUIRED )
BRAINVISA_FIND_PACKAGE( aims-free REQUIRED )
BRAINVISA_FIND_PACKAGE( sulci-nonfree )
BRAINVISA_FIND_PACKAGE( axon QUIET )
BRAINVISA_FIND_PACKAGE( morphologist-gpl QUIET )
BRAINVISA_DEPENDENCY( RUN DEPENDS "capsul" RUN
">= ${capsul_VERSION_MAJOR}.${capsul_VERSION_MINOR}" )
BRAINVISA_DEPENDENCY( RUN DEPENDS "aims-free" RUN
">= ${aims-free_VERSION_MAJOR}.${aims-free_VERSION_MINOR}" )
BRAINVISA_DEPENDENCY( RUN DEPENDS "sulci-nonfree" RUN
">= ${sulci-nonfree_VERSION_MAJOR}.${sulci-nonfree_VERSION_MINOR}" )
BRAINVISA_DEPENDENCY( RUN DEPENDS "python-numpy" RUN )
BRAINVISA_DEPENDENCY( RUN DEPENDS "python-pandas" RUN )
BRAINVISA_DEPENDENCY( RUN DEPENDS "python-torch" RUN )
BRAINVISA_DEPENDENCY( RUN DEPENDS "python-scikit-learn" RUN )
BRAINVISA_DEPENDENCY( RUN RECOMMENDS "axon" RUN
">= ${axon_VERSION_MAJOR}.${axon_VERSION_MINOR}" )
BRAINVISA_DEPENDENCY( RUN RECOMMENDS "morphologist-gpl" RUN
">= ${morphologist-gpl_VERSION_MAJOR}.${morphologist-gpl_VERSION_MINOR}" )
BRAINVISA_DEPENDENCY( DEV DEPENDS "${PROJECT_NAME}" RUN "= ${${PROJECT_NAME}_VERSION}" )
BRAINVISA_COPY_PYTHON_DIRECTORY( "${CMAKE_CURRENT_SOURCE_DIR}/brainvisa"
${PROJECT_NAME} )
BRAINVISA_COPY_PYTHON_DIRECTORY( "${CMAKE_CURRENT_SOURCE_DIR}/python"
${PROJECT_NAME} )
BRAINVISA_COPY_DIRECTORY( "${CMAKE_CURRENT_SOURCE_DIR}/share/foms"
share/foms
${PROJECT_NAME} )
# BRAINVISA_COPY_DIRECTORY(
# "${CMAKE_CURRENT_SOURCE_DIR}/share/models"
# share/brainvisa-share-${brainvisa-share_VERSION_MAJOR}.${brainvisa-share_VERSION_MINOR}/models
# ${PROJECT_NAME} )
set( MDS_MODEL_DOWNLOAD_SOURCE "https://brainvisa.info/download/data" CACHE STRING "URL for Morpho-DeepSulci models data download" )
set( get_models_cmd
"${CMAKE_CURRENT_SOURCE_DIR}/scripts/bv_get_morpho_deepsulci_models.py" )
add_custom_target( get-deepsulci-models ALL
COMMAND "${PYTHON_HOST_EXECUTABLE}" "${get_models_cmd}" "-o" "${CMAKE_BINARY_DIR}/share/brainvisa-share-${brainvisa-share_VERSION_MAJOR}.${brainvisa-share_VERSION_MINOR}/models" "-i" "${MDS_MODEL_DOWNLOAD_SOURCE}"
"--timeout" "5" "--silent" "--check"
)
add_custom_target( install-deepsulci-models
COMMAND "${CMAKE_COMMAND}" "-E" "copy_directory" "${CMAKE_BINARY_DIR}/share/brainvisa-share-${brainvisa-share_VERSION_MAJOR}.${brainvisa-share_VERSION_MINOR}/models/models_2019/cnn_models" "$(BRAINVISA_INSTALL_PREFIX)/share/brainvisa-share-${brainvisa-share_VERSION_MAJOR}.${brainvisa-share_VERSION_MINOR}/models/models_2019/cnn_models"
)
add_dependencies( install-morpho-deepsulci install-deepsulci-models )
# BRAINVISA_COPY_DIRECTORY( "${CMAKE_CURRENT_SOURCE_DIR}/doc"
# "share/doc/morphologist-${${PROJECT_NAME}_VERSION_MAJOR}.${${PROJECT_NAME}_VERSION_MINOR}"
# ${PROJECT_NAME}-usrdoc )
# brainvisa_add_test(morphologist-tests "${PYTHON_EXECUTABLE_NAME}" -m brainvisa.tests.test_morphologist --no-ann TESTREF)
# brainvisa_add_test(morphologist-test-capsul "${PYTHON_EXECUTABLE_NAME}" -m morphologist.tests.test_morphologist_capsul)
# set_tests_properties(morphologist-test-capsul PROPERTIES DEPENDS morphologist-tests)
find_package( Sphinx )
BRAINVISA_GENERATE_SPHINX_DOC( "sphinx"
"share/doc/morpho-deepsulci-${BRAINVISA_PACKAGE_VERSION_MAJOR}.${BRAINVISA_PACKAGE_VERSION_MINOR}/dev_doc" )
# BRAINVISA_CREATE_CMAKE_CONFIG_FILES()