1
1
cmake_minimum_required (VERSION 3.12)
2
- project (libdistributed VERSION "0.0.11 " LANGUAGES CXX)
2
+ project (libdistributed VERSION "0.1.0 " LANGUAGES CXX)
3
3
4
4
#correct was to set a default build type
5
5
# https://blog.kitware.com/cmake-and-the-default-build-type/
@@ -15,21 +15,12 @@ endif()
15
15
include (CTest)
16
16
set (CMAKE_EXPORT_COMPILE_COMMANDS ON )
17
17
18
- set (default_cxx_standard 17)
19
- if (NOT LIBDISTRIBUTED_CXX_VERSION)
20
- set (LIBDISTRIBUTED_CXX_VERSION ${default_cxx_standard} CACHE
21
- STRING "Which version of the cxx standard to expect" FORCE)
22
- set_property (CACHE LIBDISTRIBUTED_CXX_VERSION PROPERTY STRINGS 17)
23
- endif ()
24
-
25
18
function (check_cpp_standard api)
26
19
string (TOUPPER "${api} " HEADER_SUFFIX)
27
20
try_compile (
28
21
COMPILED
29
22
${CMAKE_BINARY_DIR}
30
23
SOURCES "${CMAKE_SOURCE_DIR} /checks/${api} .cc"
31
- CXX_STANDARD ${LIBDISTRIBUTED_CXX_VERSION}
32
- CXX_STANDARD_REQUIRED ON
33
24
)
34
25
message (STATUS "Checking for ${api} : ${COMPILED} " )
35
26
set (LIBDISTRIBUTED_COMPAT_HAS_${HEADER_SUFFIX} ${COMPILED} PARENT_SCOPE)
@@ -44,7 +35,8 @@ configure_file(
44
35
45
36
include (GNUInstallDirs)
46
37
47
- find_package (MPI COMPONENTS CXX)
38
+ find_package (std_compat REQUIRED)
39
+ find_package (MPI COMPONENTS CXX REQUIRED)
48
40
49
41
option (BUILD_SHARED_LIBS "BUILD SHARED LIBRARIES" ON )
50
42
add_library (libdistributed
@@ -66,8 +58,7 @@ target_include_directories(
66
58
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR} /include >
67
59
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR} /libdistributed>
68
60
)
69
- target_link_libraries ( libdistributed PUBLIC MPI::MPI_CXX)
70
- target_compile_features (libdistributed PUBLIC cxx_std_${LIBDISTRIBUTED_CXX_VERSION} )
61
+ target_link_libraries ( libdistributed PUBLIC MPI::MPI_CXX std_compat::std_compat)
71
62
72
63
option (USE_CLANG_TIDY "include clang-tidy warnings in the build log" OFF )
73
64
if (USE_CLANG_TIDY)
0 commit comments