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
35 set(UNRES_CLUSTER_PP_SRC
43 #================================================
44 # Set comipiler flags for different sourcefiles
45 #================================================
46 if (Fortran_COMPILER_NAME STREQUAL "ifort")
47 set(FFLAGS0 "-ip -w -I." )
48 elseif (Fortran_COMPILER_NAME STREQUAL "gfortran")
49 set(FFLAGS0 "-std=legacy -I. " )
50 endif (Fortran_COMPILER_NAME STREQUAL "ifort")
53 set_property(SOURCE ${UNRES_CLUSTER_SRC0} PROPERTY COMPILE_FLAGS ${FFLAGS0} )
56 #=========================================
57 # System specific flags
58 #=========================================
59 if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
60 set(CPPFLAGS "${CPPFLAGS} LINUX")
61 endif(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
65 #=========================================
66 # Apply preprocesor flags to *.F files
67 #=========================================
68 set_property(SOURCE ${UNRES_CLUSTER_PP_SRC} PROPERTY COMPILE_DEFINITIONS ${CPPFLAGS} )
71 #========================================
73 #========================================
74 set(UNRES_CLUSTER_BIN "cluster_unres_${Fortran_COMPILER_NAME}.exe")
76 #=========================================
77 # Set full unres CLUSTER sources
78 #=========================================
79 set(UNRES_CLUSTER_SRCS ${UNRES_CLUSTER_UNRES_SRC0} )
81 #=========================================
83 #=========================================
84 add_executable(UNRES_CLUSTER_BIN ${UNRES_CLUSTER_SRCS} )
85 set_target_properties(UNRES_CLUSTER_BIN PROPERTIES OUTPUT_NAME ${UNRES_CLUSTER_BIN})
86 set_property(TARGET UNRES_CLUSTER_BIN PROPERTY RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin )
89 #=========================================
91 #=========================================
92 install(TARGETS UNRES_CLUSTER_BIN DESTINATION ${CMAKE_INSTALL_PREFIX}/cluster)