ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/OpenMD/branches/development/CMakeLists.txt
Revision: 1830
Committed: Wed Jan 9 22:02:30 2013 UTC (12 years, 6 months ago) by gezelter
Content type: text/plain
File size: 26940 byte(s)
Log Message:
Windows compilation fixes

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