2 # CMake project file for cluster analysis from UNRESMD
5 enable_language (Fortran)
7 #================================
8 # Set source file lists
9 #================================
10 set(UNRES_CLUSTER_UNRES_SRC0
36 set(UNRES_CLUSTER_PP_SRC
44 #================================================
45 # Set comipiler flags for different sourcefiles
46 #================================================
47 if (Fortran_COMPILER_NAME STREQUAL "ifort")
48 set(FFLAGS0 "-ip -w -I." )
49 elseif (Fortran_COMPILER_NAME STREQUAL "gfortran")
50 set(FFLAGS0 "-std=legacy -I. " )
51 endif (Fortran_COMPILER_NAME STREQUAL "ifort")
54 set_property(SOURCE ${UNRES_CLUSTER_SRC0} PROPERTY COMPILE_FLAGS ${FFLAGS0} )
57 #=========================================
58 # System specific flags
59 #=========================================
60 set(CPPFLAGS "NEWUNRES")
61 if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
62 set(CPPFLAGS "${CPPFLAGS} -DLINUX")
63 endif(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
67 #=========================================
68 # Apply preprocesor flags to *.F files
69 #=========================================
70 set_property(SOURCE ${UNRES_CLUSTER_PP_SRC} PROPERTY COMPILE_DEFINITIONS ${CPPFLAGS} )
73 #========================================
75 #========================================
76 set(UNRES_CLUSTER_BIN "cluster_unres_${Fortran_COMPILER_NAME}.exe")
78 #=========================================
79 # Set full unres CLUSTER sources
80 #=========================================
81 set(UNRES_CLUSTER_SRCS ${UNRES_CLUSTER_UNRES_SRC0} )
83 #=========================================
85 #=========================================
86 add_executable(UNRES_CLUSTER_BIN ${UNRES_CLUSTER_SRCS} )
87 set_target_properties(UNRES_CLUSTER_BIN PROPERTIES OUTPUT_NAME ${UNRES_CLUSTER_BIN})
88 set_property(TARGET UNRES_CLUSTER_BIN PROPERTY RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin )
90 #=========================================
92 #=========================================
94 target_link_libraries( UNRES_CLUSTER_BIN xdrf )
97 #=========================================
99 #=========================================
100 install(TARGETS UNRES_CLUSTER_BIN DESTINATION ${CMAKE_INSTALL_PREFIX})