CMakeLists.txt 1.85 KB
Newer Older
Ken Leiter (Civ's avatar
Ken Leiter (Civ committed
1
2
3
project(Xdmf2)
cmake_minimum_required(VERSION 2.6)

Ken Leiter (Civ ARL/CISD) kleiter's avatar
ENH:  
Ken Leiter (Civ ARL/CISD) kleiter committed
4
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/CMake ${CMAKE_MODULE_PATH})
Ken Leiter (Civ's avatar
Ken Leiter (Civ committed
5
6
7
8
9
10
include_directories(${CMAKE_CURRENT_SOURCE_DIR})

set(BUILD_SHARED_LIBS true)

find_package(Boost REQUIRED)
if(Boost_FOUND)
11
	include_directories(${Boost_INCLUDE_DIRS})
Ken Leiter (Civ's avatar
Ken Leiter (Civ committed
12
13
endif(Boost_FOUND)

14
15
16
17
18
find_package(HDF5 REQUIRED)
if(HDF5_FOUND)
	include_directories(${HDF5_INCLUDE_DIR})
endif(HDF5_FOUND)

19
20
find_package(LibXml2 REQUIRED)
if(LIBXML2_FOUND)
21
	include_directories(${LIBXML2_INCLUDE_DIR})
22
23
endif(LIBXML2_FOUND)

24
option(XDMF_WRAP_PYTHON OFF)
25
if(XDMF_WRAP_PYTHON)
26
27
	find_package(SWIG REQUIRED)
	include(${SWIG_USE_FILE})
28
	find_package(PythonLibs REQUIRED)
29
30
31
32
	include_directories(${PYTHON_INCLUDE_DIRS})
	set_source_files_properties(Xdmf.i PROPERTIES CPLUSPLUS ON)
	swig_add_module(Xdmf python Xdmf.i)
	swig_link_libraries(Xdmf Xdmf ${PYTHON_LIBRARIES})
33
endif(XDMF_WRAP_PYTHON)
Ken Leiter (Civ's avatar
Ken Leiter (Civ committed
34

35
set(XdmfCoreSources
Ken Leiter (Civ ARL/CISD) kleiter's avatar
ENH:  
Ken Leiter (Civ ARL/CISD) kleiter committed
36
	XdmfArray
37
	XdmfArrayType
38
39
40
41
42
43
44
45
46
47
48
49
50
	XdmfCoreItemFactory
	XdmfCoreReader
	XdmfDataItem
	XdmfHDF5Controller
	XdmfHDF5Writer
	XdmfItem
	XdmfItemProperty
	XdmfObject
	XdmfVisitor
	XdmfWriter
)

set(XdmfSources
51
	XdmfAttribute
52
	XdmfAttributeCenter
53
	XdmfAttributeType
54
	XdmfDomain
55
	XdmfGeometry
56
	XdmfGeometryType
57
	XdmfGrid
58
59
	XdmfGridCollection
	XdmfGridCollectionType
60
	XdmfItemFactory
61
	XdmfReader
62
63
	XdmfSet
	XdmfSetType
64
	XdmfTopology
65
	XdmfTopologyType
Ken Leiter (Civ's avatar
Ken Leiter (Civ committed
66
67
)

68
69
add_library(XdmfCore ${XdmfCoreSources})
target_link_libraries(XdmfCore ${HDF5_LIBRARIES} ${LIBXML2_LIBRARIES})
Ken Leiter (Civ's avatar
Ken Leiter (Civ committed
70
add_library(Xdmf ${XdmfSources})
71
target_link_libraries(Xdmf XdmfCore)
Ken Leiter (Civ's avatar
Ken Leiter (Civ committed
72

73
74
option(XDMF_BUILD_DOCUMENTATION OFF)
if(XDMF_BUILD_DOCUMENTATION)
75
	add_subdirectory(doc)
76
endif(XDMF_BUILD_DOCUMENTATION)
77

78
79
option(XDMF_BUILD_TESTING OFF)
if(XDMF_BUILD_TESTING)
80
	enable_testing()
81
	include(CTest)
82
	add_subdirectory(tests)
83
endif(XDMF_BUILD_TESTING)
84

85
86
option(XDMF_BUILD_UTILS OFF)
if(XDMF_BUILD_UTILS)
87
  add_subdirectory(utils)
88
endif(XDMF_BUILD_UTILS)