2 # CMake project file for UNRES with Minimazation
5 enable_language (Fortran)
7 #================================
8 # Set source file lists
9 #================================
50 energy_p_new_barrier.F
66 energy_p_new_barrier.F
111 #================================================
112 # Set comipiler flags for different sourcefiles
113 #================================================
114 if (Fortran_COMPILER_NAME STREQUAL "ifort")
115 find_package (Threads)
116 set(FFLAGS0 "-g -ip -w" )
117 set(FFLAGS1 "-w -g -d2 -CA -CB" )
118 set(FFLAGS2 "-w -g -00 ")
119 set(FFLAGS3 "-g -w -ipo " )
120 elseif (Fortran_COMPILER_NAME STREQUAL "gfortran")
122 set(FFLAGS1 "-g -C" )
123 set(FFLAGS2 "-g -O0 ")
125 endif (Fortran_COMPILER_NAME STREQUAL "ifort")
128 set_property(SOURCE ${UNRES_MIN_SRC0} PROPERTY COMPILE_FLAGS ${FFLAGS0} )
129 set_property(SOURCE ${UNRES_MIN_SRC1} PROPERTY COMPILE_FLAGS ${FFLAGS1} )
130 set_property(SOURCE ${UNRES_MIN_SRC2} PROPERTY COMPILE_FLAGS ${FFLAGS2} )
131 set_property(SOURCE ${UNRES_MIM_SRC3} PROPERTY COMPILE_FLAGS ${FFLAGS3} )
133 # set preprocesor flags
134 set(CPPFLAGS "PROCOR -DLINUX -DISNAN -DSPLITELE -DLANG0" )
136 if (Fortran_COMPILER_NAME STREQUAL "ifort")
137 # Add ifort preprocessor flags
138 set(CPPFLAGS "${CPPFLAGS} -DPGI")
139 elseif (Fortran_COMPILER_NAME STREQUAL "f95")
141 set(CPPFLAGS "${CPPFLAGS} -DG77")
142 elseif (Fortran_COMPILER_NAME STREQUAL "gfortran")
144 set(CPPFLAGS "${CPPFLAGS} -DG77")
145 endif (Fortran_COMPILER_NAME STREQUAL "ifort")
148 # add 64-bit specific preprocessor flags
149 if (architektura STREQUAL "64")
150 set(CPPFLAGS "${CPPFLAGS} -DAMD64")
151 endif (architektura STREQUAL "64")
153 # Apply preprocesor flags to *.F files
154 set_property(SOURCE ${UNRES_MIN_PP_SRC} PROPERTY COMPILE_DEFINITIONS ${CPPFLAGS} )
158 #========================================
159 # Setting binary name
160 #========================================
161 set(UNRES_BIN "unres_min_${Fortran_COMPILER_NAME}.exe")
163 #set(UNRES_CINFO_DIR "${CMAKE_CURRENT_BINARY_DIR}" )
165 #=========================================
166 # Set full unres MIN sources
167 #=========================================
168 set(UNRES_MIN_SRCS ${UNRES_MIN_SRC0} ${UNRES_MIN_SRC1} ${UNRES_MIN_SRC2} ${UNRES_MIN_SRC3} cinfo.f )
170 #=========================================
172 #=========================================
173 add_executable(UNRES_BIN-MIN ${UNRES_MIN_SRCS} )
174 set_target_properties(UNRES_BIN-MIN PROPERTIES OUTPUT_NAME ${UNRES_BIN})
176 if (Fortran_COMPILER_NAME STREQUAL "ifort")
177 target_link_libraries (UNRES_BIN-MIN ${CMAKE_THREAD_LIBS_INIT})
178 endif (Fortran_COMPILER_NAME STREQUAL "ifort")
180 #set_property(TARGET ${UNRES_BIN} PROPERTY RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin/unres/MD )
182 #=========================================
184 #=========================================
186 #-- Copy all the data files from the test directory into the source directory
187 #SET(UNRES_TEST_FILES
191 #FOREACH (UNRES_TEST_FILE ${UNRES_TEST_FILES})
192 # SET (unres_test_dest "${CMAKE_CURRENT_BINARY_DIR}/${UNRES_TEST_FILE}")
193 # MESSAGE (STATUS " Copying ${UNRES_TEST_FILE} from ${CMAKE_SOURCE_DIR}/examples/unres/MD/ff_gab/${UNRES_TEST_FILE} to ${unres_test_dest}")
194 # ADD_CUSTOM_COMMAND (
195 # TARGET ${UNRES_BIN}
197 # COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/examples/unres/MD/ff_gab/${UNRES_TEST_FILE} ${unres_test_dest}
199 #ENDFOREACH (UNRES_TEST_FILE ${UNRES_TEST_FILES})
201 #=========================================
202 # Generate data test files
203 #=========================================
205 #if(NOT UNRES_WITH_MPI)
207 # add_test(NAME UNRES_MD_Ala10 COMMAND sh ${CMAKE_CURRENT_BINARY_DIR}/test_single_ala.sh )
209 #endif(NOT UNRES_WITH_MPI)