ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/OpenMD/branches/development/CMakeLists.txt
Revision: 1694
Committed: Thu Mar 15 23:51:48 2012 UTC (13 years, 4 months ago) by gezelter
Content type: text/plain
File size: 21849 byte(s)
Log Message:
Doing some work to simplify cmake build process

File Contents

# Content
1 # Top level cmake script for OpenMD.
2 project(OpenMD CXX)
3 cmake_minimum_required(VERSION 2.8.5)
4
5 SET(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules")
6
7 if (NOT CMAKE_BUILD_TYPE)
8 set(CMAKE_BUILD_TYPE "Release")
9 endif()
10
11 find_package(MPI)
12 if (NOT MPI_CXX_FOUND)
13 message(STATUS "========== OpenMD Parallel Information ==========")
14 message(STATUS )
15 message(STATUS "No MPI compiler found. Perhaps you want to set one explicitly?")
16 message(STATUS "To override the default compiler, set the environment variable")
17 message(STATUS " export CXX=/full/path/to/mpic++")
18 message(STATUS "in bash or ksh or sh. In csh or tcsh, use:")
19 message(STATUS " setenv CXX /full/path/to/mpic++")
20 message(STATUS "before running the cmake command.")
21 message(STATUS )
22 message(STATUS "=================================================")
23 endif()
24 IF ( MPI_CXX_FOUND )
25 INCLUDE_DIRECTORIES(${MPI_CXX_INCLUDE_PATH})
26 ENDIF()
27
28 include(CheckCXXCompilerFlag)
29 include(CheckIncludeFileCXX)
30 include(CheckCXXSymbolExists)
31
32 # OpenMD version number.
33 set (VERSION_MAJOR "2")
34 set (VERSION_MINOR "0")
35 set (VERSION_TINY "0")
36 option(SINGLE_PRECISION "Build Single precision (float) version" OFF)
37
38 IF(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
39 SET(CMAKE_INSTALL_PREFIX
40 "/usr/local/openmd" CACHE PATH "OpenMD install prefix" FORCE
41 )
42 ENDIF(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
43
44 # ---------- Setup output Directories -------------------------
45 SET (CMAKE_LIBRARY_OUTPUT_DIRECTORY
46 ${PROJECT_BINARY_DIR}/lib
47 CACHE PATH
48 "Single directory for all shared libraries"
49 )
50 # --------- Setup the Executable output Directory -------------
51 SET (CMAKE_RUNTIME_OUTPUT_DIRECTORY
52 ${PROJECT_BINARY_DIR}/bin
53 CACHE PATH
54 "Single directory for all Executables."
55 )
56 # --------- Setup the static library directory -------------
57 SET (CMAKE_ARCHIVE_OUTPUT_DIRECTORY
58 ${PROJECT_BINARY_DIR}/lib
59 CACHE PATH
60 "Single directory for all static libraries."
61 )
62
63 FIND_PACKAGE(Subversion)
64 IF ( Subversion_FOUND AND EXISTS ${PROJECT_SOURCE_DIR}/.svn )
65 Subversion_WC_INFO(${PROJECT_SOURCE_DIR} Project)
66 MESSAGE(STATUS "Current revision is ${Project_WC_REVISION}")
67 Subversion_WC_LOG(${PROJECT_SOURCE_DIR} Project)
68 SET(SVN_REV ${Project_WC_REVISION})
69 ADD_DEFINITIONS( -DSVN_REV=${Project_WC_REVISION} )
70 SET(GENERATELOGS "${PROJECT_SOURCE_DIR}/doc/svn2cl")
71 ADD_CUSTOM_TARGET(ChangeLog
72 COMMAND ${GENERATELOGS} "--group-by-day" "--include-rev"
73 "--linelen=78" "--output=${PROJECT_BINARY_DIR}/ChangeLog" "${PROJECT_SOURCE_DIR}"
74 )
75 ENDIF()
76
77 check_include_file_cxx(conio.h HAVE_CONIO_H)
78 check_cxx_symbol_exists(strncasecmp "string.h" HAVE_STRNCASECMP)
79
80 # Optional libraries: If we can find these, we will build with them
81 # Look for OpenBabel libraries
82 find_package(OpenBabel2)
83 IF(OPENBABEL2_FOUND)
84 SET(USE_OPENBABEL)
85 include_directories(${OPENBABEL2_INCLUDE_DIR})
86 # link libraries are added only for targets that need them.
87 ENDIF(OPENBABEL2_FOUND)
88
89 #Look for QHULL Libraries
90 find_package(Qhull)
91 IF(QHULL_FOUND)
92 SET(HAVE_QHULL 1)
93 include_directories(${QHULL_INCLUDE_DIR})
94 LINK_LIBRARIES(${QHULL_LIBRARIES})
95 ENDIF(QHULL_FOUND)
96
97 # zlib stuff
98 find_package(ZLIB)
99 if(ZLIB_FOUND)
100 SET(HAVE_LIBZ 1)
101 add_definitions(-DHAVE_LIBZ)
102 include_directories(${ZLIB_INCLUDE_DIR})
103 LINK_LIBRARIES(${ZLIB_LIBRARIES})
104 endif(ZLIB_FOUND)
105
106 #FFTW
107 IF(SINGLE_PRECISION)
108 find_package(FFTW3 COMPONENTS single)
109 else()
110 find_package(FFTW3 COMPONENTS double)
111 endif(SINGLE_PRECISION)
112 if (FFTW3_FOUND)
113 include_directories (${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} ${FFTW3_INCLUDE_DIR})
114 SET(HAVE_LIBFFTW 1)
115 SET(HAVE_FFTW3_H 1)
116 INCLUDE_DIRECTORIES(${FFTW3_INCLUDE_DIR})
117 LINK_LIBRARIES(${FFTW3_LIBRARIES})
118 endif (FFTW3_FOUND)
119
120
121 # add a target to generate API documentation with Doxygen
122 find_package(Doxygen)
123 if(DOXYGEN_FOUND)
124 configure_file("${CMAKE_CURRENT_SOURCE_DIR}/doc/Doxyfile.in" "${CMAKE_CURRENT_BINARY_DIR}/doc/Doxyfile" @ONLY)
125 add_custom_target(doc
126 ${DOXYGEN_EXECUTABLE} "${CMAKE_CURRENT_BINARY_DIR}/doc/Doxyfile"
127 WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/doc"
128 COMMENT "Generating API documentation with Doxygen" VERBATIM
129 )
130 endif(DOXYGEN_FOUND)
131
132 FIND_PACKAGE(Perl)
133 IF(PERL_FOUND)
134 SET(PERL ${PERL_EXECUTABLE})
135 ELSE(PERL_FOUND)
136 MESSAGE(STATUS "Failed to find perl")
137 ENDIF(PERL_FOUND)
138
139 FIND_PACKAGE(PythonInterp)
140 IF(PYTHON_EXECUTABLE)
141 SET(PYTHON ${PYTHON_EXECUTABLE})
142 ELSE(PYTHON_EXECUTABLE)
143 MESSAGE(STATUS "Failed to find python")
144 ENDIF(PYTHON_EXECUTABLE)
145
146 SET(PERL_INSTALLDIRS "site" CACHE STRING "Perl installation locations")
147
148 configure_file (
149 "${PROJECT_SOURCE_DIR}/src/config.h.cmake"
150 "${PROJECT_BINARY_DIR}/config.h"
151 )
152 include_directories("${PROJECT_BINARY_DIR}" "${PROJECT_SOURCE_DIR}/src")
153
154 #Add executables for build
155 set (PROGRAMS
156 openmd
157 openmd_MPI
158 Dump2XYZ
159 simpleBuilder
160 StaticProps
161 DynamicProps
162 randomBuilder
163 nanoparticleBuilder
164 thermalizer
165 atom2md
166 Hydro)
167
168 set(SOURCE
169 src/antlr/ANTLRUtil.cpp
170 src/antlr/ASTFactory.cpp
171 src/antlr/ASTNULLType.cpp
172 src/antlr/ASTRefCount.cpp
173 src/antlr/BaseAST.cpp
174 src/antlr/BitSet.cpp
175 src/antlr/CharBuffer.cpp
176 src/antlr/CharScanner.cpp
177 src/antlr/CommonAST.cpp
178 src/antlr/CommonASTWithHiddenTokens.cpp
179 src/antlr/CommonHiddenStreamToken.cpp
180 src/antlr/CommonToken.cpp
181 src/antlr/InputBuffer.cpp
182 src/antlr/LLkParser.cpp
183 src/antlr/MismatchedCharException.cpp
184 src/antlr/MismatchedTokenException.cpp
185 src/antlr/NoViableAltException.cpp
186 src/antlr/NoViableAltForCharException.cpp
187 src/antlr/Parser.cpp
188 src/antlr/RecognitionException.cpp
189 src/antlr/String.cpp
190 src/antlr/Token.cpp
191 src/antlr/TokenBuffer.cpp
192 src/antlr/TokenRefCount.cpp
193 src/antlr/TokenStreamBasicFilter.cpp
194 src/antlr/TokenStreamHiddenTokenFilter.cpp
195 src/antlr/TokenStreamRewriteEngine.cpp
196 src/antlr/TokenStreamSelector.cpp
197 src/antlr/TreeParser.cpp
198 src/brains/BlockSnapshotManager.cpp
199 src/brains/DataStorage.cpp
200 src/brains/MoleculeCreator.cpp
201 src/brains/PairList.cpp
202 src/brains/Register.cpp
203 src/brains/SimSnapshotManager.cpp
204 src/brains/Snapshot.cpp
205 src/brains/Stats.cpp
206 src/constraints/Rattle.cpp
207 src/hydrodynamics/Ellipsoid.cpp
208 src/hydrodynamics/HydroProp.cpp
209 src/hydrodynamics/Sphere.cpp
210 src/integrators/DLM.cpp
211 src/integrators/Integrator.cpp
212 src/integrators/IntegratorFactory.cpp
213 src/integrators/LangevinDynamics.cpp
214 src/integrators/LDForceManager.cpp
215 src/integrators/NgammaT.cpp
216 src/integrators/NPAT.cpp
217 src/integrators/NPrT.cpp
218 src/integrators/NPT.cpp
219 src/integrators/NPTf.cpp
220 src/integrators/NPTi.cpp
221 src/integrators/NPTsz.cpp
222 src/integrators/NPTxyz.cpp
223 src/integrators/NVE.cpp
224 src/integrators/NVT.cpp
225 src/integrators/VelocityVerletIntegrator.cpp
226 src/io/AtomTypesSectionParser.cpp
227 src/io/BaseAtomTypesSectionParser.cpp
228 src/io/BendTypesSectionParser.cpp
229 src/io/BondTypesSectionParser.cpp
230 src/io/ChargeAtomTypesSectionParser.cpp
231 src/io/DirectionalAtomTypesSectionParser.cpp
232 src/io/EAMAtomTypesSectionParser.cpp
233 src/io/ForceFieldOptions.cpp
234 src/io/GayBerneAtomTypesSectionParser.cpp
235 src/io/Globals.cpp
236 src/io/gzstream.cpp
237 src/io/InversionTypesSectionParser.cpp
238 src/io/LennardJonesAtomTypesSectionParser.cpp
239 src/io/MultipoleAtomTypesSectionParser.cpp
240 src/io/NonBondedInteractionsSectionParser.cpp
241 src/io/OptionSectionParser.cpp
242 src/io/ParamConstraint.cpp
243 src/io/SCAtomTypesSectionParser.cpp
244 src/io/SectionParser.cpp
245 src/io/SectionParserManager.cpp
246 src/io/ShapeAtomTypesSectionParser.cpp
247 src/io/StickyAtomTypesSectionParser.cpp
248 src/io/StickyPowerAtomTypesSectionParser.cpp
249 src/io/TorsionTypesSectionParser.cpp
250 src/io/ZConsReader.cpp
251 src/lattice/CubicLattice.cpp
252 src/lattice/FCCLattice.cpp
253 src/lattice/Lattice.cpp
254 src/lattice/LatticeFactory.cpp
255 src/lattice/shapedLattice.cpp
256 src/math/ChebyshevT.cpp
257 src/math/ChebyshevU.cpp
258 src/math/CubicSpline.cpp
259 src/math/LegendrePolynomial.cpp
260 src/math/RealSphericalHarmonic.cpp
261 src/math/RMSD.cpp
262 src/math/SeqRandNumGen.cpp
263 src/math/SphericalHarmonic.cpp
264 src/math/Wigner3jm.cpp
265 src/mdParser/FilenameObserver.cpp
266 src/mdParser/MDLexer.cpp
267 src/mdParser/MDParser.cpp
268 src/mdParser/MDTreeParser.cpp
269 src/minimizers/MinimizerFactory.cpp
270 src/minimizers/MinimizerParameterSet.cpp
271 src/nonbonded/EAM.cpp
272 src/nonbonded/Electrostatic.cpp
273 src/nonbonded/GB.cpp
274 src/nonbonded/InteractionManager.cpp
275 src/nonbonded/LJ.cpp
276 src/nonbonded/MAW.cpp
277 src/nonbonded/Morse.cpp
278 src/nonbonded/RepulsivePower.cpp
279 src/nonbonded/SC.cpp
280 src/nonbonded/Sticky.cpp
281 src/nonbonded/SwitchingFunction.cpp
282 src/primitives/Atom.cpp
283 src/primitives/Bend.cpp
284 src/primitives/DirectionalAtom.cpp
285 src/primitives/GhostBend.cpp
286 src/primitives/GhostTorsion.cpp
287 src/primitives/Inversion.cpp
288 src/primitives/Molecule.cpp
289 src/primitives/RigidBody.cpp
290 src/primitives/StuntDouble.cpp
291 src/primitives/Torsion.cpp
292 src/primitives/UreyBradleyBend.cpp
293 src/restraints/MolecularRestraint.cpp
294 src/restraints/ObjectRestraint.cpp
295 src/selection/DistanceFinder.cpp
296 src/selection/HullFinder.cpp
297 src/selection/IndexFinder.cpp
298 src/selection/NameFinder.cpp
299 src/selection/SelectionCompiler.cpp
300 src/selection/SelectionEvaluator.cpp
301 src/selection/SelectionManager.cpp
302 src/selection/SelectionToken.cpp
303 src/selection/TokenMap.cpp
304 src/types/AtomStamp.cpp
305 src/types/AtomType.cpp
306 src/types/BendStamp.cpp
307 src/types/BondStamp.cpp
308 src/types/CharmmTorsionType.cpp
309 src/types/Component.cpp
310 src/types/CutoffGroupStamp.cpp
311 src/types/DirectionalAtomType.cpp
312 src/types/FragmentStamp.cpp
313 src/types/ImproperCosineInversionType.cpp
314 src/types/InversionStamp.cpp
315 src/types/MoleculeStamp.cpp
316 src/types/NonBondedInteractionType.cpp
317 src/types/RestraintStamp.cpp
318 src/types/RigidBodyStamp.cpp
319 src/types/ShapeAtomType.cpp
320 src/types/TorsionStamp.cpp
321 src/types/ZconsStamp.cpp
322 src/UseTheForce/Amber_FF.cpp
323 src/UseTheForce/CLAYFF.cpp
324 src/UseTheForce/DUFF.cpp
325 src/UseTheForce/EADM_FF.cpp
326 src/UseTheForce/EAM_FF.cpp
327 src/UseTheForce/ForceField.cpp
328 src/UseTheForce/ForceFieldFactory.cpp
329 src/UseTheForce/MnM_FF.cpp
330 src/UseTheForce/SC_FF.cpp
331 src/UseTheForce/SHAPES_FF.cpp
332 src/utils/ElementsTable.cpp
333 src/utils/MoLocator.cpp
334 src/utils/OpenMDBitSet.cpp
335 src/utils/PropertyMap.cpp
336 src/utils/StringTokenizer.cpp
337 src/utils/StringUtils.cpp
338 src/utils/Trim.cpp
339 src/utils/Utility.cpp
340 src/utils/wildcards.cpp
341 src/visitors/AtomNameVisitor.cpp
342 src/visitors/AtomVisitor.cpp
343 src/visitors/CompositeVisitor.cpp
344 src/visitors/LipidTransVisitor.cpp
345 src/visitors/OtherVisitor.cpp
346 src/visitors/ReplacementVisitor.cpp
347 src/visitors/RigidBodyVisitor.cpp
348 src/visitors/ZconsVisitor.cpp
349 )
350
351 set( PARALLEL_SOURCE
352 src/brains/ForceManager.cpp
353 src/brains/SimCreator.cpp
354 src/brains/SimInfo.cpp
355 src/brains/Thermo.cpp
356 src/constraints/ZconstraintForceManager.cpp
357 src/integrators/RNEMD.cpp
358 src/integrators/Velocitizer.cpp
359 src/io/DumpReader.cpp
360 src/io/DumpWriter.cpp
361 src/io/RestReader.cpp
362 src/io/RestWriter.cpp
363 src/io/StatWriter.cpp
364 src/io/ZConsWriter.cpp
365 src/io/ifstrstream.cpp
366 src/math/ParallelRandNumGen.cpp
367 src/minimizers/CGFamilyMinimizer.cpp
368 src/minimizers/Minimizer.cpp
369 src/minimizers/PRCG.cpp
370 src/minimizers/SDMinimizer.cpp
371 src/parallel/ForceDecomposition.cpp
372 src/parallel/ForceMatrixDecomposition.cpp
373 src/restraints/RestraintForceManager.cpp
374 src/restraints/ThermoIntegrationForceManager.cpp
375 src/utils/ProgressBar.cpp
376 src/utils/simError.cpp
377 )
378
379 IF(QHULL_FOUND)
380 set(QHULL_SOURCE
381 src/integrators/LangevinHullDynamics.cpp
382 src/math/Triangle.cpp
383 )
384 set(QHULL_PARALLEL_SOURCE
385 src/integrators/LangevinHullForceManager.cpp
386 src/math/ConvexHull.cpp
387 src/math/AlphaHull.cpp
388 )
389 ENDIF(QHULL_FOUND)
390
391 add_library(openmd_core STATIC ${SOURCE} ${QHULL_SOURCE} )
392 add_library(openmd_single STATIC ${PARALLEL_SOURCE} ${QHULL_PARALLEL_SOURCE} )
393
394 IF(MPI_FOUND)
395 add_library(openmd_parallel STATIC ${PARALLEL_SOURCE} ${QHULL_PARALLEL_SOURCE} )
396 set_target_properties(openmd_parallel PROPERTIES
397 COMPILE_DEFINITIONS IS_MPI
398 )
399 ENDIF(MPI_FOUND)
400
401 add_executable(openmd src/applications/openmd/openmd.cpp)
402 target_link_libraries(openmd openmd_single openmd_core openmd_single openmd_core)
403
404 if (MPI_FOUND)
405 add_executable(openmd_MPI src/applications/openmd/openmd.cpp)
406 set_target_properties(openmd_MPI PROPERTIES
407 COMPILE_DEFINITIONS IS_MPI
408 )
409 target_link_libraries(openmd_MPI openmd_parallel openmd_core openmd_parallel openmd_core)
410 INSTALL(TARGETS
411 openmd_parallel openmd_MPI
412 RUNTIME DESTINATION bin PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
413 LIBRARY DESTINATION lib PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
414 ARCHIVE DESTINATION lib PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
415 )
416 ENDIF (MPI_FOUND)
417
418 set (DUMP2XYZSOURCE
419 src/applications/dump2Xyz/Dump2XYZ.cpp
420 src/applications/dump2Xyz/Dump2XYZCmd.cpp
421 )
422
423 set (DYNAMICPROPSSOURCE
424 src/applications/dynamicProps/ActionCorrFunc.cpp
425 src/applications/dynamicProps/CrossTimeCorrFunc.cpp
426 src/applications/dynamicProps/DipoleCorrFunc.cpp
427 src/applications/dynamicProps/DirectionalRCorrFunc.cpp
428 src/applications/dynamicProps/DynamicProps.cpp
429 src/applications/dynamicProps/EnergyCorrFunc.cpp
430 src/applications/dynamicProps/FrameTimeCorrFunc.cpp
431 src/applications/dynamicProps/LegendreCorrFunc.cpp
432 src/applications/dynamicProps/MomentumCorrFunc.cpp
433 src/applications/dynamicProps/ParticleTimeCorrFunc.cpp
434 src/applications/dynamicProps/RadialRCorrFunc.cpp
435 src/applications/dynamicProps/RCorrFunc.cpp
436 src/applications/dynamicProps/StressCorrFunc.cpp
437 src/applications/dynamicProps/SystemDipoleCorrFunc.cpp
438 src/applications/dynamicProps/ThetaCorrFunc.cpp
439 src/applications/dynamicProps/TimeCorrFunc.cpp
440 src/applications/dynamicProps/VCorrFunc.cpp
441 src/applications/dynamicProps/DynamicPropsCmd.cpp
442 )
443
444 set (HYDROSOURCE
445 src/applications/hydrodynamics/AnalyticalModel.cpp
446 src/applications/hydrodynamics/ApproximationModel.cpp
447 src/applications/hydrodynamics/BeadModel.cpp
448 src/applications/hydrodynamics/CompositeShape.cpp
449 src/applications/hydrodynamics/Hydro.cpp
450 src/applications/hydrodynamics/HydrodynamicsModel.cpp
451 src/applications/hydrodynamics/HydrodynamicsModelFactory.cpp
452 src/applications/hydrodynamics/RoughShell.cpp
453 src/applications/hydrodynamics/ShapeBuilder.cpp
454 src/applications/hydrodynamics/HydroCmd.cpp
455 )
456
457 set (STATICPROPSSOURCE
458 src/applications/staticProps/AngleR.cpp
459 src/applications/staticProps/BondAngleDistribution.cpp
460 src/applications/staticProps/BondOrderParameter.cpp
461 src/applications/staticProps/BOPofR.cpp
462 src/applications/staticProps/DensityPlot.cpp
463 src/applications/staticProps/GofAngle2.cpp
464 src/applications/staticProps/GofR.cpp
465 src/applications/staticProps/GofRAngle.cpp
466 src/applications/staticProps/GofRZ.cpp
467 src/applications/staticProps/GofXyz.cpp
468 src/applications/staticProps/GofZ.cpp
469 src/applications/staticProps/Hxy.cpp
470 src/applications/staticProps/NanoLength.cpp
471 src/applications/staticProps/NanoVolume.cpp
472 src/applications/staticProps/ObjectCount.cpp
473 src/applications/staticProps/P2OrderParameter.cpp
474 src/applications/staticProps/pAngle.cpp
475 src/applications/staticProps/RadialDistrFunc.cpp
476 src/applications/staticProps/RhoR.cpp
477 src/applications/staticProps/RhoZ.cpp
478 src/applications/staticProps/RippleOP.cpp
479 src/applications/staticProps/SCDOrderParameter.cpp
480 src/applications/staticProps/StaticProps.cpp
481 src/applications/staticProps/TetrahedralityParam.cpp
482 src/applications/staticProps/TwoDGofR.cpp
483 src/applications/staticProps/StaticPropsCmd.cpp
484 )
485
486 set (NANOPARTICLEBUILDERSOURCE
487 src/applications/nanoparticleBuilder/nanoparticleBuilder.cpp
488 src/applications/nanoparticleBuilder/shapedLatticeSpherical.cpp
489 src/applications/nanoparticleBuilder/nanoparticleBuilderCmd.cpp
490 )
491
492 set (RANDOMBUILDERSOURCE
493 src/applications/randomBuilder/randomBuilder.cpp
494 src/applications/randomBuilder/randomBuilderCmd.cpp
495 )
496
497 set(SIMPLEBUILDERSOURCE
498 src/applications/simpleBuilder/simpleBuilder.cpp
499 src/applications/simpleBuilder/simpleBuilderCmd.cpp
500 )
501
502 set(THERMALIZERSOURCE
503 src/applications/thermalizer/thermalizer.cpp
504 src/applications/thermalizer/thermalizerCmd.cpp
505 )
506
507 add_executable(Dump2XYZ ${DUMP2XYZSOURCE})
508 target_link_libraries(Dump2XYZ openmd_single openmd_core openmd_single openmd_core)
509 add_executable(DynamicProps ${DYNAMICPROPSSOURCE})
510 target_link_libraries(DynamicProps openmd_single openmd_core openmd_single openmd_core)
511 add_executable(Hydro ${HYDROSOURCE})
512 target_link_libraries(Hydro openmd_single openmd_core openmd_single openmd_core)
513 add_executable(StaticProps ${STATICPROPSSOURCE})
514 target_link_libraries(StaticProps openmd_single openmd_core openmd_single openmd_core)
515 add_executable(nanoparticleBuilder ${NANOPARTICLEBUILDERSOURCE})
516 target_link_libraries(nanoparticleBuilder openmd_single openmd_core openmd_single openmd_core)
517 add_executable(randomBuilder ${RANDOMBUILDERSOURCE})
518 target_link_libraries(randomBuilder openmd_single openmd_core openmd_single openmd_core)
519 add_executable(simpleBuilder ${SIMPLEBUILDERSOURCE})
520 target_link_libraries(simpleBuilder openmd_single openmd_core openmd_single openmd_core)
521 add_executable(thermalizer ${THERMALIZERSOURCE})
522 target_link_libraries(thermalizer openmd_single openmd_core openmd_single openmd_core)
523
524 if (OPENBABEL2_FOUND)
525 set (ATOM2MDSOURCE
526 src/applications/atom2md/atom2md.cpp
527 src/applications/atom2md/openmdformat.cpp
528 )
529 add_executable(atom2md ${ATOM2MDSOURCE})
530 target_link_libraries(atom2md openmd_single openmd_core openmd_single openmd_core ${OPENBABEL2_LIBRARIES})
531 INSTALL(TARGETS atom2md RUNTIME DESTINATION bin
532 PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
533 ENDIF (OPENBABEL2_FOUND)
534
535
536 set(PY_FILES
537 src/applications/hydrodynamics/diffExplainer
538 src/applications/utilities/affineScale
539 src/applications/utilities/dumpConverter
540 src/applications/utilities/md-solvator
541 src/applications/utilities/md2md
542 src/applications/utilities/mdSplit
543 src/applications/utilities/principalAxisCalculator
544 src/applications/utilities/stat2visco
545 src/applications/utilities/waterRotator
546 src/applications/utilities/waterReplacer
547 )
548
549 IF(PYTHON_EXECUTABLE)
550 foreach(PY_FILE ${PY_FILES})
551 GET_FILENAME_COMPONENT(filename "${PY_FILE}" NAME)
552 CONFIGURE_FILE(${PY_FILE}
553 "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${filename}" @ONLY)
554 INSTALL(FILES "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${filename}"
555 DESTINATION bin
556 PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
557 endforeach(PY_FILE)
558 ENDIF(PYTHON_EXECUTABLE)
559
560 set(PERL_FILES
561 src/applications/utilities/solvator
562 src/applications/utilities/waterBoxer
563 )
564
565 IF(PERL_FOUND)
566 foreach(PERL_FILE ${PERL_FILES})
567 GET_FILENAME_COMPONENT(filename "${PERL_FILE}" NAME)
568 configure_file(${PERL_FILE} "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${filename}" @ONLY)
569 INSTALL(FILES "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${filename}"
570 DESTINATION bin
571 PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
572
573 endforeach(PERL_FILE)
574 ENDIF(PERL_FOUND)
575
576 INSTALL(FILES AUTHORS LICENSE README INSTALL DESTINATION .
577 PERMISSIONS OWNER_READ GROUP_READ WORLD_READ)
578 INSTALL(TARGETS
579 openmd_core
580 openmd_single
581 openmd
582 Dump2XYZ
583 simpleBuilder
584 StaticProps
585 DynamicProps
586 randomBuilder
587 nanoparticleBuilder
588 thermalizer
589 Hydro
590 RUNTIME DESTINATION bin PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
591 LIBRARY DESTINATION lib PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
592 ARCHIVE DESTINATION lib PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
593 )
594
595 install(DIRECTORY forceFields/
596 DESTINATION forceFields
597 DIRECTORY_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
598 PATTERN ".svn" EXCLUDE
599 PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ)
600 install(DIRECTORY samples/
601 DESTINATION samples
602 DIRECTORY_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
603 PATTERN ".svn" EXCLUDE
604 PATTERN "*.dump" EXCLUDE
605 PATTERN "*.stat" EXCLUDE
606 PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ)
607 INSTALL(FILES "${CMAKE_CURRENT_SOURCE_DIR}/doc/OpenMDmanual.pdf"
608 DESTINATION doc
609 PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ)
610
611 message( STATUS)
612 message( STATUS "========== OpenMD Build Information ==========")
613 message( STATUS "Current revision ........... = ${SVN_REV}")
614 message( STATUS "CMAKE_SYSTEM ............... = ${CMAKE_SYSTEM}")
615 message( STATUS "==============================================")
616 message( STATUS "CMAKE_BUILD_TYPE ........... = ${CMAKE_BUILD_TYPE}")
617 message( STATUS "CMAKE_INSTALL_PREFIX ....... = ${CMAKE_INSTALL_PREFIX}")
618 message( STATUS "CMAKE_CXX_COMPILER ......... = ${CMAKE_CXX_COMPILER}")
619 message( STATUS "MPI_CXX_COMPILER ........... = ${MPI_CXX_COMPILER}")
620 message( STATUS "MPI_CXX_INCLUDE_PATH ....... = ${MPI_CXX_INCLUDE_PATH}")
621 message( STATUS "MPI_CXX_LIBRARIES .......... = ${MPI_CXX_LIBRARIES}")
622 message( STATUS "Build as SINGLE_PRECISION .. = ${SINGLE_PRECISION}")
623 message( STATUS "OPENBABEL2_INCLUDE_DIR ..... = ${OPENBABEL2_INCLUDE_DIR}")
624 message( STATUS "OPENBABEL2_LIBRARIES ....... = ${OPENBABEL2_LIBRARIES}")
625 message( STATUS "QHULL_INCLUDE_DIR .......... = ${QHULL_INCLUDE_DIR}")
626 message( STATUS "QHULL_LIBRARIES ............ = ${QHULL_LIBRARIES}")
627 message( STATUS "ZLIB_INCLUDE_DIR ........... = ${ZLIB_INCLUDE_DIR}")
628 message( STATUS "ZLIB_LIBRARIES ............. = ${ZLIB_LIBRARIES}")
629 message( STATUS "FFTW3_INCLUDE_DIR .......... = ${FFTW3_INCLUDE_DIR}")
630 message( STATUS "FFTW3_LIBRARIES ............ = ${FFTW3_LIBRARIES}")
631 message( STATUS "DOXYGEN_EXECUTABLE ......... = ${DOXYGEN_EXECUTABLE}")
632 message( STATUS "PERL_EXECUTABLE ............ = ${PERL}")
633 message( STATUS "PYTHON_EXECUTABLE .......... = ${PYTHON}")
634 message( STATUS "To override these options, add -D{OPTION_NAME}=... to the cmake command")
635 message(STATUS)
636 message(STATUS "To build and install OpenMD, enter \"make\" and \"make install\"")