ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/OpenMD/branches/development/CMakeLists.txt
Revision: 1803
Committed: Wed Oct 3 14:20:07 2012 UTC (12 years, 8 months ago) by gezelter
Content type: text/plain
File size: 25863 byte(s)
Log Message:
Merging trunk changes back to development branch

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