| 3 |
|
cmake_minimum_required (VERSION 2.6) |
| 4 |
|
project(OpenMD) |
| 5 |
|
|
| 6 |
– |
|
| 6 |
|
# OpenMD version number. |
| 7 |
|
set (VERSION_MAJOR "2") |
| 8 |
|
set (VERSION_MINOR "0") |
| 10 |
|
|
| 11 |
|
# cmake modules that are needed to build oopse |
| 12 |
|
SET(CMAKE_MODULE_PATH ${OpenMD_SOURCE_DIR}/cmake/modules) |
| 13 |
< |
SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin) |
| 14 |
< |
SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib) |
| 13 |
> |
IF(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) |
| 14 |
> |
SET(CMAKE_INSTALL_PREFIX |
| 15 |
> |
"/usr/local/openmd" CACHE PATH "OpenMD install prefix" FORCE |
| 16 |
> |
) |
| 17 |
> |
ENDIF(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) |
| 18 |
> |
|
| 19 |
> |
# ---------- Setup output Directories ------------------------- |
| 20 |
> |
SET (CMAKE_LIBRARY_OUTPUT_DIRECTORY |
| 21 |
> |
${PROJECT_BINARY_DIR}/lib |
| 22 |
> |
CACHE PATH |
| 23 |
> |
"Single directory for all shared libraries" |
| 24 |
> |
) |
| 25 |
> |
# --------- Setup the Executable output Directory ------------- |
| 26 |
> |
SET (CMAKE_RUNTIME_OUTPUT_DIRECTORY |
| 27 |
> |
${PROJECT_BINARY_DIR}/bin |
| 28 |
> |
CACHE PATH |
| 29 |
> |
"Single directory for all Executables." |
| 30 |
> |
) |
| 31 |
> |
# --------- Setup the static library directory ------------- |
| 32 |
> |
SET (CMAKE_ARCHIVE_OUTPUT_DIRECTORY |
| 33 |
> |
${PROJECT_BINARY_DIR}/lib |
| 34 |
> |
CACHE PATH |
| 35 |
> |
"Single directory for all static libraries." |
| 36 |
> |
) |
| 37 |
> |
|
| 38 |
|
|
| 39 |
|
enable_language(CXX C) |
| 40 |
|
|
| 143 |
|
ENDIF(PYTHON_EXECUTABLE) |
| 144 |
|
|
| 145 |
|
SET(PERL_INSTALLDIRS "site" CACHE STRING "Perl installation locations") |
| 124 |
– |
|
| 146 |
|
|
| 126 |
– |
include(CMakePrintSystemInformation) |
| 147 |
|
|
| 148 |
|
configure_file ( |
| 149 |
|
"${PROJECT_SOURCE_DIR}/src/config.h.cmake" |
| 410 |
|
COMPILE_DEFINITIONS IS_MPI |
| 411 |
|
) |
| 412 |
|
target_link_libraries(openmd_MPI openmd_parallel openmd_core openmd_parallel openmd_core) |
| 413 |
+ |
INSTALL(TARGETS |
| 414 |
+ |
openmd_parallel openmd_MPI |
| 415 |
+ |
RUNTIME DESTINATION bin PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE |
| 416 |
+ |
LIBRARY DESTINATION lib PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ |
| 417 |
+ |
ARCHIVE DESTINATION lib PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ |
| 418 |
+ |
) |
| 419 |
|
ENDIF (MPI_FOUND) |
| 420 |
|
|
| 421 |
|
set (DUMP2XYZSOURCE |
| 531 |
|
) |
| 532 |
|
add_executable(atom2md ${ATOM2MDSOURCE}) |
| 533 |
|
target_link_libraries(atom2md openmd_single openmd_core openmd_single openmd_core ${OPENBABEL2_LIBRARIES}) |
| 534 |
+ |
INSTALL(TARGETS atom2md RUNTIME DESTINATION bin |
| 535 |
+ |
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) |
| 536 |
|
ENDIF (OPENBABEL2_FOUND) |
| 537 |
|
|
| 538 |
|
|
| 550 |
|
|
| 551 |
|
IF(PYTHON_EXECUTABLE) |
| 552 |
|
foreach(PY_FILE ${PY_FILES}) |
| 553 |
< |
configure_file(${PY_FILE} "${EXECUTABLE_OUTPUT_PATH}"/${PY_FILE} @ONLY) |
| 553 |
> |
GET_FILENAME_COMPONENT(filename "${PY_FILE}" NAME) |
| 554 |
> |
CONFIGURE_FILE(${PY_FILE} |
| 555 |
> |
"${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${filename}" @ONLY) |
| 556 |
> |
INSTALL(FILES "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${filename}" |
| 557 |
> |
DESTINATION bin |
| 558 |
> |
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) |
| 559 |
|
endforeach(PY_FILE) |
| 527 |
– |
#INSTALL(FILES ${PY_FILES} DESTINATION ${EXECUTABLE_OUTPUT_PATH}) |
| 560 |
|
ENDIF(PYTHON_EXECUTABLE) |
| 561 |
|
|
| 562 |
|
set(PERL_FILES |
| 566 |
|
|
| 567 |
|
IF(PERL_FOUND) |
| 568 |
|
foreach(PERL_FILE ${PERL_FILES}) |
| 569 |
< |
configure_file(${PERL_FILE} "${EXECUTABLE_OUTPUT_PATH}"/${PERL_FILE} @ONLY) |
| 569 |
> |
GET_FILENAME_COMPONENT(filename "${PERL_FILE}" NAME) |
| 570 |
> |
configure_file(${PERL_FILE} "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${filename}" @ONLY) |
| 571 |
> |
INSTALL(FILES "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${filename}" |
| 572 |
> |
DESTINATION bin |
| 573 |
> |
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) |
| 574 |
> |
|
| 575 |
|
endforeach(PERL_FILE) |
| 539 |
– |
#INSTALL(FILES ${PERL_FILES} DESTINATION ${EXECUTABLE_OUTPUT_PATH}) |
| 576 |
|
ENDIF(PERL_FOUND) |
| 577 |
+ |
|
| 578 |
+ |
INSTALL(FILES AUTHORS LICENSE README DESTINATION . |
| 579 |
+ |
PERMISSIONS OWNER_READ GROUP_READ WORLD_READ) |
| 580 |
+ |
INSTALL(TARGETS |
| 581 |
+ |
openmd_core |
| 582 |
+ |
openmd_single |
| 583 |
+ |
openmd |
| 584 |
+ |
Dump2XYZ |
| 585 |
+ |
simpleBuilder |
| 586 |
+ |
StaticProps |
| 587 |
+ |
DynamicProps |
| 588 |
+ |
randomBuilder |
| 589 |
+ |
nanoparticleBuilder |
| 590 |
+ |
thermalizer |
| 591 |
+ |
Hydro |
| 592 |
+ |
RUNTIME DESTINATION bin PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE |
| 593 |
+ |
LIBRARY DESTINATION lib PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ |
| 594 |
+ |
ARCHIVE DESTINATION lib PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ |
| 595 |
+ |
) |
| 596 |
+ |
|
| 597 |
+ |
install(DIRECTORY forceFields/ |
| 598 |
+ |
DESTINATION forceFields |
| 599 |
+ |
DIRECTORY_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE |
| 600 |
+ |
PATTERN ".svn" EXCLUDE |
| 601 |
+ |
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ) |
| 602 |
+ |
install(DIRECTORY samples/ |
| 603 |
+ |
DESTINATION samples |
| 604 |
+ |
DIRECTORY_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE |
| 605 |
+ |
PATTERN ".svn" EXCLUDE |
| 606 |
+ |
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ) |