2014-09-18 19:12:50 +00:00
|
|
|
|
2014-10-09 19:06:36 +00:00
|
|
|
# define build type
|
|
|
|
IF( DEFINED CMAKE_BUILD_TYPE )
|
|
|
|
SET( CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE} CACHE STRING "Set to either \"Release\" or \"Debug\"" )
|
|
|
|
ELSE()
|
|
|
|
SET( CMAKE_BUILD_TYPE Release CACHE STRING "Set to either \"Release\" or \"Debug\"" )
|
|
|
|
ENDIF()
|
|
|
|
|
2014-09-18 19:12:50 +00:00
|
|
|
PROJECT(nf2ff CXX)
|
|
|
|
cmake_minimum_required(VERSION 2.8)
|
|
|
|
|
2015-12-30 13:18:45 +00:00
|
|
|
set(LIB_VERSION_MAJOR 0)
|
|
|
|
set(LIB_VERSION_MINOR 1)
|
|
|
|
set(LIB_VERSION_PATCH 0)
|
|
|
|
set(LIB_VERSION_STRING ${LIB_VERSION_MAJOR}.${LIB_VERSION_MINOR}.${LIB_VERSION_PATCH})
|
|
|
|
|
|
|
|
set(VERSION "v${LIB_VERSION_STRING}")
|
|
|
|
|
2014-09-18 19:12:50 +00:00
|
|
|
set(SOURCES
|
2015-12-19 14:01:56 +00:00
|
|
|
nf2ff.cpp
|
|
|
|
nf2ff_calc.cpp
|
|
|
|
../tools/array_ops.cpp
|
|
|
|
../tools/useful.cpp
|
|
|
|
../tools/hdf5_file_reader.cpp
|
|
|
|
../tools/hdf5_file_writer.cpp
|
2014-09-18 19:12:50 +00:00
|
|
|
)
|
|
|
|
|
2015-12-19 14:01:56 +00:00
|
|
|
#ADD_SUBDIRECTORY( ../tools )
|
2014-09-18 19:12:50 +00:00
|
|
|
set(HEADERS
|
|
|
|
nf2ff.h
|
|
|
|
nf2ff_calc.h
|
|
|
|
)
|
|
|
|
|
2015-12-30 13:18:45 +00:00
|
|
|
add_library( nf2ff SHARED ${SOURCES})
|
|
|
|
set_target_properties(nf2ff PROPERTIES VERSION ${LIB_VERSION_STRING} SOVERSION ${LIB_VERSION_MAJOR})
|
2014-09-18 19:12:50 +00:00
|
|
|
|
|
|
|
TARGET_LINK_LIBRARIES( nf2ff
|
|
|
|
tinyxml
|
2015-05-19 20:13:28 +00:00
|
|
|
${HDF5_LIBRARIES}
|
2014-09-18 19:12:50 +00:00
|
|
|
${Boost_LIBRARIES}
|
2016-08-26 09:59:29 +00:00
|
|
|
${MPI_LIBRARIES}
|
2014-09-18 19:12:50 +00:00
|
|
|
)
|
|
|
|
|
2015-12-30 13:18:45 +00:00
|
|
|
ADD_EXECUTABLE( nf2ff_bin main.cpp )
|
|
|
|
SET_TARGET_PROPERTIES(nf2ff_bin PROPERTIES OUTPUT_NAME nf2ff)
|
|
|
|
TARGET_LINK_LIBRARIES(nf2ff_bin nf2ff)
|
|
|
|
|
|
|
|
INSTALL(TARGETS nf2ff_bin DESTINATION bin)
|
|
|
|
INSTALL(TARGETS nf2ff DESTINATION lib${LIB_SUFFIX})
|
2014-09-18 19:12:50 +00:00
|
|
|
|
2016-08-17 21:50:26 +00:00
|
|
|
INSTALL(FILES ${HEADERS} DESTINATION include/openEMS)
|
|
|
|
|
2014-09-18 19:12:50 +00:00
|
|
|
|
|
|
|
#TODO tarball, debug, release
|