Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
cmake_minimum_required(VERSION 3.13)
cmake_minimum_required(VERSION 3.18)

set (EKAT_CMAKE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake CACHE INTERNAL "")

# Do not ignore <PackageName_ROOT> env vars in find_package() calls
if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.12.0")
cmake_policy (SET CMP0074 NEW)
endif(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.12.0")
cmake_policy (SET CMP0074 NEW)

# Add our own cmake goodies to cmake module search path
list(APPEND CMAKE_MODULE_PATH
Expand All @@ -29,9 +27,9 @@ endif()
include(EkatUtils)
IsDebugBuild(EKAT_IS_DEBUG_BUILD)

set (EKAT_VERSION_MAJOR 1)
set (EKAT_VERSION_MAJOR 2)
set (EKAT_VERSION_MINOR 0)
set (EKAT_VERSION_PATCH 1)
set (EKAT_VERSION_PATCH 0)

message(STATUS "EKAT version: ${EKAT_VERSION_MAJOR}.${EKAT_VERSION_MINOR}.${EKAT_VERSION_PATCH}")

Expand Down
10 changes: 4 additions & 6 deletions cmake/EkatCreateUnitTest.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -57,19 +57,17 @@ function(EkatCreateUnitTestExec exec_name exec_srcs)
# Create the executable and set its properties #
#-------------------------------------------------#

# Set link directories (must be done BEFORE add_executable is called)
# NOTE: CMake 3.15 adds 'target_link_directories', which is superior (does not pollute other targets).
# We should switch to that as soon as we can assume CMAKE_VERSION >= 3.15.
set(target_name ${exec_name})
if (ecute_LIBS_DIRS)
link_directories("${ecute_LIBS_DIRS}")
endif()
add_executable(${target_name} ${exec_srcs})

#---------------------------#
# Set all target properties #
#---------------------------#

if (ecute_LIBS_DIRS)
target_link_directories(${target_name} PRIVATE "${ecute_LIBS_DIRS}")
endif()

target_link_libraries (${exec_name} PUBLIC Catch2::Catch2)

# Include dirs
Expand Down
9 changes: 2 additions & 7 deletions cmake/EkatUtils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -126,13 +126,8 @@ macro (EkatDisableAllWarning targetName)
$<$<COMPILE_LANGUAGE:C>:$<$<C_COMPILER_ID:GNU>:-w> $<$<C_COMPILER_ID:Intel>: -w>>)
target_compile_options (${targetName} PRIVATE
$<$<COMPILE_LANGUAGE:CXX>:$<$<CXX_COMPILER_ID:GNU>:-w -fcompare-debug-second> $<$<CXX_COMPILER_ID:Intel>: -w>>)
if (${CMAKE_VERSION} VERSION_LESS "3.14.0")
target_compile_options (${targetName} PRIVATE
$<$<COMPILE_LANGUAGE:Fortran>:$<$<STREQUAL:"${CMAKE_Fortran_COMPILER_ID}","GNU">:-w> $<$<STREQUAL:"${CMAKE_Fortran_COMPILER_ID}","Intel">: -w>>)
else ()
target_compile_options (${targetName} PRIVATE
$<$<COMPILE_LANGUAGE:Fortran>:$<$<Fortran_COMPILER_ID:GNU>:-w> $<$<Fortran_COMPILER_ID:Intel>: -w>>)
endif()
target_compile_options (${targetName} PRIVATE
$<$<COMPILE_LANGUAGE:Fortran>:$<$<Fortran_COMPILER_ID:GNU>:-w> $<$<Fortran_COMPILER_ID:Intel>: -w>>)
endmacro (EkatDisableAllWarning)

function(separate_cut_arguments prefix options oneValueArgs multiValueArgs return_varname)
Expand Down
13 changes: 1 addition & 12 deletions cmake/tpls/EkatBuildCatch2.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,4 @@ FetchContent_Declare(Catch2
BINARY_DIR ${EKAT_BINARY_DIR}/extern/Catch2
)

# MakeAvailable is better, but we need CMake>=3.14...
if(CMAKE_VERSION VERSION_LESS "3.14")
# Legacy path for CMake 3.11 - 3.13
FetchContent_GetProperties(Catch2)
if(NOT catch2_POPULATED)
FetchContent_Populate(Catch2)
add_subdirectory(${catch2_SOURCE_DIR} ${catch2_BINARY_DIR})
endif()
else()
# Modern path for 3.14+ (Silences CMP0169 in 3.30+)
FetchContent_MakeAvailable(Catch2)
endif()
FetchContent_MakeAvailable(Catch2)
13 changes: 1 addition & 12 deletions cmake/tpls/EkatBuildSpdlog.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,7 @@ FetchContent_Declare(spdlog
BINARY_DIR ${EKAT_BINARY_DIR}/extern/spdlog
)

# MakeAvailable is better, but we need CMake>=3.14...
if(CMAKE_VERSION VERSION_LESS "3.14")
# Legacy path for CMake 3.11 - 3.13
FetchContent_GetProperties(spdlog)
if(NOT spdlog_POPULATED)
FetchContent_Populate(spdlog)
add_subdirectory (${spdlog_SOURCE_DIR} ${spdlog_BINARY_DIR})
endif()
else()
# Modern path for 3.14+ (Silences CMP0169 in 3.30+)
FetchContent_MakeAvailable(spdlog)
endif()
FetchContent_MakeAvailable(spdlog)

if (EKAT_DISABLE_TPL_WARNINGS)
include (EkatUtils)
Expand Down
13 changes: 1 addition & 12 deletions cmake/tpls/EkatBuildYamlCpp.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,7 @@ FetchContent_Declare(yaml-cpp
BINARY_DIR ${EKAT_BINARY_DIR}/extern/yaml-cpp
)

# MakeAvailable is better, but we need CMake>=3.14...
if(CMAKE_VERSION VERSION_LESS "3.14")
# Legacy path for CMake 3.11 - 3.13
FetchContent_GetProperties(yaml-cpp)
if(NOT yaml-cpp_POPULATED)
FetchContent_Populate(yaml-cpp)
add_subdirectory (${yaml-cpp_SOURCE_DIR} ${yaml-cpp_BINARY_DIR})
endif()
else()
# Modern path for 3.14+ (Silences CMP0169 in 3.30+)
FetchContent_MakeAvailable(yaml-cpp)
endif()
FetchContent_MakeAvailable(yaml-cpp)

if (EKAT_DISABLE_TPL_WARNINGS)
include (EkatUtils)
Expand Down
Loading