2013-09-04 16:54:12 +02:00
|
|
|
# Version number of the application
|
2017-04-05 20:58:01 +02:00
|
|
|
set (DFT_TOOLS_VERSION "1.5")
|
|
|
|
set (DFT_TOOLS_RELEASE "1.5.0")
|
2013-09-04 16:54:12 +02:00
|
|
|
|
2017-12-07 15:56:05 +01:00
|
|
|
# Default to Release build type
|
|
|
|
if(NOT CMAKE_BUILD_TYPE)
|
|
|
|
set(CMAKE_BUILD_TYPE Release CACHE STRING "Type of build" FORCE)
|
|
|
|
endif()
|
|
|
|
message( STATUS "-------- BUILD-TYPE: ${CMAKE_BUILD_TYPE} -------------")
|
2013-07-23 19:49:42 +02:00
|
|
|
|
2017-12-07 15:56:05 +01:00
|
|
|
# start configuration
|
2013-07-23 19:49:42 +02:00
|
|
|
cmake_minimum_required(VERSION 2.8)
|
2018-01-23 02:29:53 +01:00
|
|
|
project(dft_tools C CXX Fortran)
|
2013-07-23 19:49:42 +02:00
|
|
|
|
2017-12-07 15:56:05 +01:00
|
|
|
# Use shared libraries
|
|
|
|
set(BUILD_SHARED_LIBS ON)
|
|
|
|
|
|
|
|
# Load TRIQS and Cpp2Py
|
|
|
|
find_package(TRIQS 1.5 EXACT REQUIRED)
|
|
|
|
find_package(Cpp2Py REQUIRED)
|
2013-07-23 19:49:42 +02:00
|
|
|
|
2016-02-07 10:41:53 +01:00
|
|
|
if (NOT ${TRIQS_WITH_PYTHON_SUPPORT})
|
|
|
|
MESSAGE(FATAL_ERROR "dft_tools require Python support in TRIQS")
|
|
|
|
endif()
|
|
|
|
|
2017-12-07 15:56:05 +01:00
|
|
|
# Default Install directory to TRIQS_ROOT if not given. Checks an absolute name is given.
|
|
|
|
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT OR (NOT IS_ABSOLUTE ${CMAKE_INSTALL_PREFIX}))
|
|
|
|
message(STATUS " No install prefix given (or invalid). Defaulting to TRIQS_ROOT")
|
|
|
|
set(CMAKE_INSTALL_PREFIX ${TRIQS_ROOT} CACHE PATH "default install path" FORCE)
|
|
|
|
endif()
|
|
|
|
message(STATUS "-------- CMAKE_INSTALL_PREFIX: ${CMAKE_INSTALL_PREFIX} -------------")
|
2013-09-04 16:54:12 +02:00
|
|
|
|
2017-12-07 15:56:05 +01:00
|
|
|
# Macro defined in TRIQS which picks the hash of repo.
|
|
|
|
triqs_get_git_hash_of_source_dir(DFT_TOOLS_GIT_HASH)
|
|
|
|
message(STATUS "Git hash: ${DFT_TOOLS_GIT_HASH}")
|
2013-07-23 19:49:42 +02:00
|
|
|
|
|
|
|
add_subdirectory(fortran/dmftproj)
|
2016-03-24 11:40:12 +01:00
|
|
|
|
|
|
|
# Add the compiling options (-D... ) for C++
|
|
|
|
message(STATUS "TRIQS : Adding compilation flags detected by the library (C++11/14, libc++, etc...) ")
|
|
|
|
|
|
|
|
add_subdirectory(c++)
|
2013-07-23 19:49:42 +02:00
|
|
|
add_subdirectory(python)
|
2016-03-11 11:35:19 +01:00
|
|
|
add_subdirectory(shells)
|
2017-12-07 15:56:05 +01:00
|
|
|
|
2018-01-22 23:34:20 +01:00
|
|
|
#------------------------
|
|
|
|
# tests
|
|
|
|
#------------------------
|
|
|
|
|
|
|
|
enable_testing()
|
|
|
|
|
|
|
|
option(Build_Tests "Build the tests of the library " ON)
|
|
|
|
if (Build_Tests)
|
|
|
|
message(STATUS "-------- Preparing tests -------------")
|
|
|
|
add_subdirectory(test)
|
|
|
|
endif()
|
2017-12-07 15:56:05 +01:00
|
|
|
|
2018-01-22 23:34:20 +01:00
|
|
|
#------------------------
|
|
|
|
# Documentation
|
|
|
|
#------------------------
|
2013-08-07 16:40:18 +02:00
|
|
|
option(BUILD_DOC "Build documentation" OFF)
|
|
|
|
if(${BUILD_DOC})
|
2018-02-02 15:56:08 +01:00
|
|
|
if(NOT ${TRIQS_WITH_DOCUMENTATION})
|
2013-08-07 16:40:18 +02:00
|
|
|
message("Error: TRIQS library has not been compiled with its documentation")
|
|
|
|
endif()
|
|
|
|
add_subdirectory(doc)
|
|
|
|
endif(${BUILD_DOC})
|