2019-03-20 14:13:41 +02:00
|
|
|
cmake_minimum_required(VERSION 3.0.2)
|
2020-04-10 23:19:18 +03:00
|
|
|
|
|
|
|
option(QPMS_USE_FORTRAN_AMOS "Use the original AMOS Fortran libraries instead of the C ones" OFF)
|
|
|
|
|
|
|
|
if (QPMS_USE_FORTRAN_AMOS)
|
2019-03-20 11:28:47 +02:00
|
|
|
include(CMakeAddFortranSubdirectory)
|
2020-04-10 23:19:18 +03:00
|
|
|
endif (QPMS_USE_FORTRAN_AMOS)
|
2019-06-17 17:22:33 +03:00
|
|
|
include(version.cmake)
|
2019-08-12 16:33:54 +03:00
|
|
|
include(GNUInstallDirs)
|
2019-06-17 17:22:33 +03:00
|
|
|
|
2019-03-19 16:33:44 +02:00
|
|
|
project (QPMS)
|
|
|
|
|
2020-04-10 23:19:18 +03:00
|
|
|
|
|
|
|
|
2019-03-19 16:33:44 +02:00
|
|
|
macro(use_c99)
|
|
|
|
if (CMAKE_VERSION VERSION_LESS "3.1")
|
|
|
|
if (CMAKE_C_COMPILER_ID STREQUAL "GNU")
|
|
|
|
set (CMAKE_C_FLAGS "-std=gnu99 ${CMAKE_C_FLAGS}")
|
|
|
|
endif ()
|
|
|
|
else ()
|
|
|
|
set (CMAKE_C_STANDARD 99)
|
|
|
|
endif ()
|
|
|
|
endmacro(use_c99)
|
|
|
|
|
2019-03-20 20:46:47 +02:00
|
|
|
# We need the amos libraries to be compiled with -fPIC
|
|
|
|
# but at the same time, we do not want to make a .so file,
|
|
|
|
# so distutils package it with the rest of qpms c/cython lib.
|
|
|
|
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
|
|
|
|
2019-03-19 16:33:44 +02:00
|
|
|
set (QPMS_VERSION_MAJOR 0)
|
|
|
|
#set (QPMS_VERSION_MINOR 3)
|
2020-04-10 23:19:18 +03:00
|
|
|
|
|
|
|
if (QPMS_USE_FORTRAN_AMOS)
|
|
|
|
cmake_add_fortran_subdirectory (amos
|
|
|
|
PROJECT amos
|
|
|
|
LIBRARIES amos
|
|
|
|
NO_EXTERNAL_INSTALL)
|
|
|
|
set(QPMS_AMOSLIB amos)
|
|
|
|
else (QPMS_USE_FORTRAN_AMOS)
|
|
|
|
set(CAMOS_BUILD_STATIC ON)
|
|
|
|
add_subdirectory (camos)
|
|
|
|
set(QPMS_AMOSLIB camos)
|
|
|
|
endif (QPMS_USE_FORTRAN_AMOS)
|
|
|
|
|
2020-05-14 15:29:20 +03:00
|
|
|
|
|
|
|
set(FADDEEVA_BUILD_STATIC ON)
|
|
|
|
add_subdirectory(faddeeva)
|
|
|
|
|
2019-03-19 16:33:44 +02:00
|
|
|
add_subdirectory (qpms)
|
2019-08-17 13:57:24 +03:00
|
|
|
|
2019-08-19 10:23:59 +03:00
|
|
|
|
|
|
|
enable_testing()
|
|
|
|
add_subdirectory (tests EXCLUDE_FROM_ALL)
|
2019-08-17 13:57:24 +03:00
|
|
|
|
2019-06-17 17:22:33 +03:00
|
|
|
#add_subdirectory (apps/transop-ewald)
|