mirror of
https://github.com/Mr-X-GTA/GTAV-Classes-1.git
synced 2024-12-22 14:37:31 +08:00
feat: Add CMake project to make sure that headers can be compiled, individually
This commit is contained in:
parent
66aae96933
commit
5b4467d548
36
CMakeLists.txt
Normal file
36
CMakeLists.txt
Normal file
@ -0,0 +1,36 @@
|
||||
cmake_minimum_required(VERSION 3.11)
|
||||
|
||||
project(GTAV-Classes)
|
||||
|
||||
include(CheckIncludeFileCXX)
|
||||
|
||||
set(CMAKE_CXX_EXTENSIONS OFF)
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
|
||||
set(CMAKE_REQUIRED_QUIET ON)
|
||||
|
||||
set(OK TRUE)
|
||||
|
||||
file(GLOB HEADERS "*.hpp")
|
||||
|
||||
message(STATUS "")
|
||||
|
||||
foreach(HEADER ${HEADERS})
|
||||
get_filename_component(FILENAME ${HEADER} NAME)
|
||||
check_include_file_cxx("${HEADER}" ${FILENAME}_OK)
|
||||
|
||||
if(${FILENAME}_OK)
|
||||
message(STATUS "${FILENAME} OK!")
|
||||
else()
|
||||
set(OK FALSE)
|
||||
message(SEND_ERROR "${FILENAME} failed to compile!")
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
message(STATUS "")
|
||||
|
||||
if(NOT OK)
|
||||
file(READ "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/CMakeError.log" LOG)
|
||||
message(STATUS ${LOG})
|
||||
endif()
|
Loading…
Reference in New Issue
Block a user