CMakeLists.txt 1.15 KB
Newer Older
Ken Leiter (Civ's avatar
Ken Leiter (Civ committed
1
2
3
4
5
6
7
8
9
project(Xdmf2)
cmake_minimum_required(VERSION 2.6)

include_directories(${CMAKE_CURRENT_SOURCE_DIR})

set(BUILD_SHARED_LIBS true)

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

14
15
16
17
18
19
20
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
21
22

set(XdmfSources
23
	XdmfAttribute
24
	XdmfAttributeCenter
25
	XdmfAttributeType
26
	XdmfGeometry
27
	XdmfGeometryType
28
	XdmfGrid
29
	XdmfItem
30
31
	XdmfObject
	XdmfTopology
32
	XdmfTopologyType
33
	XdmfVisitor
Ken Leiter (Civ's avatar
Ken Leiter (Civ committed
34
35
36
37
)

add_library(Xdmf ${XdmfSources})

38
39
40
41
42
43
44
45
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)
46
47

configure_file(Xdmf.py Xdmf.py COPYONLY)
48
49
50

option(BUILD_TESTING OFF)
if(BUILD_TESTING)
51
	enable_testing()
52
53
54
	add_subdirectory(tests)
	add_executable(XdmfTest test.cpp)
	target_link_libraries(XdmfTest Xdmf)
55
endif(BUILD_TESTING)