Skip to content

Commit 8d48e9f

Browse files
committed
rearrange by example directory
1 parent ba91e3f commit 8d48e9f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+242
-203
lines changed

CMakeLists.txt

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,21 @@ project(Fortran_C_CXX_interface
44
LANGUAGES C CXX Fortran
55
VERSION 1.3.0)
66

7-
include(CTest)
7+
enable_testing()
88

99
include (cmake/compilers.cmake)
1010

11-
add_subdirectory(src)
11+
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR})
12+
13+
foreach(d array bool error opaque pointer poly_function poly_type struct submodule tictoc vector)
14+
set(td src/${d})
15+
add_subdirectory(${td})
16+
get_property(targets DIRECTORY ${td} PROPERTY BUILDSYSTEM_TARGETS)
17+
18+
foreach(t IN LISTS targets)
19+
target_compile_features(${t} PRIVATE c_std_99)
20+
target_compile_features(${t} PRIVATE cxx_std_11)
21+
endforeach()
22+
endforeach()
23+
24+
# --- props

README.md

Lines changed: 2 additions & 10 deletions

src/CMakeLists.txt

Lines changed: 0 additions & 5 deletions
This file was deleted.

src/array/CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
set_directory_properties(PROPERTIES LABELS array)
2+
3+
add_executable(cxx_fortran_array main.cpp)
4+
target_link_libraries(cxx_fortran_array PRIVATE vector_fortran)
5+
add_test(NAME C++_Fortran_array COMMAND cxx_fortran_array)
6+
7+
get_property(test_names DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY TESTS)
8+
set_tests_properties(${test_names} PROPERTIES TIMEOUT 5)
File renamed without changes.

src/bool/CMakeLists.txt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
set_directory_properties(PROPERTIES LABELS bool)
2+
3+
add_library(bool_fortran lib.f90)
4+
5+
add_executable(c_fortran_bool main.c)
6+
target_link_libraries(c_fortran_bool PRIVATE bool_fortran)
7+
add_test(NAME C_Fortran_bool COMMAND c_fortran_bool)
8+
9+
add_executable(cxx_fortran_bool main.cpp)
10+
target_link_libraries(cxx_fortran_bool PRIVATE bool_fortran)
11+
add_test(NAME C++_Fortran_bool COMMAND cxx_fortran_bool)
12+
13+
get_property(test_names DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY TESTS)
14+
set_tests_properties(${test_names} PROPERTIES TIMEOUT 5)
File renamed without changes.
File renamed without changes.
File renamed without changes.

src/c/CMakeLists.txt

Lines changed: 0 additions & 42 deletions
This file was deleted.

0 commit comments

Comments
 (0)