mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-07 22:30:13 -06:00
Merge topic 'test-makefile-custom-target-includes'
434f5cefTests: Add case for IMPLICIT_DEPENDS in custom target6d1be6e3Tests: Split RunCMake.BuildDepends make-only condition Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !766
This commit is contained in:
13
Tests/RunCMake/BuildDepends/MakeCustomIncludes.cmake
Normal file
13
Tests/RunCMake/BuildDepends/MakeCustomIncludes.cmake
Normal file
@@ -0,0 +1,13 @@
|
||||
add_custom_command(
|
||||
OUTPUT output.cxx
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/MakeCustomIncludes.cxx output.cxx
|
||||
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/MakeCustomIncludes.cxx
|
||||
IMPLICIT_DEPENDS CXX ${CMAKE_CURRENT_SOURCE_DIR}/MakeCustomIncludes.cxx)
|
||||
add_custom_target(generate ALL DEPENDS output.cxx)
|
||||
set_property(TARGET generate PROPERTY INCLUDE_DIRECTORIES ${CMAKE_CURRENT_BINARY_DIR})
|
||||
|
||||
file(GENERATE OUTPUT check-$<LOWER_CASE:$<CONFIG>>.cmake CONTENT "
|
||||
set(check_pairs
|
||||
\"${CMAKE_CURRENT_BINARY_DIR}/output.cxx|${CMAKE_CURRENT_BINARY_DIR}/MakeCustomIncludes.h\"
|
||||
)
|
||||
")
|
||||
6
Tests/RunCMake/BuildDepends/MakeCustomIncludes.cxx
Normal file
6
Tests/RunCMake/BuildDepends/MakeCustomIncludes.cxx
Normal file
@@ -0,0 +1,6 @@
|
||||
#include "MakeCustomIncludes.h"
|
||||
|
||||
int main()
|
||||
{
|
||||
return MakeCustomIncludes();
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
file(WRITE "${RunCMake_TEST_BINARY_DIR}/MakeCustomIncludes.h" [[
|
||||
inline int MakeCustomIncludes() { return 1; }
|
||||
]])
|
||||
@@ -0,0 +1,3 @@
|
||||
file(WRITE "${RunCMake_TEST_BINARY_DIR}/MakeCustomIncludes.h" [[
|
||||
inline int MakeCustomIncludes() { return 2; }
|
||||
]])
|
||||
@@ -43,9 +43,11 @@ endif()
|
||||
run_BuildDepends(Custom-Symbolic-and-Byproduct)
|
||||
run_BuildDepends(Custom-Always)
|
||||
|
||||
if(RunCMake_GENERATOR MATCHES "Make" AND
|
||||
NOT "${RunCMake_BINARY_DIR}" STREQUAL "${RunCMake_SOURCE_DIR}")
|
||||
run_BuildDepends(MakeInProjectOnly)
|
||||
if(RunCMake_GENERATOR MATCHES "Make")
|
||||
run_BuildDepends(MakeCustomIncludes)
|
||||
if(NOT "${RunCMake_BINARY_DIR}" STREQUAL "${RunCMake_SOURCE_DIR}")
|
||||
run_BuildDepends(MakeInProjectOnly)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
function(run_ReGeneration)
|
||||
|
||||
Reference in New Issue
Block a user