File tree 1 file changed +21
-0
lines changed
1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change
1
+ # CMakeLists.txt in tests/header-check
2
+ cmake_minimum_required (VERSION 3.15)
3
+ project (PublicHeaderCheck C)
4
+
5
+ # Set this to your install prefix or build tree path
6
+ set (PM_INCLUDE_DIR "/usr/local/include" )
7
+
8
+ # List your public headers here
9
+ set (PUBLIC_HEADERS
10
+ "${PM_INCLUDE_DIR} /projectM-4/playlist.h"
11
+ )
12
+
13
+ # Generate dummy .c files that just include the headers
14
+ foreach (header IN LISTS PUBLIC_HEADERS)
15
+ get_filename_component (header_file "${header} " NAME )
16
+ set (test_source "${CMAKE_BINARY_DIR} /check_${header_file} .c" )
17
+
18
+ file (WRITE "${test_source} " "#include \" ${header} \"\n int main(void) { return 0; }\n " )
19
+ add_executable ("check_${header_file} " "${test_source} " )
20
+ target_include_directories ("check_${header_file} " PRIVATE "${PM_INCLUDE_DIR} " )
21
+ endforeach ()
You can’t perform that action at this time.
0 commit comments