Skip to content
Snippets Groups Projects
Commit 566a463c authored by Dmitri Naumov's avatar Dmitri Naumov
Browse files

CheckHeader; Use long name for compile test.

parent a822ff34
No related branches found
No related tags found
No related merge requests found
...@@ -58,21 +58,24 @@ function(_check_header_compilation TARGET) ...@@ -58,21 +58,24 @@ function(_check_header_compilation TARGET)
continue() continue()
endif() endif()
string(REPLACE "${PROJECT_SOURCE_DIR}/" "" TEST_NAME ${FILE})
string(REPLACE "." "_" TEST_NAME ${TEST_NAME})
string(REPLACE "/" "_" TEST_NAME ${TEST_NAME})
check_cxx_source_compiles( check_cxx_source_compiles(
" "
#include \"${FILE}\" #include \"${FILE}\"
int main() { return 0; } int main() { return 0; }
" "
COMPILES ${TEST_NAME}_COMPILES
) )
if(NOT COMPILES) if(NOT ${TEST_NAME}_COMPILES)
set(HEADER_COMPILE_ERROR TRUE CACHE INTERNAL "") set(HEADER_COMPILE_ERROR TRUE CACHE INTERNAL "")
string(REPLACE "${PROJECT_SOURCE_DIR}/" "" FILE_SHORT ${FILE}) message(STATUS " Compilation failed for ${FILE}")
message(STATUS " Compilation failed for ${FILE_SHORT}")
endif() endif()
unset(COMPILES CACHE) unset(${TEST_NAME}_COMPILES CACHE)
unset(TEST_NAME)
endforeach() endforeach()
endfunction() endfunction()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment