1 project(pair_ext_template)
2 CMAKE_MINIMUM_REQUIRED(VERSION 2.6.2 FATAL_ERROR)
4 set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_MODULE_PATH})
7 # plugins must be built as shared libraries
9 message(SEND_ERROR "Plugins cannot be built against a statically compiled hoomd")
12 set(BUILD_SHARED_LIBS on)
15 add_subdirectory(cppmodule)
16 add_subdirectory(pymodule)
19 # overide the CMAKE_INSTALL_PREFIX on the first run to the env HOOMD_PLUGINS_DIR if defined or ${HOOMD_ROOT}
20 # ${HOOMD_ROOT} will likely be the most common installation directory, but users may want to override
21 if(DEFINED HOOMD_PLUGINS_DIR)
22 set(_default_install_path ${HOOMD_PLUGINS_DIR})
23 else(DEFINED HOOMD_PLUGINS_DIR)
24 set(_default_install_path ${HOOMD_ROOT}/lib/hoomd/python-module)
25 endif(DEFINED HOOMD_PLUGINS_DIR)
29 set(CMAKE_INSTALL_PREFIX ${_default_install_path} CACHE PATH "Install path prefix, prepended onto install directories." FORCE)
30 SET(_first_run ON CACHE INTERNAL "First configure has run: CMAKE_INSTALL_PREFIX has had its defaults changed" FORCE)
32 endif (NOT _first_run)
34 # install the __init__.py file
35 install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/__init__.py DESTINATION hoomd_plugins)