File tree Expand file tree Collapse file tree 15 files changed +110
-0
lines changed Expand file tree Collapse file tree 15 files changed +110
-0
lines changed Original file line number Diff line number Diff line change @@ -163,6 +163,12 @@ file(COPY ${PROJECT_BINARY_DIR}/update_gh-pages.py
163163 FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ
164164 GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
165165
166+ configure_file (${PROJECT_SOURCE_DIR} /tools/counter.py.in counter.py)
167+ file (COPY ${PROJECT_BINARY_DIR} /counter.py
168+ DESTINATION ${PROJECT_BINARY_DIR} /bin
169+ FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ
170+ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
171+
166172# To be includes as system headers
167173include_directories (SYSTEM
168174 ${EIGEN3_INCLUDE_DIR}
Original file line number Diff line number Diff line change @@ -67,3 +67,13 @@ macro(write_to_Includer headers_list)
6767 file (APPEND "${PROJECT_BINARY_DIR} /include/Includer.hpp" "#include \" ${header} \"\n " )
6868 endforeach ()
6969endmacro ()
70+
71+ macro (write_to_cloc_list list_of_sources)
72+ get_filename_component (lib ${CMAKE_CURRENT_SOURCE_DIR} NAME )
73+ if (EXISTS "${PROJECT_BINARY_DIR} /cloc_lists/cloc_list-${lib} " )
74+ file (REMOVE "${PROJECT_BINARY_DIR} /cloc_lists/cloc_list-${lib} " )
75+ endif ()
76+ foreach (source ${list_of_sources} )
77+ file (APPEND "${PROJECT_BINARY_DIR} /cloc_lists/cloc_list-${lib} " "${PROJECT_SOURCE_DIR} /src/${lib} /${source} \n " )
78+ endforeach ()
79+ endmacro ()
Original file line number Diff line number Diff line change @@ -16,6 +16,11 @@ get_cpp_sources(sources_list)
1616# If you want to remove some sources specify them explictly here
1717list (REMOVE_ITEM sources_list "" )
1818
19+ # Write list of files to be passed to cloc for counting lines of code.
20+ # Only files that are actually compiled are counted.
21+ set (to_count "${sources_list} " "${headers_list} " )
22+ write_to_cloc_list("${to_count} " )
23+
1924# Build static library
2025add_library (cavity STATIC ${sources_list} )
2126set (libs_to_merge cavity ${libs_to_merge} PARENT_SCOPE)
Original file line number Diff line number Diff line change @@ -17,6 +17,11 @@ get_cpp_sources(sources_list)
1717# If you want to remove some sources specify them explictly here
1818list (REMOVE_ITEM sources_list "" )
1919
20+ # Write list of files to be passed to cloc for counting lines of code.
21+ # Only files that are actually compiled are counted.
22+ set (to_count "${sources_list} " "${headers_list} " )
23+ write_to_cloc_list("${to_count} " )
24+
2025# Build static library
2126add_library (green STATIC ${sources_list} )
2227set (libs_to_merge green ${libs_to_merge} PARENT_SCOPE)
Original file line number Diff line number Diff line change @@ -10,6 +10,11 @@ get_cpp_sources(sources_list)
1010# If you want to remove some sources specify them explictly here
1111list (REMOVE_ITEM sources_list "" )
1212
13+ # Write list of files to be passed to cloc for counting lines of code.
14+ # Only files that are actually compiled are counted.
15+ set (to_count "${sources_list} " "${headers_list} " )
16+ write_to_cloc_list("${to_count} " )
17+
1318# Build static library
1419add_library (interface STATIC ${sources_list} )
1520set (libs_to_merge interface ${libs_to_merge} PARENT_SCOPE)
Original file line number Diff line number Diff line change @@ -4,6 +4,11 @@ get_fortran_sources(sources_list)
44# If you want to remove some sources specify them explictly here
55list (REMOVE_ITEM sources_list "" )
66
7+ # Write list of files to be passed to cloc for counting lines of code.
8+ # Only files that are actually compiled are counted.
9+ set (to_count "${sources_list} " "${headers_list} " )
10+ write_to_cloc_list("${to_count} " )
11+
712# Build static library
813add_library (metal STATIC ${sources_list} )
914set (libs_to_merge metal ${libs_to_merge} PARENT_SCOPE)
Original file line number Diff line number Diff line change @@ -17,6 +17,11 @@ get_cpp_sources(sources_list)
1717# If you want to remove some sources specify them explictly here
1818list (REMOVE_ITEM sources_list "" )
1919
20+ # Write list of files to be passed to cloc for counting lines of code.
21+ # Only files that are actually compiled are counted.
22+ set (to_count "${sources_list} " "${headers_list} " )
23+ write_to_cloc_list("${to_count} " )
24+
2025# Build static library
2126add_library (operators_diagonal STATIC ${sources_list} )
2227set (libs_to_merge operators_diagonal ${libs_to_merge} PARENT_SCOPE)
Original file line number Diff line number Diff line change @@ -4,6 +4,11 @@ get_fortran_sources(sources_list)
44# If you want to remove some sources specify them explictly here
55list (REMOVE_ITEM sources_list "" )
66
7+ # Write list of files to be passed to cloc for counting lines of code.
8+ # Only files that are actually compiled are counted.
9+ set (to_count "${sources_list} " "${headers_list} " )
10+ write_to_cloc_list("${to_count} " )
11+
712# Build static library
813add_library (pedra STATIC ${sources_list} )
914set (libs_to_merge pedra ${libs_to_merge} PARENT_SCOPE)
Original file line number Diff line number Diff line change @@ -10,6 +10,11 @@ get_c_sources(sources_list)
1010# If you want to remove some sources specify them explictly here
1111list (REMOVE_ITEM sources_list "main_pwl.c" )
1212
13+ # Write list of files to be passed to cloc for counting lines of code.
14+ # Only files that are actually compiled are counted.
15+ set (to_count "${sources_list} " "${headers_list} " )
16+ write_to_cloc_list("${to_count} " )
17+
1318# Override global compiler flags to avoid choking stdout with warnings
1419set_pwl_compiler_flags()
1520# Build static library
Original file line number Diff line number Diff line change @@ -15,6 +15,11 @@ get_cpp_sources(sources_list)
1515# If you want to remove some sources specify them explictly here
1616list (REMOVE_ITEM sources_list "" )
1717
18+ # Write list of files to be passed to cloc for counting lines of code.
19+ # Only files that are actually compiled are counted.
20+ set (to_count "${sources_list} " "${headers_list} " )
21+ write_to_cloc_list("${to_count} " )
22+
1823# Build static library
1924add_library (solver STATIC ${sources_list} )
2025set (libs_to_merge solver ${libs_to_merge} PARENT_SCOPE)
You can’t perform that action at this time.
0 commit comments