Skip to content
Snippets Groups Projects
Commit 48a40e04 authored by Sergey Kosukhin's avatar Sergey Kosukhin
Browse files

cmake: save redundant include

parent aea3b3c2
No related branches found
No related tags found
1 merge request!50Refactor CMake scripts
......@@ -3,7 +3,17 @@
# SPDX-License-Identifier: BSD-3-Clause
#
include("${CMAKE_CURRENT_SOURCE_DIR}/example_helper.cmake")
function(mtime_add_example test_name file_name)
cmake_parse_arguments(PARSE_ARGV 2 ARG "" "" "LIBRARIES;DEPENDS")
add_executable("${test_name}" ${file_name} ${ARG_DEPENDS})
target_link_libraries("${test_name}" PRIVATE mtime::mtime ${ARG_LIBRARIES})
set_target_properties(${test_name} PROPERTIES Fortran_PREPROCESS ON)
if(MT_ENABLE_MIXED_PRECISION)
target_compile_definitions(${test_name} PRIVATE __MIXED_PRECISION)
endif()
endfunction()
mtime_add_example(callback_test callback_test.f90)
......
# Copyright (c) 2013-2024 MPI-M, Luis Kornblueh, Rahul Sinha and DWD, Florian Prill. All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
#
function(mtime_add_example test_name file_name)
cmake_parse_arguments(PARSE_ARGV 2 ARG "" "" "LIBRARIES;DEPENDS")
add_executable("${test_name}" ${file_name} ${ARG_DEPENDS})
target_link_libraries("${test_name}" PRIVATE mtime::mtime ${ARG_LIBRARIES})
set_target_properties(${test_name} PROPERTIES Fortran_PREPROCESS ON)
if(MT_ENABLE_MIXED_PRECISION)
target_compile_definitions(${test_name} PRIVATE __MIXED_PRECISION)
endif()
endfunction()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment