mirror of
https://github.com/triqs/dft_tools
synced 2024-12-25 05:43:40 +01:00
fcfcce8d61
- C++14 mode not automatic. Was based on compiler version, but the version of the C++ lib also matters.... Now, there is an explicit USE_CPP14 option [default =OFF] to set to compile in c++1y mode. Solve also #89, i.e. the flags is now in TRIQS_CXX_DEFINITIONS and therefore pass to applications (including ipython magic). - Python_use_mpi4py is now ON by default. Rational : it has been used for a while by e.g. Thomas, and it is necessary on OS X (boost.mpi.python raises a lot of issues). Hence we put it as default. - Rename the option Build_Triqs_General_Tools_Test to a simpler Build_Tests
36 lines
1.4 KiB
CMake
36 lines
1.4 KiB
CMake
option(Python_use_mpi4py "Use mpi4py (if OFF, use boost.mpi)" ON)
|
|
if (Python_use_mpi4py)
|
|
SET (TRIQS_PYTHON_MPI_USE_MPI4PY 1)
|
|
else()
|
|
SET(TRIQS_PYTHON_MPI_USE_MPI4PY 0)
|
|
endif()
|
|
|
|
# Create a temporary copy of the python modules so that we can run before installation with the test
|
|
FILE(GLOB_RECURSE all_py_files RELATIVE ${CMAKE_SOURCE_DIR}/pytriqs *.py )
|
|
SET(py_copy_tar ${CMAKE_BINARY_DIR}/py_copy.tar)
|
|
add_custom_command (OUTPUT ${py_copy_tar} DEPENDS ${all_py_files}
|
|
COMMAND cd ${CMAKE_SOURCE_DIR}/pytriqs && tar cf ${py_copy_tar} ${all_py_files} && cd ${CMAKE_BINARY_DIR}/pytriqs && tar xf ${py_copy_tar} )
|
|
add_custom_target(py_copy ALL DEPENDS ${py_copy_tar})
|
|
|
|
find_package(PythonWrapperMacro)
|
|
|
|
SET(PYTHON_SOURCES
|
|
${CMAKE_CURRENT_SOURCE_DIR}/__init__.py
|
|
${CMAKE_CURRENT_BINARY_DIR}/version.py
|
|
${CMAKE_CURRENT_BINARY_DIR}/magic.py
|
|
)
|
|
|
|
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/version.py.in ${CMAKE_CURRENT_BINARY_DIR}/version.py)
|
|
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/utility/mpi.py.in ${CMAKE_CURRENT_BINARY_DIR}/utility/mpi.py)
|
|
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/magic.py.in ${CMAKE_CURRENT_BINARY_DIR}/magic.py @ONLY)
|
|
|
|
install (FILES ${PYTHON_SOURCES} DESTINATION ${TRIQS_PYTHON_LIB_DEST})
|
|
install (FILES ${PYTHON_SOURCES} DESTINATION ${TRIQS_PYTHON_LIB_DEST})
|
|
|
|
# All subdirs
|
|
add_all_subdirectories_with_cmakelist()
|
|
|
|
#
|
|
add_custom_target(wrap_clean COMMAND find ${CMAKE_BINARY_DIR} -name \"*.cpp\" |xargs rm)
|
|
|