389c3d192b37db055d8b4ce75310a45c12af6748
[unres.git] / source / cluster / unres / src / CMakeLists.txt
1 #
2 # CMake project file for cluster analysis from UNRESMD  
3
4
5 enable_language (Fortran)
6
7 #================================
8 # Set source file lists
9 #================================
10 set(UNRES_CLUSTER_UNRES_SRC0 
11         arcos.f
12         cartprint.f
13         chainbuild.f
14         contact.f
15         convert.f
16         fitsq.f
17         geomout.F
18         hc.f
19         initialize.f
20         intcor.f
21         main_clust.f
22         matmult.f
23         misc.f
24         noyes.f
25         pinorm.f
26         readpdb.f
27         readrtns.F
28         rescode.f
29         srtclust.f
30         timing.F
31         track.F
32         wrtclust.f
33 )
34
35 set(UNRES_CLUSTER_PP_SRC
36         geomout.F
37         readrtns.F
38         timing.F
39         track.F
40
41
42
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")
51
52
53 set_property(SOURCE ${UNRES_CLUSTER_SRC0} PROPERTY COMPILE_FLAGS ${FFLAGS0} )
54
55
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")
62
63
64
65 #=========================================
66 # Apply preprocesor flags to *.F files
67 #=========================================
68 set_property(SOURCE ${UNRES_CLUSTER_PP_SRC} PROPERTY COMPILE_DEFINITIONS ${CPPFLAGS} )  
69
70
71 #========================================
72 #  Setting binary name
73 #========================================
74 set(UNRES_CLUSTER_BIN "cluster_unres_${Fortran_COMPILER_NAME}.exe")
75
76 #=========================================
77 # Set full unres CLUSTER sources
78 #=========================================
79 set(UNRES_CLUSTER_SRCS ${UNRES_CLUSTER_UNRES_SRC0} )
80
81 #=========================================
82 # Build the binary
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 )
87
88
89 #=========================================
90 # Install Path
91 #=========================================
92 install(TARGETS UNRES_CLUSTER_BIN DESTINATION ${CMAKE_INSTALL_PREFIX})
93