xdrf2pdb Adam's PBC correction
[unres.git] / source / xdrfpdb / src-M / CMakeLists.txt
1 # Set of programs to convert UNRES xdrf format (compressed Cartesian coordinates) to PDF
2 # or raw-Cartesian format (*.x) or to extract backbone angular coordinates (*.ang)
3 # The pdb files can be constructed from canonical or MREMD trajectories.
4 #
5 # The xdrf library is required
6 #
7 # Programs
8 #
9 # xdrf2pdb   : converts a single cx trajectory file to PDB format
10 # xdrf2x     : converts a single cx trajectory file to raw-coordinate (x) format
11 # xdrf2ang   : extracts backbone angles from a cx trajectory file
12 # xdrf2pdb-m : converts a selected trajectory of a MREMD run dumpend into a cx file to PDB format
13 #
14 # removed xdrf2pdb1  : converts conformation(s) selected from a wham post-processing run into PDB format
15 # removed xdrf2x1    : converts conformation(s) selected from a wham post-processing run into raw (x) format.
16 #
17 # 9/23/2010 A. Liwo
18 #
19 # CMake file by D. Jagie?a
20
21
22 set(UNRES_XDRF_XDRF2PDB_SRC-M
23         xdrf2pdb.F
24         geomout.F
25         misc.f
26         rescode.f
27         nazwy.f
28         seq2chains.f
29 )
30
31 set(UNRES_XDRF_XDRF2PDB-M_SRC-M
32         xdrf2pdb-m.F
33         geomout.F
34         misc.f
35         rescode.f
36         nazwy.f
37         seq2chains.f
38 )
39
40
41 set(UNRES_XDRF_PP_SRC-M
42         geomout.F
43         xdrf2pdb.F
44         xdrf2pdb-m.F
45         xdrf2x.F        
46 )
47
48 set(CPPFLAGS "PROCOR -DUNRES -DMP -DMPI -DSPLITELE -DNEWUNRES" )
49
50 #=========================================
51 # System specific flags
52 #=========================================
53 if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
54   set(CPPFLAGS "${CPPFLAGS} -DLINUX")
55 endif(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
56
57 # Apply preprocesor flags to *.F files
58 set_property(SOURCE ${UNRES_XDRF_PP_SRC-M} PROPERTY COMPILE_DEFINITIONS ${CPPFLAGS} )
59
60  
61 #=========================================
62 # Build the binaries
63 #=========================================
64 add_executable(UNRES_XDRF2PDB_BIN-M   ${UNRES_XDRF_XDRF2PDB_SRC-M} )
65 target_link_libraries(UNRES_XDRF2PDB_BIN-M xdrf )
66 set_target_properties(UNRES_XDRF2PDB_BIN-M PROPERTIES OUTPUT_NAME xdrf2pdb )
67 set_property(TARGET UNRES_XDRF2PDB_BIN-M PROPERTY RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin )
68
69 add_executable(UNRES_XDRF2PDBM_BIN-M ${UNRES_XDRF_XDRF2PDB-M_SRC-M} )
70 target_link_libraries( UNRES_XDRF2PDBM_BIN-M xdrf )
71 set_target_properties(UNRES_XDRF2PDBM_BIN-M PROPERTIES OUTPUT_NAME xdrf2pdb-m )
72 set_property(TARGET UNRES_XDRF2PDBM_BIN-M PROPERTY RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin )
73
74
75 #=========================================
76 # Install Path
77 #=========================================
78 install(TARGETS UNRES_XDRF2PDB_BIN-M DESTINATION ${CMAKE_INSTALL_PREFIX}/xdrfpdb)
79 install(TARGETS UNRES_XDRF2PDBM_BIN-M DESTINATION ${CMAKE_INSTALL_PREFIX}/xdrfpdb)
80
81
82 #=========================================
83 # TESTS
84 #=========================================
85
86
87 # Create files needed for tests
88
89 file(   COPY ${CMAKE_SOURCE_DIR}/ctest/ala10one.seq
90         DESTINATION ${CMAKE_CURRENT_BINARY_DIR} )
91
92 file(   COPY ${CMAKE_SOURCE_DIR}/ctest/ala10three.seq 
93         DESTINATION ${CMAKE_CURRENT_BINARY_DIR} )
94
95 file(   COPY ${CMAKE_SOURCE_DIR}/ctest/1L2Yone.seq
96         DESTINATION ${CMAKE_CURRENT_BINARY_DIR} )
97
98 file(   COPY ${CMAKE_SOURCE_DIR}/ctest/1L2Ythree.seq
99         DESTINATION ${CMAKE_CURRENT_BINARY_DIR} )
100
101 file(   COPY ${CMAKE_SOURCE_DIR}/ctest/ala10MD.cx 
102         DESTINATION ${CMAKE_CURRENT_BINARY_DIR} )
103
104 file(   COPY ${CMAKE_SOURCE_DIR}/ctest/1L2Y_MREMD_MD000.cx 
105         DESTINATION ${CMAKE_CURRENT_BINARY_DIR} )
106
107
108 # Test xdrf2pdb 
109 add_test(NAME XDRF2PDB-one   COMMAND ${CMAKE_BINARY_DIR}/bin/xdrf2pdb one ala10one.seq ala10MD.cx )
110 add_test(NAME XDRF2PDB-three COMMAND ${CMAKE_BINARY_DIR}/bin/xdrf2pdb three ala10three.seq ala10MD.cx )
111
112 # Test xdrf2pdb-m
113 add_test(NAME XDRF2PDB-M-one   COMMAND ${CMAKE_BINARY_DIR}/bin/xdrf2pdb-m one 1L2Yone.seq 1L2Y_MREMD_MD000.cx 32 30 )
114 add_test(NAME XDRF2PDB-M-three COMMAND ${CMAKE_BINARY_DIR}/bin/xdrf2pdb-m three 1L2Ythree.seq 1L2Y_MREMD_MD000.cx 32 30 )
115
116 # Test xdrf2ang
117 #add_test(NAME XDRF2ANG-one   COMMAND ${CMAKE_BINARY_DIR}/bin/xdrf2ang one ala10one.seq ala10MD.cx )
118 #add_test(NAME XDRF2ANG-three COMMAND ${CMAKE_BINARY_DIR}/bin/xdrf2ang three ala10three.seq ala10MD.cx )
119
120
121