CMakeLists.txt 1.04 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 24
	XdmfGeometry
	XdmfGrid
25
	XdmfItem
26 27
	XdmfObject
	XdmfTopology
28
	XdmfVisitor
Ken Leiter (Civ's avatar
Ken Leiter (Civ committed
29 30 31 32
)

add_library(Xdmf ${XdmfSources})

33 34 35 36 37 38 39 40
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)
41 42

configure_file(Xdmf.py Xdmf.py COPYONLY)
43 44 45 46 47 48

option(BUILD_TESTING OFF)
if(BUILD_TESTING)
	add_subdirectory(tests)
	add_executable(XdmfTest test.cpp)
	target_link_libraries(XdmfTest Xdmf)
49
endif(BUILD_TESTING)