1
0
mirror of https://github.com/TREX-CoE/trexio.git synced 2024-11-03 20:54:07 +01:00
trexio/CMakeLists.txt

48 lines
1.4 KiB
CMake
Raw Normal View History

2021-11-13 19:01:21 +01:00
cmake_minimum_required(VERSION 3.16)
2021-11-13 19:49:02 +01:00
# =========== SETUP THE PROJECT =============
# Initialize the CMake project.
project(Trexio
VERSION 2.1.0
DESCRIPTION "TREX I/O library"
2021-11-13 19:01:21 +01:00
LANGUAGES C Fortran
)
# Request the C99 standard.
2021-11-13 19:01:21 +01:00
set(CMAKE_C_STANDARD 99)
set(CMAKE_C_STANDARD_REQUIRED ON)
# Optional configure for developer mode to generate source code from org-mode files.
option(TREXIO_DEVEL "TREXIO developer mode (for code generation)." OFF)
if(EXISTS "${CMAKE_SOURCE_DIR}/.git/config")
set(TREXIO_DEVEL ON)
find_package(Python3 REQUIRED)
if(Python3_FOUND)
if(Python3_VERSION_MINOR LESS 6)
message(FATAL_ERROR "Required Python3 version :: >= 3.6; Found :: ${Python3_VERSION}")
else()
message(STATUS "Python3 version :: ${Python3_VERSION}")
endif()
endif()
find_program(EMACS NAMES emacs REQUIRED)
if(NOT EMACS-NOTFOUND)
message(STATUS "EMACS detected :: ${EMACS}")
else()
message(FATAL_ERROR "EMACS not found. It is required to produce TREXIO source code from org-mode files.")
endif()
configure_file(${CMAKE_SOURCE_DIR}/include/cmake_config.h.in
${CMAKE_SOURCE_DIR}/include/config.h)
endif()
# Set directories to be included at build time.
2021-11-13 19:49:02 +01:00
include_directories(include)
2021-11-13 19:01:21 +01:00
# Add subdirectory with add_library(trexio) specifications.
add_subdirectory(src)
2021-11-13 19:49:02 +01:00
# Add subdirectory with unit tests.
2021-11-13 19:49:02 +01:00
enable_testing()
add_subdirectory(tests)