1
0
mirror of https://github.com/TREX-CoE/trexio.git synced 2024-07-22 18:57:39 +02:00

[CMake] add minor support for pthreads and stdint

This commit is contained in:
q-posev 2022-01-20 17:32:01 +01:00
parent 5db1de3d3c
commit 2a9cfb3fa4
2 changed files with 26 additions and 12 deletions

View File

@ -49,7 +49,8 @@ if(EXISTS "${CMAKE_SOURCE_DIR}/.git/config")
# replace placeholders in the templace config.h.in file to produce config.h
# config.h is needed to insert TREXIO_PACKAGE_VERSION and TREXIO_GIT_HASH into trexio.h
configure_file(${CMAKE_SOURCE_DIR}/include/cmake_config.h.in
${CMAKE_SOURCE_DIR}/include/config.h)
${CMAKE_SOURCE_DIR}/include/config.h
@ONLY)
endif()
# Set directories to be included at build time.

View File

@ -1,4 +1,17 @@
# ============= THREADS SUPPORT ==============
# the two options below add preference for the pthread library over other system-wide threads implementations
set(CMAKE_THREAD_PREFER_PTHREAD TRUE)
set(THREADS_PREFER_PTHREAD_FLAG TRUE)
# find thread library
find_package(Threads REQUIRED)
# ============= STDINT SUPPORT ===============
include(CheckIncludeFile)
check_include_file(stdint.h HAVE_STDINT_H)
# ========= DEFINE TREXIO C LIBRARY =========
# Set a list of TREXIO source and header files that are always compiled.