From 4f7c018e3449c1b88cbd9103eebae2dad41779d6 Mon Sep 17 00:00:00 2001 From: Mischa Spiegelmock Date: Sat, 22 Mar 2025 22:20:31 -0700 Subject: [PATCH] CMakeLists.txt is needed --- .../tests/header-check/CMakeLists.txt | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 src/playlist/tests/header-check/CMakeLists.txt diff --git a/src/playlist/tests/header-check/CMakeLists.txt b/src/playlist/tests/header-check/CMakeLists.txt new file mode 100644 index 000000000..dc32e61e8 --- /dev/null +++ b/src/playlist/tests/header-check/CMakeLists.txt @@ -0,0 +1,21 @@ +# CMakeLists.txt in tests/header-check +cmake_minimum_required(VERSION 3.15) +project(PublicHeaderCheck C) + +# Set this to your install prefix or build tree path +set(PM_INCLUDE_DIR "/usr/local/include") + +# List your public headers here +set(PUBLIC_HEADERS + "${PM_INCLUDE_DIR}/projectM-4/playlist.h" +) + +# Generate dummy .c files that just include the headers +foreach(header IN LISTS PUBLIC_HEADERS) + get_filename_component(header_file "${header}" NAME) + set(test_source "${CMAKE_BINARY_DIR}/check_${header_file}.c") + + file(WRITE "${test_source}" "#include \"${header}\"\nint main(void) { return 0; }\n") + add_executable("check_${header_file}" "${test_source}") + target_include_directories("check_${header_file}" PRIVATE "${PM_INCLUDE_DIR}") +endforeach()