CMakeLists.txt 1.47 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
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(XdmfSources
Ken Leiter (Civ ARL/CISD) kleiter's avatar
Ken Leiter (Civ ARL/CISD) kleiter committed
36
	XdmfArray
37
	XdmfAttribute
38
	XdmfAttributeCenter
39
	XdmfAttributeType
40
	XdmfDataItem
41
	XdmfDomain
42
	XdmfGeometry
43
	XdmfGeometryType
44
	XdmfGrid
45
	XdmfHDF5Controller
46
	XdmfHDF5Writer
47
	XdmfItem
48
	XdmfItemProperty
49 50
	XdmfObject
	XdmfTopology
51
	XdmfTopologyType
52
	XdmfVisitor
53
	XdmfWriter
Ken Leiter (Civ's avatar
Ken Leiter (Civ committed
54 55 56
)

add_library(Xdmf ${XdmfSources})
57
target_link_libraries(Xdmf ${HDF5_LIBRARIES} ${LIBXML2_LIBRARIES})
Ken Leiter (Civ's avatar
Ken Leiter (Civ committed
58

59 60 61 62 63
option(BUILD_DOCUMENTATION OFF)
if(BUILD_DOCUMENTATION)
	add_subdirectory(doc)
endif(BUILD_DOCUMENTATION)

64 65
option(BUILD_TESTING OFF)
if(BUILD_TESTING)
66
	enable_testing()
67
	include(CTest)
68
	add_subdirectory(tests)
69
endif(BUILD_TESTING)