forked from janelia-flyem/buildem
-
Notifications
You must be signed in to change notification settings - Fork 1
/
opengm.cmake
59 lines (48 loc) · 1.79 KB
/
opengm.cmake
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
#
# Install opengm libraries from source
#
if (NOT opengm_NAME)
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
include (ExternalProject)
include (ExternalSource)
include (BuildSupport)
include (PatchSupport)
include (boost)
include (hdf5)
include (python)
external_git_repo (opengm
576dc472324a5dce40b7e9bb4c270afbd9b3da37
https://github.com/opengm/opengm)
if(CPLEX_ROOT_DIR)
set(CMAKE_CPLEX_ROOT_DIR "-DCPLEX_ROOT_DIR=${CPLEX_ROOT_DIR}")
set(WITH_CPLEX ON)
else()
set(WITH_CPLEX OFF)
endif()
message ("Installing ${opengm_NAME} into FlyEM build area: ${BUILDEM_DIR} ...")
ExternalProject_Add(${opengm_NAME}
DEPENDS ${boost_NAME} ${hdf5_NAME} ${python_NAME}
PREFIX ${BUILDEM_DIR}
GIT_REPOSITORY ${opengm_URL}
GIT_TAG ${opengm_TAG}
UPDATE_COMMAND ""
# This patch adds the BUILD_PYTHON_DOCS setting, used to avoid building the sphinx documentation.
# Future versions of OpenGM will probably not need this patch.
PATCH_COMMAND ${BUILDEM_ENV_STRING} ${PATCH_EXE}
${opengm_SRC_DIR}/src/interfaces/python/CMakeLists.txt ${PATCH_DIR}/opengm.patch
CONFIGURE_COMMAND ${BUILDEM_ENV_STRING} ${CMAKE_COMMAND} ${opengm_SRC_DIR}
-DCMAKE_INSTALL_PREFIX=${BUILDEM_DIR}
-DCMAKE_PREFIX_PATH=${BUILDEM_DIR}
-DWITH_CPLEX=${WITH_CPLEX}
-DWITH_BOOST=ON
-DWITH_HDF5=ON
-DBUILD_PYTHON_WRAPPER=ON
-DBUILD_PYTHON_DOCS=OFF
-DWITH_OPENMP=OFF # Mac doesn't support OpenMP
${CMAKE_CPLEX_ROOT_DIR}
BUILD_COMMAND ${BUILDEM_ENV_STRING} $(MAKE)
INSTALL_COMMAND ${BUILDEM_ENV_STRING} $(MAKE) install
TEST_COMMAND ${BUILDEM_ENV_STRING} $(MAKE) test
)
set_target_properties(${opengm_NAME} PROPERTIES EXCLUDE_FROM_ALL ON)
endif (NOT opengm_NAME)