# # CMake project file for cluster analysis from UNRESMD # enable_language (Fortran) #================================ # Set source file lists #================================ set(UNRES_CLUSTER_UNRES_SRC0 arcos.f cartprint.f chainbuild.f contact.f convert.f fitsq.f geomout.F hc.f initialize.f intcor.f main_clust.f matmult.f misc.f noyes.f pinorm.f readpdb.f readrtns.F rescode.f srtclust.f timing.F track.F wrtclust.f ) set(UNRES_CLUSTER_PP_SRC geomout.F readrtns.F timing.F track.F ) #================================================ # Set comipiler flags for different sourcefiles #================================================ if (Fortran_COMPILER_NAME STREQUAL "ifort") set(FFLAGS0 "-ip -w -I." ) elseif (Fortran_COMPILER_NAME STREQUAL "gfortran") set(FFLAGS0 "-std=legacy -I. " ) endif (Fortran_COMPILER_NAME STREQUAL "ifort") set_property(SOURCE ${UNRES_CLUSTER_SRC0} PROPERTY COMPILE_FLAGS ${FFLAGS0} ) #========================================= # System specific flags #========================================= if(${CMAKE_SYSTEM_NAME} MATCHES "Linux") set(CPPFLAGS "${CPPFLAGS} LINUX") endif(${CMAKE_SYSTEM_NAME} MATCHES "Linux") #========================================= # Apply preprocesor flags to *.F files #========================================= set_property(SOURCE ${UNRES_CLUSTER_PP_SRC} PROPERTY COMPILE_DEFINITIONS ${CPPFLAGS} ) #======================================== # Setting binary name #======================================== set(UNRES_CLUSTER_BIN "cluster_unres_${Fortran_COMPILER_NAME}.exe") #========================================= # Set full unres CLUSTER sources #========================================= set(UNRES_CLUSTER_SRCS ${UNRES_CLUSTER_UNRES_SRC0} ) #========================================= # Build the binary #========================================= add_executable(UNRES_CLUSTER_BIN ${UNRES_CLUSTER_SRCS} ) set_target_properties(UNRES_CLUSTER_BIN PROPERTIES OUTPUT_NAME ${UNRES_CLUSTER_BIN}) set_property(TARGET UNRES_CLUSTER_BIN PROPERTY RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin ) #========================================= # Install Path #========================================= install(TARGETS UNRES_CLUSTER_BIN DESTINATION ${CMAKE_INSTALL_PREFIX}/cluster)