ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/OpenMD/branches/development/CMakeLists.txt
Revision: 1866
Committed: Thu Apr 25 14:32:56 2013 UTC (12 years ago) by gezelter
Content type: text/plain
File size: 27858 byte(s)
Log Message:
Fixes for Qhull static build strangeness

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