CMakeLists.txt 1.7 KB
Newer Older
1 2
cmake_minimum_required(VERSION 3.0)
project(FLEUR LANGUAGES Fortran)
Daniel Wortmann's avatar
Daniel Wortmann committed
3

4 5 6 7 8 9 10 11 12
#These options should be adjusted
option(JUDFT_USE_MPI "Compile with MPI, will also work in serial" OFF)
option(JUDFT_USE_HDF5 "Compile HDF5 tools" OFF)
option(JUDFT_USE_HDF5MPI "Is the HDF5 version able to do parallel IO" OFF)
option(JUDFT_USE_COLLECT "Collect usage data" ON)
option(JUDFT_USE_DEBUG "Set CPP_DEBUG when compiling code" OFF)
#In addition you might want to set
#set(JUDFT_LIBRARIES "-lsomething")
#set(JUFDT_COMPILEOPTS "-r8")
Daniel Wortmann's avatar
Daniel Wortmann committed
13 14


15
if (${JUDFT_USE_HDF5})
16
set(judft_HDF 
17 18 19 20 21 22 23 24
hdf_accessprp.F90
hdf_tools.F90
hdf_tools_attr.F90
hdf_tools_exists.F90
hdf_tools_misc.F90
hdf_tools_rw.F90
hdf_tools_rw_var.F90
hdf_tools_stride.F90)
25 26
else()
set(judft_HDF "")
27
endif()
28 29 30

add_library(juDFT STATIC
${judft_HDF} 
31 32 33 34 35 36 37 38 39 40 41
usage_data.F90
info.F90
init.F90
juDFT.F90
stop.F90
string.f90
time.F90
args.F90
sysinfo.F90
check_arguments.F90
xmlOutput.F90
42
)
43 44 45 46 47 48 49 50 51
if (JUDFT_USE_MPI) 
  target_compile_definitions(juDFT PUBLIC CPP_MPI)
endif()
if (JUDFT_USE_HDF5)
  target_compile_definitions(juDFT PUBLIC CPP_HDF)
  target_link_libraries(juDFT "hdf5;hdf5_fortran")
endif()
if (JUDFT_USE_HDF5MPI)
  target_compile_definitions(juDFT PUBLIC CPP_HDFMPI)
52
endif()
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69
if (JUDFT_USE_COLLECT)
  target_compile_definitions(juDFT PUBLIC CPP_ALLOW_USAGE_DATA)
endif()
if (JUDFT_USE_DEBUG)
  target_compile_definitions(juDFT PUBLIC CPP_DEBUG)
endif()

if (DEFINED JUDFT_LIBRARIES )
   target_link_libraries(juDFT ${JUDFT_LIBRARIES})
endif()

if (DEFINED JUDFT_COMPILEOPTS )
  target_compile_options(juDFT PUBLIC ${JUDFT_COMPILEOPTS})
endif()

#Set module directories
include_directories("${CMAKE_CURRENT_BINARY_DIR}/modules/juDFT")
Daniel Wortmann's avatar
Daniel Wortmann committed
70
set_target_properties(juDFT PROPERTIES Fortran_MODULE_DIRECTORY modules/juDFT)