2 # CMake project file for cluster analysis from WHAM for oligomeric proteins
5 enable_language (Fortran C)
7 #================================
8 # Set source file lists
9 #================================
10 set(UNRES_CLUSTER_WHAM_M_SRC0
47 set(UNRES_CLUSTER_WHAM_M_PP_SRC
63 #================================================
64 # Set comipiler flags for different sourcefiles
65 #================================================
66 if (Fortran_COMPILER_NAME STREQUAL "ifort")
67 set(FFLAGS0 "-ip -w -I. -I${CMAKE_CURRENT_SOURCE_DIR}/include_unres" )
68 elseif (Fortran_COMPILER_NAME STREQUAL "gfortran")
69 set(FFLAGS0 "-std=legacy -I. -I${CMAKE_CURRENT_SOURCE_DIR}/include_unres" )
71 set(FFLAGS0 "-I. -I${CMAKE_CURRENT_SOURCE_DIR}/include_unres" )
72 endif (Fortran_COMPILER_NAME STREQUAL "ifort")
74 #=========================================
75 # Add MPI compiler flags
76 #=========================================
78 set(FFLAGS0 "${FFLAGS0} -I${MPI_Fortran_INCLUDE_PATH}")
81 set_property(SOURCE ${UNRES_CLUSTER_WHAM_M_SRC0} PROPERTY COMPILE_FLAGS ${FFLAGS0} )
83 #=========================================
84 # Settings for GAB force field
85 #=========================================
86 if(UNRES_MD_FF STREQUAL "GAB" )
87 # set preprocesor flags
88 set(CPPFLAGS "PROCOR -DSPLITELE -DCRYST_BOND -DCRYST_THETA -DCRYST_SC -DSCCORPDB" )
90 #=========================================
91 # Settings for E0LL2Y force field
92 #=========================================
93 elseif(UNRES_MD_FF STREQUAL "E0LL2Y")
94 # set preprocesor flags
95 set(CPPFLAGS "PROCOR -DSPLITELE -DSCCORPDB" )
96 endif(UNRES_MD_FF STREQUAL "GAB")
98 #=========================================
100 #=========================================
101 set(CPPFLAGS "${CPPFLAGS} -DUNRES -DISNAN")
103 #=========================================
104 # Compiler specific flags
105 #=========================================
106 if (Fortran_COMPILER_NAME STREQUAL "ifort")
107 # Add ifort preprocessor flags
108 set(CPPFLAGS "${CPPFLAGS} -DPGI")
109 elseif (Fortran_COMPILER_NAME STREQUAL "f95")
110 # Add new gfortran flags
111 set(CPPFLAGS "${CPPFLAGS} -DG77")
112 elseif (Fortran_COMPILER_NAME STREQUAL "gfortran")
113 # Add old gfortran flags
114 set(CPPFLAGS "${CPPFLAGS} -DG77")
115 endif (Fortran_COMPILER_NAME STREQUAL "ifort")
118 #=========================================
119 # System specific flags
120 #=========================================
121 if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
122 set(CPPFLAGS "${CPPFLAGS} -DLINUX")
123 endif(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
125 #=========================================
126 # Add MPI preprocessor flags
127 #=========================================
129 set(CPPFLAGS "${CPPFLAGS} -DMP -DMPI")
130 endif(UNRES_WITH_MPI)
133 #=========================================
134 # Apply preprocesor flags to *.F files
135 #=========================================
136 set_property(SOURCE ${UNRES_CLUSTER_WHAM_M_PP_SRC} PROPERTY COMPILE_DEFINITIONS ${CPPFLAGS} )
138 set_property(SOURCE proc_proc.c PROPERTY COMPILE_DEFINITIONS "LINUX -DPGI" )
140 #========================================
141 # Setting binary name
142 #========================================
143 set(UNRES_CLUSTER_WHAM_M_BIN
144 "cluster_wham-M_${Fortran_COMPILER_NAME}_${UNRES_MD_FF}.exe")
146 #=========================================
147 # Set full unres CLUSTER sources
148 #=========================================
149 set(UNRES_CLUSTER_WHAM_M_SRCS ${UNRES_CLUSTER_WHAM_M_SRC0} proc_proc.c)
151 #=========================================
153 #=========================================
154 add_executable(UNRES_CLUSTER_WHAM_M_BIN ${UNRES_CLUSTER_WHAM_M_SRCS} )
155 set_target_properties(UNRES_CLUSTER_WHAM_M_BIN PROPERTIES OUTPUT_NAME ${UNRES_CLUSTER_WHAM_M_BIN})
156 set_property(TARGET UNRES_CLUSTER_WHAM_M_BIN PROPERTY RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin )
158 #=========================================
160 #=========================================
163 target_link_libraries( UNRES_CLUSTER_WHAM_M_BIN ${MPI_Fortran_LIBRARIES} )
164 endif(UNRES_WITH_MPI)
166 target_link_libraries( UNRES_CLUSTER_WHAM_M_BIN xdrf )
169 #=========================================
171 #=========================================
172 install(TARGETS UNRES_CLUSTER_WHAM_M_BIN DESTINATION ${CMAKE_INSTALL_PREFIX}/cluster)