CMakeLists.txt 1.57 KB
Newer Older
1
2
3
4
5
project(XdmfCore)
cmake_minimum_required(VERSION 2.6)

set(BUILD_SHARED_LIBS true)
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
6
7
8
9
SET(CMAKE_SKIP_BUILD_RPATH  FALSE)
SET(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE) 
SET(CMAKE_INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/lib)
SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/CMake)

find_package(Boost REQUIRED)
if(Boost_FOUND)
	include_directories(${Boost_INCLUDE_DIRS})
endif(Boost_FOUND)

find_package(HDF5 REQUIRED)
if(HDF5_FOUND)
	include_directories(${HDF5_INCLUDE_DIR})	
endif(HDF5_FOUND)

find_package(LibXml2 REQUIRED)
if(LIBXML2_FOUND)
	include_directories(${LIBXML2_INCLUDE_DIR})
endif(LIBXML2_FOUND)

set(XdmfCoreSources
	XdmfArray
	XdmfArrayType
	XdmfCoreItemFactory
	XdmfCoreReader
	XdmfHDF5Controller
	XdmfHDF5Writer
34
	XdmfInformation
35
36
	XdmfItem
	XdmfItemProperty
37
	XdmfSystemUtils
38
	XdmfVisitor
39
	XdmfWriter
40
41
42
43
44
)

add_library(XdmfCore ${XdmfCoreSources})
target_link_libraries(XdmfCore ${HDF5_LIBRARIES} ${LIBXML2_LIBRARIES})

45
if(XDMF_WRAP_JAVA)
46
	XDMF_SWIG_JAVA(XdmfCore)
47
48
49
	set(XDMF_CORE_JAVA_JAR ${CMAKE_BINARY_DIR}/XdmfCore.jar CACHE INTERNAL "")
endif(XDMF_WRAP_JAVA)

50
if(XDMF_WRAP_PYTHON)
51
	XDMF_SWIG_PYTHON(XdmfCore)
52
53
endif(XDMF_WRAP_PYTHON)

54
55
56
57
file(GLOB XdmfCoreHeaders *.hpp)
install(FILES ${XdmfCoreHeaders} DESTINATION include)
install(TARGETS XdmfCore LIBRARY DESTINATION lib)

58
set(XdmfCore_INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${CMAKE_CURRENT_SOURCE_DIR} ${HDF5_INCLUDE_DIR} ${LIBXML2_INCLUDE_DIR} ${PYTHON_INCLUDE_DIRS} CACHE INTERNAL "")
59
60
61
62

if(XDMF_BUILD_TESTING)
	add_subdirectory(tests)
endif(XDMF_BUILD_TESTING)