CMakeLists.txt 1.55 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 21 22 23
find_package(LibXml2 REQUIRED)
if(LIBXML2_FOUND)
  include_directories(${LIBXML2_INCLUDE_DIR})
endif(LIBXML2_FOUND)

24 25 26 27 28 29 30
option(XDMF_WRAP_PYTHON ON)
if(XDMF_WRAP_PYTHON)
	find_package(PythonLibs REQUIRED)
	if(PYTHONLIBS_FOUND)
		include_directories(${PYTHON_INCLUDE_DIRS})
	endif(PYTHONLIBS_FOUND)
endif(XDMF_WRAP_PYTHON)
Ken Leiter (Civ's avatar
Ken Leiter (Civ committed
31 32

set(XdmfSources
Ken Leiter (Civ ARL/CISD) kleiter's avatar
ENH:  
Ken Leiter (Civ ARL/CISD) kleiter committed
33
	XdmfArray
34
	XdmfAttribute
35
	XdmfAttributeCenter
36
	XdmfAttributeType
37
	XdmfDataItem
Ken Leiter (Civ ARL/CISD) kleiter's avatar
ENH:  
Ken Leiter (Civ ARL/CISD) kleiter committed
38
  XdmfDomain
39
	XdmfGeometry
40
	XdmfGeometryType
41
	XdmfGrid
42
	XdmfItem
43 44
	XdmfObject
	XdmfTopology
45
	XdmfTopologyType
46
	XdmfVisitor
Ken Leiter (Civ's avatar
Ken Leiter (Civ committed
47 48 49
)

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

52 53 54 55 56 57 58 59
if(XDMF_WRAP_PYTHON)
	add_library(_Xdmf MODULE XdmfPython)
	set_target_properties(_Xdmf PROPERTIES PREFIX "")
	target_link_libraries(_Xdmf Xdmf)
	if(WIN32 OR APPLE)
		target_link_libraries(_Xdmf ${PYTHON_LIBRARY})
	endif(WIN32 OR APPLE)
endif(XDMF_WRAP_PYTHON)
60 61

configure_file(Xdmf.py Xdmf.py COPYONLY)
62

63 64 65 66 67
option(BUILD_DOCUMENTATION OFF)
if(BUILD_DOCUMENTATION)
	add_subdirectory(doc)
endif(BUILD_DOCUMENTATION)

68 69
option(BUILD_TESTING OFF)
if(BUILD_TESTING)
70
	enable_testing()
71
	include(CTest)
72
	add_subdirectory(tests)
73
endif(BUILD_TESTING)