mirror of
https://github.com/projectM-visualizer/projectm.git
synced 2026-02-04 20:55:46 +00:00
This will enable any future changes to the header to be tested. These additional build checks are only executed if BUILD_TESTING is enabled (e.g. in our automated build checks) to speed up release builds.
21 lines
720 B
CMake
21 lines
720 B
CMake
cmake_minimum_required(VERSION 3.21 FATAL_ERROR)
|
|
|
|
project(TestAPIHeaders
|
|
LANGUAGES C
|
|
)
|
|
|
|
include(CheckIncludeFile)
|
|
|
|
set(CMAKE_REQUIRED_INCLUDES "${INCLUDE_DIRS}")
|
|
|
|
foreach(INCLUDE_HEADER ${INCLUDE_FILES})
|
|
cmake_path(GET INCLUDE_HEADER FILENAME INCLUDE_FILENAME)
|
|
string(REPLACE "." "_" INCLUDE_FILENAME "${INCLUDE_FILENAME}")
|
|
check_include_file(${INCLUDE_HEADER} PROJECTM_${INCLUDE_FILENAME}_INCLUDE_OK)
|
|
if(NOT PROJECTM_${INCLUDE_FILENAME}_INCLUDE_OK)
|
|
message(FATAL_ERROR "projectM API include file ${INCLUDE_HEADER} does not compile on its own!\nSee logs in ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/ for additional information.")
|
|
endif()
|
|
endforeach()
|
|
|
|
file(TOUCH ${OUTPUT_FILE})
|