diff options
Diffstat (limited to 'Tests')
412 files changed, 7266 insertions, 4766 deletions
diff --git a/Tests/BuildDepends/CMakeLists.txt b/Tests/BuildDepends/CMakeLists.txt index c1ad17c..5ddae83 100644 --- a/Tests/BuildDepends/CMakeLists.txt +++ b/Tests/BuildDepends/CMakeLists.txt @@ -368,6 +368,28 @@ is not newer than dependency ${TEST_LINK_DEPENDS} ") endif() + + set(linkdep3 ${BuildDepends_BINARY_DIR}/Project/linkdep3${CMAKE_EXECUTABLE_SUFFIX}) + if(${linkdep3} IS_NEWER_THAN ${TEST_LINK_DEPENDS}) + message("$<LINK_LANGUAGE> in LINK_DEPENDS worked") + else() + message(SEND_ERROR "$<LINK_LANGUAGE> in LINK_DEPENDS failed. Executable + ${linkdep3} +is not newer than dependency + ${TEST_LINK_DEPENDS} +") + endif() + + set(linkdep4 ${BuildDepends_BINARY_DIR}/Project/linkdep4${CMAKE_EXECUTABLE_SUFFIX}) + if(${linkdep4} IS_NEWER_THAN ${TEST_LINK_DEPENDS}) + message("$<LINK_LANGUAGE> in INTERFACE_LINK_DEPENDS worked") + else() + message(SEND_ERROR "$<LINK_LANGUAGE> in INTERFACE_LINK_DEPENDS failed. Executable + ${linkdep4} +is not newer than dependency + ${TEST_LINK_DEPENDS} +") + endif() endif() if(EXISTS "${link_depends_no_shared_check_txt}") diff --git a/Tests/BuildDepends/Project/CMakeLists.txt b/Tests/BuildDepends/Project/CMakeLists.txt index 8338800..83583c9 100644 --- a/Tests/BuildDepends/Project/CMakeLists.txt +++ b/Tests/BuildDepends/Project/CMakeLists.txt @@ -118,6 +118,14 @@ if(TEST_LINK_DEPENDS) set_property(TARGET foo_interface PROPERTY INTERFACE_LINK_DEPENDS $<1:${TEST_LINK_DEPENDS}>) add_executable(linkdep2 linkdep.cxx) target_link_libraries(linkdep2 PRIVATE foo_interface) + + add_executable(linkdep3 linkdep.cxx) + set_property(TARGET linkdep3 PROPERTY LINK_DEPENDS $<$<LINK_LANGUAGE:CXX>:${TEST_LINK_DEPENDS}>) + + add_library(foo_interface2 INTERFACE) + set_property(TARGET foo_interface2 PROPERTY INTERFACE_LINK_DEPENDS $<$<LINK_LANGUAGE:CXX>:${TEST_LINK_DEPENDS}>) + add_executable(linkdep4 linkdep.cxx) + target_link_libraries(linkdep4 PRIVATE foo_interface2) endif() add_library(link_depends_no_shared_lib SHARED link_depends_no_shared_lib.c diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 33c7514..6f86a5f 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -1605,7 +1605,7 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH DEPENDS ExternalProjectUpdateSetup ) # do each of the tutorial steps - function(add_tutorial_test step_name use_mymath) + function(add_tutorial_test step_name use_mymath tutorial_arg pass_regex) set(tutorial_test_name Tutorial${step_name}) set(tutorial_build_dir "${CMake_BINARY_DIR}/Tests/Tutorial/${step_name}") if (use_mymath) @@ -1623,19 +1623,28 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH ${build_generator_args} --build-project Tutorial --build-options ${tutorial_build_options} - --test-command Tutorial 25.0) + --test-command Tutorial ${tutorial_arg}) + set_tests_properties(${tutorial_test_name} PROPERTIES + PASS_REGULAR_EXPRESSION ${pass_regex}) + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/${tutorial_build_dir}_Build") endfunction() if(NOT CMake_TEST_EXTERNAL_CMAKE) foreach(STP RANGE 2 12) - add_tutorial_test(Step${STP} TRUE) + if (STP EQUAL 6) + set(pass_regex ".*using log and exp") + else() + set(pass_regex "The square root of 25 is 5") + endif() + add_tutorial_test(Step${STP} TRUE 25 ${pass_regex}) endforeach() - add_tutorial_test(Complete TRUE) + set(pass_regex "The square root of 25 is 5") + add_tutorial_test(Complete TRUE 25 ${pass_regex}) foreach(STP RANGE 3 12) - add_tutorial_test(Step${STP} FALSE) + add_tutorial_test(Step${STP} FALSE 25 ${pass_regex}) endforeach() - add_tutorial_test(Complete FALSE) + add_tutorial_test(Complete FALSE 25 ${pass_regex}) endif() add_test(testing ${CMAKE_CTEST_COMMAND} -C \${CTEST_CONFIGURATION_TYPE} diff --git a/Tests/CMakeOnly/AllFindModules/CMakeLists.txt b/Tests/CMakeOnly/AllFindModules/CMakeLists.txt index a53e441..49a4041 100644 --- a/Tests/CMakeOnly/AllFindModules/CMakeLists.txt +++ b/Tests/CMakeOnly/AllFindModules/CMakeLists.txt @@ -86,7 +86,7 @@ foreach(VTEST ALSA ARMADILLO BZIP2 CUPS CURL EXPAT FREETYPE GETTEXT GIT HG endforeach() foreach(VTEST BISON Boost CUDA DOXYGEN FLEX GIF GTK2 - HDF5 JPEG LibArchive OPENSCENEGRAPH RUBY SWIG Protobuf) + HDF5 JPEG LibArchive OPENSCENEGRAPH Ruby RUBY SWIG Protobuf) check_version_string(${VTEST} ${VTEST}_VERSION) endforeach() diff --git a/Tests/CSharpOnly/CMakeLists.txt b/Tests/CSharpOnly/CMakeLists.txt index 82049c7..42cbe2e 100644 --- a/Tests/CSharpOnly/CMakeLists.txt +++ b/Tests/CSharpOnly/CMakeLists.txt @@ -2,7 +2,9 @@ project (CSharpOnly CSharp) # C# does not make any difference between STATIC and SHARED libs -add_library(lib1 STATIC lib1.cs) +add_library(lib1 STATIC lib1.cs nested/lib1.cs) +#without the source group this test will fail to compile +source_group(nested FILES nested/lib1.cs) add_library(lib2 SHARED lib2.cs) add_executable(CSharpOnly csharponly.cs) diff --git a/Tests/CSharpOnly/csharponly.cs b/Tests/CSharpOnly/csharponly.cs index ad4641a..3890c82 100644 --- a/Tests/CSharpOnly/csharponly.cs +++ b/Tests/CSharpOnly/csharponly.cs @@ -5,10 +5,8 @@ namespace CSharpOnly public static void Main(string[] args) { int val = Lib1.getResult(); - Lib2 l = new Lib2(); - val = l.myVal; - + val = val + l.myVal + nested.Lib1.getResult(); return; } } diff --git a/Tests/CSharpOnly/nested/lib1.cs b/Tests/CSharpOnly/nested/lib1.cs new file mode 100644 index 0000000..c2fde4b --- /dev/null +++ b/Tests/CSharpOnly/nested/lib1.cs @@ -0,0 +1,13 @@ +namespace CSharpOnly +{ + namespace nested + { + public class Lib1 + { + public static int getResult() + { + return 23; + } + } + } +} diff --git a/Tests/FindPython/ArtifactsInteractive/CMakeLists.txt b/Tests/FindPython/ArtifactsInteractive/CMakeLists.txt new file mode 100644 index 0000000..524be92 --- /dev/null +++ b/Tests/FindPython/ArtifactsInteractive/CMakeLists.txt @@ -0,0 +1,24 @@ +cmake_minimum_required(VERSION 3.1) + +project(TestArtifactsInteractive LANGUAGES C) + +set (components Interpreter Development) +if (CMake_TEST_FindPython_NumPy) + list (APPEND components NumPy) +endif() + +find_package(Python3 REQUIRED COMPONENTS ${components}) + +if (Python3_ARTIFACTS_INTERACTIVE) + if (NOT DEFINED CACHE{Python3_EXECUTABLE} + OR NOT DEFINED CACHE{Python3_LIBRARY} OR NOT DEFINED CACHE{Python3_INCLUDE_DIR} + OR (CMake_TEST_FindPython_NumPy AND NOT DEFINED CACHE{Python3_NumPy_INCLUDE_DIR})) + message (FATAL_ERROR "Python3_ARTIFACTS_INTERACTIVE=ON Failed.") + endif() +else() + if (DEFINED CACHE{Python3_EXECUTABLE} + OR DEFINED CACHE{Python3_LIBRARY} OR DEFINED CACHE{Python3_INCLUDE_DIR} + OR (CMake_TEST_FindPython_NumPy AND DEFINED CACHE{Python3_NumPy_INCLUDE_DIR})) + message (FATAL_ERROR "Python3_ARTIFACTS_INTERACTIVE=OFF Failed.") + endif() +endif() diff --git a/Tests/FindPython/CMakeLists.txt b/Tests/FindPython/CMakeLists.txt index 01fa6c3..d2326e4 100644 --- a/Tests/FindPython/CMakeLists.txt +++ b/Tests/FindPython/CMakeLists.txt @@ -184,6 +184,35 @@ if(CMake_TEST_FindPython) --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> ) + add_test(NAME FindPython.ArtifactsInteractive.ON COMMAND + ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> + --build-and-test + "${CMake_SOURCE_DIR}/Tests/FindPython/ArtifactsInteractive" + "${CMake_BINARY_DIR}/Tests/FindPython/ArtifactsInteractive.ON" + ${build_generator_args} + --build-project TestArtifactsScope + --build-options ${build_options} "-Dbuild_generator_args=${build_generator_args}" + "-DCMake_SOURCE_DIR=${CMake_SOURCE_DIR}" + "-DCMake_BINARY_DIR=${CMake_BINARY_DIR}" + "-DCMake_TEST_FindPython_NumPy=${CMake_TEST_FindPython_NumPy}" + "-DPython3_ARTIFACTS_INTERACTIVE=ON" + --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> + ) + add_test(NAME FindPython.ArtifactsInteractive.OFF COMMAND + ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> + --build-and-test + "${CMake_SOURCE_DIR}/Tests/FindPython/ArtifactsInteractive" + "${CMake_BINARY_DIR}/Tests/FindPython/ArtifactsInteractive.OFF" + ${build_generator_args} + --build-project TestArtifactsScope + --build-options ${build_options} "-Dbuild_generator_args=${build_generator_args}" + "-DCMake_SOURCE_DIR=${CMake_SOURCE_DIR}" + "-DCMake_BINARY_DIR=${CMake_BINARY_DIR}" + "-DCMake_TEST_FindPython_NumPy=${CMake_TEST_FindPython_NumPy}" + "-DPython3_ARTIFACTS_INTERACTIVE=OFF" + --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> + ) + add_test(NAME FindPython.CustomFailureMessage COMMAND ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> --build-and-test diff --git a/Tests/FindPython/Python3/CMakeLists.txt b/Tests/FindPython/Python3/CMakeLists.txt index 6691a48..34ebd2c 100644 --- a/Tests/FindPython/Python3/CMakeLists.txt +++ b/Tests/FindPython/Python3/CMakeLists.txt @@ -15,14 +15,14 @@ if (NOT Python3_FOUND) endif() if(NOT TARGET Python3::Interpreter) - message(SEND_ERROR "Python2::Interpreter not found") + message(SEND_ERROR "Python3::Interpreter not found") endif() if(NOT TARGET Python3::Python) - message(SEND_ERROR "Python2::Python not found") + message(SEND_ERROR "Python3::Python not found") endif() if(NOT TARGET Python3::Module) - message(SEND_ERROR "Python2::Module not found") + message(SEND_ERROR "Python3::Module not found") endif() Python3_add_library (spam3 MODULE ../spam.c) diff --git a/Tests/FindX11/Test/CMakeLists.txt b/Tests/FindX11/Test/CMakeLists.txt index 769271f..b2adfb2 100644 --- a/Tests/FindX11/Test/CMakeLists.txt +++ b/Tests/FindX11/Test/CMakeLists.txt @@ -29,6 +29,10 @@ test_x11_component(x11_components SM) set(X11_X11_FOUND ${X11_FOUND}) test_x11_component(x11_components X11) test_x11_component(x11_components Xau) +test_x11_component(x11_components xcb) +test_x11_component(x11_components X11_xcb) +test_x11_component(x11_components xcb_icccm) +test_x11_component(x11_components xcb_xkb) test_x11_component(x11_components Xcomposite) test_x11_component(x11_components Xdamage) test_x11_component(x11_components Xdmcp) @@ -41,6 +45,8 @@ test_x11_component(x11_components Xfixes) test_x11_component(x11_components_ignore Xft) test_x11_component(x11_components Xi) test_x11_component(x11_components Xinerama) +test_x11_component(x11_components xkbcommon) +test_x11_component(x11_components xkbcommon_X11) test_x11_component(x11_components Xkb) test_x11_component(x11_components xkbfile) test_x11_component(x11_components Xmu) @@ -61,6 +67,9 @@ target_link_libraries(test_var PRIVATE ${X11_LIBRARIES}) # Not included in X11_LIBRARIES. foreach(lib Xau + xcb + X11_xcb + xcb_icccm Xcomposite Xdamage Xdmcp @@ -69,6 +78,8 @@ foreach(lib Xfixes Xi Xinerama + xkbcommon + xkbcommon_X11 Xkb xkbfile Xmu diff --git a/Tests/FortranModules/CMakeLists.txt b/Tests/FortranModules/CMakeLists.txt index d056b43..b7a6f68 100644 --- a/Tests/FortranModules/CMakeLists.txt +++ b/Tests/FortranModules/CMakeLists.txt @@ -21,7 +21,7 @@ end module parent submodule ( parent ) child contains module procedure id - f = x + id = x end procedure id end submodule child program main diff --git a/Tests/FortranOnly/CMakeLists.txt b/Tests/FortranOnly/CMakeLists.txt index d945375..4327c2f 100644 --- a/Tests/FortranOnly/CMakeLists.txt +++ b/Tests/FortranOnly/CMakeLists.txt @@ -51,40 +51,36 @@ add_custom_target(checksayhello ALL ) add_dependencies(checksayhello sayhello) -# Exclude this test on IBM XL for now because the check strangely -# fails with 'ld: 0706-029 Use a number with the -H flag'. -if(NOT CMAKE_Fortran_COMPILER_ID STREQUAL XL) - set(err_log ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log) - file(REMOVE "${err_log}") - include(CheckFortranSourceCompiles) - unset(HAVE_PRINT CACHE) - CHECK_Fortran_SOURCE_COMPILES([[ +set(err_log ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log) +file(REMOVE "${err_log}") +include(CheckFortranSourceCompiles) +unset(HAVE_PRINT CACHE) +CHECK_Fortran_SOURCE_COMPILES([[ PROGRAM TEST_HAVE_PRINT PRINT *, 'Hello' END ]] HAVE_PRINT) - if(NOT HAVE_PRINT) - if(EXISTS "${err_log}") - file(READ "${err_log}" err) - endif() - string(REPLACE "\n" "\n " err " ${err}") - message(SEND_ERROR "CHECK_Fortran_SOURCE_COMPILES for HAVE_PRINT failed:\n" - "${err}") +if(NOT HAVE_PRINT) + if(EXISTS "${err_log}") + file(READ "${err_log}" err) endif() + string(REPLACE "\n" "\n " err " ${err}") + message(SEND_ERROR "CHECK_Fortran_SOURCE_COMPILES for HAVE_PRINT failed:\n" + "${err}") +endif() - unset(Fortran_BOGUS_FLAG CACHE) - include(CheckFortranCompilerFlag) - CHECK_Fortran_COMPILER_FLAG(-_this_is_not_a_flag_ Fortran_BOGUS_FLAG) - if (Fortran_BOGUS_FLAG) - message(SEND_ERROR "CHECK_Fortran_COMPILER_FLAG() succeeded, but should have failed") - endif() +unset(Fortran_BOGUS_FLAG CACHE) +include(CheckFortranCompilerFlag) +CHECK_Fortran_COMPILER_FLAG(-_this_is_not_a_flag_ Fortran_BOGUS_FLAG) +if (Fortran_BOGUS_FLAG) + message(SEND_ERROR "CHECK_Fortran_COMPILER_FLAG() succeeded, but should have failed") +endif() - unset(Fortran_RUN_FLAG CACHE) - include(CheckFortranSourceRuns) - check_fortran_source_runs("program a; end program" Fortran_RUN_FLAG SRC_EXT F90) - if(NOT Fortran_RUN_FLAG) - message(SEND_ERROR "CHECK_Fortran_SOURCE_RUNS() failed") - endif() +unset(Fortran_RUN_FLAG CACHE) +include(CheckFortranSourceRuns) +check_fortran_source_runs("program a; end program" Fortran_RUN_FLAG SRC_EXT F90) +if(NOT Fortran_RUN_FLAG) + message(SEND_ERROR "CHECK_Fortran_SOURCE_RUNS() failed") endif() # Test generation of preprocessed sources. diff --git a/Tests/ObjectLibrary/CMakeLists.txt b/Tests/ObjectLibrary/CMakeLists.txt index 7897ab9..fca5f41 100644 --- a/Tests/ObjectLibrary/CMakeLists.txt +++ b/Tests/ObjectLibrary/CMakeLists.txt @@ -73,3 +73,5 @@ add_executable(UseABstaticObjs $<TARGET_OBJECTS:UseABstatic>) target_link_libraries(UseABstaticObjs ABstatic) add_subdirectory(ExportLanguages) + +add_subdirectory(Transitive) diff --git a/Tests/ObjectLibrary/Transitive/CMakeLists.txt b/Tests/ObjectLibrary/Transitive/CMakeLists.txt new file mode 100644 index 0000000..d616cda --- /dev/null +++ b/Tests/ObjectLibrary/Transitive/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_policy(SET CMP0022 NEW) +add_library(FooStatic STATIC FooStatic.c) + +add_library(FooObject1 OBJECT FooObject.c) +target_link_libraries(FooObject1 PRIVATE FooStatic) +add_executable(Transitive1 Transitive.c) +target_link_libraries(Transitive1 PRIVATE FooObject1) + +add_library(FooObject2 OBJECT FooObject.c) +target_link_libraries(FooObject2 INTERFACE FooStatic) +add_executable(Transitive2 Transitive.c) +target_link_libraries(Transitive2 PRIVATE FooObject2) diff --git a/Tests/ObjectLibrary/Transitive/FooObject.c b/Tests/ObjectLibrary/Transitive/FooObject.c new file mode 100644 index 0000000..54c1f29 --- /dev/null +++ b/Tests/ObjectLibrary/Transitive/FooObject.c @@ -0,0 +1,4 @@ +int FooObject(void) +{ + return 0; +} diff --git a/Tests/ObjectLibrary/Transitive/FooStatic.c b/Tests/ObjectLibrary/Transitive/FooStatic.c new file mode 100644 index 0000000..84649c7 --- /dev/null +++ b/Tests/ObjectLibrary/Transitive/FooStatic.c @@ -0,0 +1,4 @@ +int FooStatic(void) +{ + return 0; +} diff --git a/Tests/ObjectLibrary/Transitive/Transitive.c b/Tests/ObjectLibrary/Transitive/Transitive.c new file mode 100644 index 0000000..43089b8 --- /dev/null +++ b/Tests/ObjectLibrary/Transitive/Transitive.c @@ -0,0 +1,7 @@ +extern int FooObject(void); +extern int FooStatic(void); + +int main(void) +{ + return FooObject() + FooStatic(); +} diff --git a/Tests/Preprocess/preprocess.c b/Tests/Preprocess/preprocess.c index 958c77e..b3117da 100644 --- a/Tests/Preprocess/preprocess.c +++ b/Tests/Preprocess/preprocess.c @@ -15,21 +15,21 @@ int check_defines_C(void) result = 0; } if (strcmp(TARGET_STRING, STRING_VALUE) != 0) { - fprintf(stderr, "TARGET_STRING has wrong value in C [%s]\n", - TARGET_STRING); + fprintf(stderr, "TARGET_STRING has wrong value in C [%s] vs [%s]\n", + TARGET_STRING, STRING_VALUE); result = 0; } { int x = 2; int y = 3; if ((FILE_EXPR) != (EXPR)) { - fprintf(stderr, "FILE_EXPR did not work in C [%s]\n", - TO_STRING(FILE_EXPR)); + fprintf(stderr, "FILE_EXPR did not work in C [%s] vs [%s]\n", + TO_STRING(FILE_EXPR), TO_STRING(EXPR)); result = 0; } if ((TARGET_EXPR) != (EXPR)) { - fprintf(stderr, "TARGET_EXPR did not work in C [%s]\n", - TO_STRING(FILE_EXPR)); + fprintf(stderr, "TARGET_EXPR did not work in C [%s] vs [%s]\n", + TO_STRING(TARGET_EXPR), TO_STRING(EXPR)); result = 0; } } diff --git a/Tests/Preprocess/preprocess.cxx b/Tests/Preprocess/preprocess.cxx index 34a69c6..f2fffef 100644 --- a/Tests/Preprocess/preprocess.cxx +++ b/Tests/Preprocess/preprocess.cxx @@ -12,25 +12,26 @@ int check_defines_CXX() { int result = 1; if (strcmp(FILE_STRING, STRING_VALUE) != 0) { - fprintf(stderr, "FILE_STRING has wrong value in CXX [%s]\n", FILE_STRING); + fprintf(stderr, "FILE_STRING has wrong value in CXX [%s] vs [%s]\n", + FILE_STRING, STRING_VALUE); result = 0; } if (strcmp(TARGET_STRING, STRING_VALUE) != 0) { - fprintf(stderr, "TARGET_STRING has wrong value in CXX [%s]\n", - TARGET_STRING); + fprintf(stderr, "TARGET_STRING has wrong value in CXX [%s] vs [%s]\n", + TARGET_STRING, STRING_VALUE); result = 0; } { int x = 2; int y = 3; if ((FILE_EXPR) != (EXPR)) { - fprintf(stderr, "FILE_EXPR did not work in CXX [%s]\n", - TO_STRING(FILE_EXPR)); + fprintf(stderr, "FILE_EXPR did not work in CXX [%s] vs [%s]\n", + TO_STRING(FILE_EXPR), TO_STRING(EXPR)); result = 0; } if ((TARGET_EXPR) != (EXPR)) { - fprintf(stderr, "TARGET_EXPR did not work in CXX [%s]\n", - TO_STRING(FILE_EXPR)); + fprintf(stderr, "TARGET_EXPR did not work in CXX [%s] vs [%s]\n", + TO_STRING(TARGET_EXPR), TO_STRING(EXPR)); result = 0; } } diff --git a/Tests/RunCMake/BuildDepends/GNU-AS-stdout.txt b/Tests/RunCMake/BuildDepends/GNU-AS-stdout.txt new file mode 100644 index 0000000..c4326ae --- /dev/null +++ b/Tests/RunCMake/BuildDepends/GNU-AS-stdout.txt @@ -0,0 +1,4 @@ +-- The ASM compiler identification is GNU +-- Found assembler: [^ +]*/as(\.exe)? +-- CMAKE_ASM_COMPILER_ID_VENDOR_MATCH='GNU assembler' diff --git a/Tests/RunCMake/BuildDepends/GNU-AS.cmake b/Tests/RunCMake/BuildDepends/GNU-AS.cmake new file mode 100644 index 0000000..21921ef --- /dev/null +++ b/Tests/RunCMake/BuildDepends/GNU-AS.cmake @@ -0,0 +1,13 @@ +enable_language(ASM) + +# Validate undocumented implementation detail. +message(STATUS "CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_MATCH='${CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_MATCH}'") + +add_library(gnu_as STATIC gnu_as.s) +target_include_directories(gnu_as PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) + +file(GENERATE OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/check-$<LOWER_CASE:$<CONFIG>>.cmake CONTENT " +set(check_pairs + \"$<TARGET_FILE:gnu_as>|${CMAKE_CURRENT_BINARY_DIR}/gnu_as.inc\" + ) +") diff --git a/Tests/RunCMake/BuildDepends/GNU-AS.step1.cmake b/Tests/RunCMake/BuildDepends/GNU-AS.step1.cmake new file mode 100644 index 0000000..15a5e96 --- /dev/null +++ b/Tests/RunCMake/BuildDepends/GNU-AS.step1.cmake @@ -0,0 +1 @@ +file(WRITE "${RunCMake_TEST_BINARY_DIR}/gnu_as.inc" "") diff --git a/Tests/RunCMake/BuildDepends/GNU-AS.step2.cmake b/Tests/RunCMake/BuildDepends/GNU-AS.step2.cmake new file mode 100644 index 0000000..15a5e96 --- /dev/null +++ b/Tests/RunCMake/BuildDepends/GNU-AS.step2.cmake @@ -0,0 +1 @@ +file(WRITE "${RunCMake_TEST_BINARY_DIR}/gnu_as.inc" "") diff --git a/Tests/RunCMake/BuildDepends/RunCMakeTest.cmake b/Tests/RunCMake/BuildDepends/RunCMakeTest.cmake index 14ae243..753417d 100644 --- a/Tests/RunCMake/BuildDepends/RunCMakeTest.cmake +++ b/Tests/RunCMake/BuildDepends/RunCMakeTest.cmake @@ -103,3 +103,8 @@ endfunction() if(RunCMake_GENERATOR STREQUAL "Xcode") run_ReGeneration(regenerate-project) endif() + +if(CMake_TEST_BuildDepends_GNU_AS) + set(ENV{ASM} "${CMake_TEST_BuildDepends_GNU_AS}") + run_BuildDepends(GNU-AS) +endif() diff --git a/Tests/RunCMake/BuildDepends/gnu_as.s b/Tests/RunCMake/BuildDepends/gnu_as.s new file mode 100644 index 0000000..a2e7dfb --- /dev/null +++ b/Tests/RunCMake/BuildDepends/gnu_as.s @@ -0,0 +1 @@ +.include "gnu_as.inc" diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index e9f8bca..101e10c 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -169,7 +169,20 @@ if(CMake_TEST_Qt5 AND Qt5Widgets_FOUND) set(autogen_with_qt5 TRUE) endif () add_RunCMake_test(Autogen -Dwith_qt5=${autogen_with_qt5}) -add_RunCMake_test(BuildDepends) +if(NOT DEFINED CMake_TEST_BuildDepends_GNU_AS + AND CMAKE_C_COMPILER_ID STREQUAL "GNU" + AND CMAKE_GENERATOR MATCHES "^Ninja" + ) + execute_process(COMMAND "${CMAKE_C_COMPILER}" -print-prog-name=as + RESULT_VARIABLE _gnu_res + OUTPUT_VARIABLE _gnu_as OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_QUIET) + if(_gnu_res EQUAL 0 AND _gnu_as) + set(CMake_TEST_BuildDepends_GNU_AS "${_gnu_as}") + endif() +endif() +add_RunCMake_test(BuildDepends + -DCMake_TEST_BuildDepends_GNU_AS=${CMake_TEST_BuildDepends_GNU_AS} + ) if(UNIX AND "${CMAKE_GENERATOR}" MATCHES "Unix Makefiles|Ninja") add_RunCMake_test(Byproducts) endif() @@ -188,6 +201,7 @@ add_RunCMake_test(FindBoost) add_RunCMake_test(FindLua) add_RunCMake_test(FindOpenGL) if(CMake_TEST_UseSWIG) + add_RunCMake_test(FindSWIG) add_RunCMake_test(UseSWIG -DCMake_TEST_FindPython=${CMake_TEST_FindPython}) endif() if(NOT CMAKE_C_COMPILER_ID MATCHES "Watcom") @@ -447,6 +461,8 @@ if(CMAKE_C_COMPILER_ID STREQUAL "AppleClang" add_RunCMake_test(Framework) endif() +add_RunCMake_test(File_Archive) +add_RunCMake_test(File_Configure) add_RunCMake_test(File_Generate) add_RunCMake_test(ExportWithoutLanguage) add_RunCMake_test(target_link_directories) @@ -651,3 +667,5 @@ add_RunCMake_test("CTestCommandExpandLists") add_RunCMake_test(PrecompileHeaders) add_RunCMake_test("UnityBuild") + +add_RunCMake_test(cmake_command) diff --git a/Tests/RunCMake/CPack/tests/INSTALL_SCRIPTS/VerifyResult.cmake b/Tests/RunCMake/CPack/tests/INSTALL_SCRIPTS/VerifyResult.cmake index d7d82f2..1a1e983 100644 --- a/Tests/RunCMake/CPack/tests/INSTALL_SCRIPTS/VerifyResult.cmake +++ b/Tests/RunCMake/CPack/tests/INSTALL_SCRIPTS/VerifyResult.cmake @@ -25,5 +25,5 @@ function(checkScripts_ FILE COMPARE_LIST) endforeach() endfunction() -checkScripts_("${FOUND_FILE_1}" "echo \"pre install foo\";echo \"post install foo\";echo \"pre uninstall foo\";echo \"post uninstall foo\"") -checkScripts_("${FOUND_FILE_2}" "echo \"pre install\";echo \"post install\";echo \"pre uninstall\";echo \"post uninstall\"") +checkScripts_("${FOUND_FILE_1}" "echo \"pre install foo\";echo \"post install foo\";echo \"pre uninstall foo\";echo \"post uninstall foo\";echo \"pre trans foo\";echo \"post trans foo\"") +checkScripts_("${FOUND_FILE_2}" "echo \"pre install\";echo \"post install\";echo \"pre uninstall\";echo \"post uninstall\";echo \"pre trans\";echo \"post trans\"") diff --git a/Tests/RunCMake/CPack/tests/INSTALL_SCRIPTS/test.cmake b/Tests/RunCMake/CPack/tests/INSTALL_SCRIPTS/test.cmake index fb1b8de..c200fa5 100644 --- a/Tests/RunCMake/CPack/tests/INSTALL_SCRIPTS/test.cmake +++ b/Tests/RunCMake/CPack/tests/INSTALL_SCRIPTS/test.cmake @@ -7,6 +7,10 @@ if(GENERATOR_TYPE STREQUAL "RPM") "${CMAKE_CURRENT_BINARY_DIR}/pre_uninstall.sh") set(CPACK_RPM_POST_UNINSTALL_SCRIPT_FILE "${CMAKE_CURRENT_BINARY_DIR}/post_uninstall.sh") + set(CPACK_RPM_PRE_TRANS_SCRIPT_FILE + "${CMAKE_CURRENT_BINARY_DIR}/pre_trans.sh") + set(CPACK_RPM_POST_TRANS_SCRIPT_FILE + "${CMAKE_CURRENT_BINARY_DIR}/post_trans.sh") set(CPACK_RPM_foo_PRE_INSTALL_SCRIPT_FILE "${CMAKE_CURRENT_BINARY_DIR}/pre_install_foo.sh") @@ -16,6 +20,10 @@ if(GENERATOR_TYPE STREQUAL "RPM") "${CMAKE_CURRENT_BINARY_DIR}/pre_uninstall_foo.sh") set(CPACK_RPM_foo_POST_UNINSTALL_SCRIPT_FILE "${CMAKE_CURRENT_BINARY_DIR}/post_uninstall_foo.sh") + set(CPACK_RPM_foo_PRE_TRANS_SCRIPT_FILE + "${CMAKE_CURRENT_BINARY_DIR}/pre_trans_foo.sh") + set(CPACK_RPM_foo_POST_TRANS_SCRIPT_FILE + "${CMAKE_CURRENT_BINARY_DIR}/post_trans_foo.sh") endif() set(CMAKE_BUILD_WITH_INSTALL_RPATH 1) @@ -29,6 +37,10 @@ file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/pre_uninstall.sh" "echo \"pre uninstall\"\n") file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/post_uninstall.sh" "echo \"post uninstall\"\n") +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/pre_trans.sh" + "echo \"pre trans\"\n") +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/post_trans.sh" + "echo \"post trans\"\n") # specific file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/pre_install_foo.sh" @@ -39,6 +51,10 @@ file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/pre_uninstall_foo.sh" "echo \"pre uninstall foo\"\n") file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/post_uninstall_foo.sh" "echo \"post uninstall foo\"\n") +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/pre_trans_foo.sh" + "echo \"pre trans foo\"\n") +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/post_trans_foo.sh" + "echo \"post trans foo\"\n") install(FILES CMakeLists.txt DESTINATION foo COMPONENT foo) install(FILES CMakeLists.txt DESTINATION bar COMPONENT bar) diff --git a/Tests/RunCMake/CommandLine/ProfilingTest-check.cmake b/Tests/RunCMake/CommandLine/ProfilingTest-check.cmake new file mode 100644 index 0000000..19ece86 --- /dev/null +++ b/Tests/RunCMake/CommandLine/ProfilingTest-check.cmake @@ -0,0 +1,18 @@ +if (NOT EXISTS ${ProfilingTestOutput}) + set(RunCMake_TEST_FAILED "Expected ${ProfilingTestOutput} to exists") +endif() + +file(READ "${ProfilingTestOutput}" JSON_HEADER LIMIT 2) +if (NOT JSON_HEADER MATCHES "^\\[{") + set(RunCMake_TEST_FAILED "Expected valid JSON start") + return() +endif() + +file(SIZE "${ProfilingTestOutput}" OUTPUT_SIZE) +math(EXPR END_OFFSET "${OUTPUT_SIZE} -2 ") + +file(READ "${ProfilingTestOutput}" JSON_TRAILER OFFSET ${END_OFFSET}) +if (NOT JSON_TRAILER MATCHES "^}]$") + set(RunCMake_TEST_FAILED "Expected valid JSON end") + return() +endif() diff --git a/Tests/RunCMake/CommandLine/ProfilingTest.cmake b/Tests/RunCMake/CommandLine/ProfilingTest.cmake new file mode 100644 index 0000000..837f4bf --- /dev/null +++ b/Tests/RunCMake/CommandLine/ProfilingTest.cmake @@ -0,0 +1 @@ +# This file is intentionally left blank diff --git a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake index 087ef21..41f13db 100644 --- a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake +++ b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake @@ -697,3 +697,25 @@ function(run_llvm_rc) unset(LLVMRC_RESULT) endfunction() run_llvm_rc() + +set(RunCMake_TEST_OPTIONS --profiling-output=/no/such/file.txt --profiling-format=google-trace) +run_cmake(profiling-all-params) +unset(RunCMake_TEST_OPTIONS) + +set(RunCMake_TEST_OPTIONS --profiling-output=/no/such/file.txt --profiling-format=invalid-format) +run_cmake(profiling-invalid-format) +unset(RunCMake_TEST_OPTIONS) + +set(RunCMake_TEST_OPTIONS --profiling-output=/no/such/file.txt) +run_cmake(profiling-missing-format) +unset(RunCMake_TEST_OPTIONS) + +set(RunCMake_TEST_OPTIONS --profiling-format=google-trace) +run_cmake(profiling-missing-output) +unset(RunCMake_TEST_OPTIONS) + +set(RunCMake_TEST_BINARY_DIR "${RunCMake_BINARY_DIR}/profiling-test") +set(ProfilingTestOutput ${RunCMake_TEST_BINARY_DIR}/output.json) +set(RunCMake_TEST_OPTIONS --profiling-format=google-trace --profiling-output=${ProfilingTestOutput}) +run_cmake(ProfilingTest) +unset(RunCMake_TEST_OPTIONS) diff --git a/Tests/RunCMake/Languages/LINK_LANGUAGE-genex-result.txt b/Tests/RunCMake/CommandLine/profiling-all-params-result.txt index d00491f..d00491f 100644 --- a/Tests/RunCMake/Languages/LINK_LANGUAGE-genex-result.txt +++ b/Tests/RunCMake/CommandLine/profiling-all-params-result.txt diff --git a/Tests/RunCMake/CommandLine/profiling-all-params-stderr.txt b/Tests/RunCMake/CommandLine/profiling-all-params-stderr.txt new file mode 100644 index 0000000..6b5c373 --- /dev/null +++ b/Tests/RunCMake/CommandLine/profiling-all-params-stderr.txt @@ -0,0 +1 @@ +^.*Could not start profiling: Unable to open: /no/such/file.txt$ diff --git a/Tests/RunCMake/CommandLine/profiling-invalid-format-result.txt b/Tests/RunCMake/CommandLine/profiling-invalid-format-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CommandLine/profiling-invalid-format-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CommandLine/profiling-invalid-format-stderr.txt b/Tests/RunCMake/CommandLine/profiling-invalid-format-stderr.txt new file mode 100644 index 0000000..459bc3a --- /dev/null +++ b/Tests/RunCMake/CommandLine/profiling-invalid-format-stderr.txt @@ -0,0 +1 @@ +^.*Invalid format specified for --profiling-format$ diff --git a/Tests/RunCMake/CommandLine/profiling-missing-format-result.txt b/Tests/RunCMake/CommandLine/profiling-missing-format-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CommandLine/profiling-missing-format-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CommandLine/profiling-missing-format-stderr.txt b/Tests/RunCMake/CommandLine/profiling-missing-format-stderr.txt new file mode 100644 index 0000000..459bc3a --- /dev/null +++ b/Tests/RunCMake/CommandLine/profiling-missing-format-stderr.txt @@ -0,0 +1 @@ +^.*Invalid format specified for --profiling-format$ diff --git a/Tests/RunCMake/CommandLine/profiling-missing-output-result.txt b/Tests/RunCMake/CommandLine/profiling-missing-output-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CommandLine/profiling-missing-output-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CommandLine/profiling-missing-output-stderr.txt b/Tests/RunCMake/CommandLine/profiling-missing-output-stderr.txt new file mode 100644 index 0000000..9ab0c8f --- /dev/null +++ b/Tests/RunCMake/CommandLine/profiling-missing-output-stderr.txt @@ -0,0 +1 @@ +^.*--profiling-format specified but no --profiling-output!$ diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-check.py b/Tests/RunCMake/FileAPI/codemodel-v2-check.py index de6253f..9ee0c20 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-check.py +++ b/Tests/RunCMake/FileAPI/codemodel-v2-check.py @@ -1,8 +1,14 @@ from check_index import * +import json import sys import os +def read_codemodel_json_data(filename): + abs_filename = os.path.join(os.path.dirname(os.path.realpath(__file__)), "codemodel-v2-data", filename) + with open(abs_filename, "r") as f: + return json.load(f) + def check_objects(o, g): assert is_list(o) assert len(o) == 1 @@ -471,154 +477,15 @@ def check_project(c): def gen_check_directories(c, g): expected = [ - { - "source": "^\\.$", - "build": "^\\.$", - "parentSource": None, - "childSources": [ - "^alias$", - "^custom$", - "^cxx$", - "^imported$", - "^object$", - "^.*/Tests/RunCMake/FileAPIExternalSource$", - "^dir$", - ], - "targetIds": [ - "^ALL_BUILD::@6890427a1f51a3e7e1df$", - "^ZERO_CHECK::@6890427a1f51a3e7e1df$", - "^c_exe::@6890427a1f51a3e7e1df$", - "^c_lib::@6890427a1f51a3e7e1df$", - "^c_shared_exe::@6890427a1f51a3e7e1df$", - "^c_shared_lib::@6890427a1f51a3e7e1df$", - "^c_static_exe::@6890427a1f51a3e7e1df$", - "^c_static_lib::@6890427a1f51a3e7e1df$", - "^interface_exe::@6890427a1f51a3e7e1df$", - ], - "projectName": "codemodel-v2", - "minimumCMakeVersion": "3.12", - "hasInstallRule": True, - }, - { - "source": "^alias$", - "build": "^alias$", - "parentSource": "^\\.$", - "childSources": None, - "targetIds": [ - "^ALL_BUILD::@53632cba2752272bb008$", - "^ZERO_CHECK::@53632cba2752272bb008$", - "^c_alias_exe::@53632cba2752272bb008$", - "^cxx_alias_exe::@53632cba2752272bb008$", - ], - "projectName": "Alias", - "minimumCMakeVersion": "3.12", - "hasInstallRule": None, - }, - { - "source": "^custom$", - "build": "^custom$", - "parentSource": "^\\.$", - "childSources": None, - "targetIds": [ - "^ALL_BUILD::@c11385ffed57b860da63$", - "^ZERO_CHECK::@c11385ffed57b860da63$", - "^custom_exe::@c11385ffed57b860da63$", - "^custom_tgt::@c11385ffed57b860da63$", - ], - "projectName": "Custom", - "minimumCMakeVersion": "3.12", - "hasInstallRule": None, - }, - { - "source": "^cxx$", - "build": "^cxx$", - "parentSource": "^\\.$", - "childSources": None, - "targetIds": [ - "^ALL_BUILD::@a56b12a3f5c0529fb296$", - "^ZERO_CHECK::@a56b12a3f5c0529fb296$", - "^cxx_exe::@a56b12a3f5c0529fb296$", - "^cxx_lib::@a56b12a3f5c0529fb296$", - "^cxx_shared_exe::@a56b12a3f5c0529fb296$", - "^cxx_shared_lib::@a56b12a3f5c0529fb296$", - "^cxx_static_exe::@a56b12a3f5c0529fb296$", - "^cxx_static_lib::@a56b12a3f5c0529fb296$", - ], - "projectName": "Cxx", - "minimumCMakeVersion": "3.12", - "hasInstallRule": None, - }, - { - "source": "^imported$", - "build": "^imported$", - "parentSource": "^\\.$", - "childSources": None, - "targetIds": [ - "^ALL_BUILD::@ba7eb709d0b48779c6c8$", - "^ZERO_CHECK::@ba7eb709d0b48779c6c8$", - "^link_imported_exe::@ba7eb709d0b48779c6c8$", - "^link_imported_interface_exe::@ba7eb709d0b48779c6c8$", - "^link_imported_object_exe::@ba7eb709d0b48779c6c8$", - "^link_imported_shared_exe::@ba7eb709d0b48779c6c8$", - "^link_imported_static_exe::@ba7eb709d0b48779c6c8$", - ], - "projectName": "Imported", - "minimumCMakeVersion": "3.12", - "hasInstallRule": None, - }, - { - "source": "^object$", - "build": "^object$", - "parentSource": "^\\.$", - "childSources": None, - "targetIds": [ - "^ALL_BUILD::@5ed5358f70faf8d8af7a$", - "^ZERO_CHECK::@5ed5358f70faf8d8af7a$", - "^c_object_exe::@5ed5358f70faf8d8af7a$", - "^c_object_lib::@5ed5358f70faf8d8af7a$", - "^cxx_object_exe::@5ed5358f70faf8d8af7a$", - "^cxx_object_lib::@5ed5358f70faf8d8af7a$", - ], - "projectName": "Object", - "minimumCMakeVersion": "3.13", - "hasInstallRule": True, - }, - { - "source": "^dir$", - "build": "^dir$", - "parentSource": "^\\.$", - "childSources": [ - "^dir/dir$", - ], - "targetIds": None, - "projectName": "codemodel-v2", - "minimumCMakeVersion": "3.12", - "hasInstallRule": None, - }, - { - "source": "^dir/dir$", - "build": "^dir/dir$", - "parentSource": "^dir$", - "childSources": None, - "targetIds": None, - "projectName": "codemodel-v2", - "minimumCMakeVersion": "3.12", - "hasInstallRule": None, - }, - { - "source": "^.*/Tests/RunCMake/FileAPIExternalSource$", - "build": "^.*/Tests/RunCMake/FileAPI/FileAPIExternalBuild$", - "parentSource": "^\\.$", - "childSources": None, - "targetIds": [ - "^ALL_BUILD::@[0-9a-f]+$", - "^ZERO_CHECK::@[0-9a-f]+$", - "^generated_exe::@[0-9a-f]+$", - ], - "projectName": "External", - "minimumCMakeVersion": "3.12", - "hasInstallRule": None, - }, + read_codemodel_json_data("directories/top.json"), + read_codemodel_json_data("directories/alias.json"), + read_codemodel_json_data("directories/custom.json"), + read_codemodel_json_data("directories/cxx.json"), + read_codemodel_json_data("directories/imported.json"), + read_codemodel_json_data("directories/object.json"), + read_codemodel_json_data("directories/dir.json"), + read_codemodel_json_data("directories/dir_dir.json"), + read_codemodel_json_data("directories/external.json"), ] if matches(g["name"], "^Visual Studio "): @@ -646,4428 +513,52 @@ def check_directories(c, g): def gen_check_targets(c, g, inSource): expected = [ - { - "name": "ALL_BUILD", - "id": "^ALL_BUILD::@6890427a1f51a3e7e1df$", - "directorySource": "^\\.$", - "projectName": "codemodel-v2", - "type": "UTILITY", - "isGeneratorProvided": True, - "sources": [ - { - "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/CMakeFiles/ALL_BUILD$", - "isGenerated": True, - "sourceGroupName": "", - "compileGroupLanguage": None, - "backtrace": [ - { - "file": "^CMakeLists\\.txt$", - "line": None, - "command": None, - "hasParent": False, - }, - ], - }, - { - "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/CMakeFiles/ALL_BUILD\\.rule$", - "isGenerated": True, - "sourceGroupName": "CMake Rules", - "compileGroupLanguage": None, - "backtrace": [ - { - "file": "^CMakeLists\\.txt$", - "line": None, - "command": None, - "hasParent": False, - }, - ], - }, - ], - "sourceGroups": [ - { - "name": "", - "sourcePaths": [ - "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/CMakeFiles/ALL_BUILD$", - ], - }, - { - "name": "CMake Rules", - "sourcePaths": [ - "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/CMakeFiles/ALL_BUILD\\.rule$", - ], - }, - ], - "compileGroups": None, - "backtrace": [ - { - "file": "^CMakeLists\\.txt$", - "line": None, - "command": None, - "hasParent": False, - }, - ], - "folder": None, - "nameOnDisk": None, - "artifacts": None, - "build": "^\\.$", - "source": "^\\.$", - "install": None, - "link": None, - "archive": None, - "dependencies": [ - { - "id": "^ZERO_CHECK::@6890427a1f51a3e7e1df$", - "backtrace": None, - }, - { - "id": "^interface_exe::@6890427a1f51a3e7e1df$", - "backtrace": None, - }, - { - "id": "^c_lib::@6890427a1f51a3e7e1df$", - "backtrace": None, - }, - { - "id": "^c_exe::@6890427a1f51a3e7e1df$", - "backtrace": None, - }, - { - "id": "^c_shared_lib::@6890427a1f51a3e7e1df$", - "backtrace": None, - }, - { - "id": "^c_shared_exe::@6890427a1f51a3e7e1df$", - "backtrace": None, - }, - { - "id": "^c_static_lib::@6890427a1f51a3e7e1df$", - "backtrace": None, - }, - { - "id": "^c_static_exe::@6890427a1f51a3e7e1df$", - "backtrace": None, - }, - { - "id": "^c_alias_exe::@53632cba2752272bb008$", - "backtrace": None, - }, - { - "id": "^cxx_alias_exe::@53632cba2752272bb008$", - "backtrace": None, - }, - { - "id": "^cxx_lib::@a56b12a3f5c0529fb296$", - "backtrace": None, - }, - { - "id": "^cxx_exe::@a56b12a3f5c0529fb296$", - "backtrace": None, - }, - { - "id": "^cxx_shared_lib::@a56b12a3f5c0529fb296$", - "backtrace": None, - }, - { - "id": "^cxx_shared_exe::@a56b12a3f5c0529fb296$", - "backtrace": None, - }, - { - "id": "^cxx_static_lib::@a56b12a3f5c0529fb296$", - "backtrace": None, - }, - { - "id": "^cxx_static_exe::@a56b12a3f5c0529fb296$", - "backtrace": None, - }, - { - "id": "^c_object_lib::@5ed5358f70faf8d8af7a$", - "backtrace": None, - }, - { - "id": "^c_object_exe::@5ed5358f70faf8d8af7a$", - "backtrace": None, - }, - { - "id": "^cxx_object_lib::@5ed5358f70faf8d8af7a$", - "backtrace": None, - }, - { - "id": "^cxx_object_exe::@5ed5358f70faf8d8af7a$", - "backtrace": None, - }, - { - "id": "^link_imported_exe::@ba7eb709d0b48779c6c8$", - "backtrace": None, - }, - { - "id": "^link_imported_shared_exe::@ba7eb709d0b48779c6c8$", - "backtrace": None, - }, - { - "id": "^link_imported_static_exe::@ba7eb709d0b48779c6c8$", - "backtrace": None, - }, - { - "id": "^link_imported_object_exe::@ba7eb709d0b48779c6c8$", - "backtrace": None, - }, - { - "id": "^link_imported_interface_exe::@ba7eb709d0b48779c6c8$", - "backtrace": None, - }, - { - "id": "^custom_exe::@c11385ffed57b860da63$", - "backtrace": None, - }, - { - "id": "^generated_exe::@[0-9a-f]+$", - "backtrace": None, - }, - ], - }, - { - "name": "ZERO_CHECK", - "id": "^ZERO_CHECK::@6890427a1f51a3e7e1df$", - "directorySource": "^\\.$", - "projectName": "codemodel-v2", - "type": "UTILITY", - "isGeneratorProvided": True, - "sources": [ - { - "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/CMakeFiles/ZERO_CHECK$", - "isGenerated": True, - "sourceGroupName": "", - "compileGroupLanguage": None, - "backtrace": [ - { - "file": "^CMakeLists\\.txt$", - "line": None, - "command": None, - "hasParent": False, - }, - ], - }, - { - "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/CMakeFiles/ZERO_CHECK\\.rule$", - "isGenerated": True, - "sourceGroupName": "CMake Rules", - "compileGroupLanguage": None, - "backtrace": [ - { - "file": "^CMakeLists\\.txt$", - "line": None, - "command": None, - "hasParent": False, - }, - ], - }, - ], - "sourceGroups": [ - { - "name": "", - "sourcePaths": [ - "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/CMakeFiles/ZERO_CHECK$", - ], - }, - { - "name": "CMake Rules", - "sourcePaths": [ - "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/CMakeFiles/ZERO_CHECK\\.rule$", - ], - }, - ], - "compileGroups": None, - "backtrace": [ - { - "file": "^CMakeLists\\.txt$", - "line": None, - "command": None, - "hasParent": False, - }, - ], - "folder": None, - "nameOnDisk": None, - "artifacts": None, - "build": "^\\.$", - "source": "^\\.$", - "install": None, - "link": None, - "archive": None, - "dependencies": None, - }, - { - "name": "interface_exe", - "id": "^interface_exe::@6890427a1f51a3e7e1df$", - "directorySource": "^\\.$", - "projectName": "codemodel-v2", - "type": "EXECUTABLE", - "isGeneratorProvided": None, - "sources": [ - { - "path": "^empty\\.c$", - "isGenerated": None, - "sourceGroupName": "Source Files", - "compileGroupLanguage": "C", - "backtrace": [ - { - "file": "^include_test\\.cmake$", - "line": 3, - "command": "add_executable", - "hasParent": True, - }, - { - "file": "^include_test\\.cmake$", - "line": None, - "command": None, - "hasParent": True, - }, - { - "file": "^codemodel-v2\\.cmake$", - "line": 3, - "command": "include", - "hasParent": True, - }, - { - "file": "^codemodel-v2\\.cmake$", - "line": None, - "command": None, - "hasParent": True, - }, - { - "file": "^CMakeLists\\.txt$", - "line": 3, - "command": "include", - "hasParent": True, - }, - { - "file": "^CMakeLists\\.txt$", - "line": None, - "command": None, - "hasParent": False, - }, - ], - }, - ], - "sourceGroups": [ - { - "name": "Source Files", - "sourcePaths": [ - "^empty\\.c$", - ], - }, - ], - "compileGroups": [ - { - "language": "C", - "sourcePaths": [ - "^empty\\.c$", - ], - "includes": None, - "defines": [ - { - "define": "interface_exe_EXPORTS", - "backtrace": None, - }, - ], - "compileCommandFragments": None, - }, - ], - "backtrace": [ - { - "file": "^include_test\\.cmake$", - "line": 3, - "command": "add_executable", - "hasParent": True, - }, - { - "file": "^include_test\\.cmake$", - "line": None, - "command": None, - "hasParent": True, - }, - { - "file": "^codemodel-v2\\.cmake$", - "line": 3, - "command": "include", - "hasParent": True, - }, - { - "file": "^codemodel-v2\\.cmake$", - "line": None, - "command": None, - "hasParent": True, - }, - { - "file": "^CMakeLists\\.txt$", - "line": 3, - "command": "include", - "hasParent": True, - }, - { - "file": "^CMakeLists\\.txt$", - "line": None, - "command": None, - "hasParent": False, - }, - ], - "folder": None, - "nameOnDisk": "^my_interface_exe\\.myexe$", - "artifacts": [ - { - "path": "^bin/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?my_interface_exe\\.myexe$", - "_dllExtra": False, - }, - { - "path": "^lib/my_interface_exe\\.imp$", - "_aixExtra": True, - "_dllExtra": False, - }, - { - "path": "^lib/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?(lib)?my_interface_exe\\.(dll\\.a|lib)$", - "_dllExtra": True, - }, - { - "path": "^bin/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?my_interface_exe\\.pdb$", - "_dllExtra": True, - }, - ], - "build": "^\\.$", - "source": "^\\.$", - "install": None, - "link": { - "language": "C", - "lto": None, - "commandFragments": None, - }, - "archive": None, - "dependencies": [ - { - "id": "^ZERO_CHECK::@6890427a1f51a3e7e1df$", - "backtrace": None, - }, - ], - }, - { - "name": "c_lib", - "id": "^c_lib::@6890427a1f51a3e7e1df$", - "directorySource": "^\\.$", - "projectName": "codemodel-v2", - "type": "STATIC_LIBRARY", - "isGeneratorProvided": None, - "sources": [ - { - "path": "^empty\\.c$", - "isGenerated": None, - "sourceGroupName": "Source Files", - "compileGroupLanguage": "C", - "backtrace": [ - { - "file": "^codemodel-v2\\.cmake$", - "line": 5, - "command": "add_library", - "hasParent": True, - }, - { - "file": "^codemodel-v2\\.cmake$", - "line": None, - "command": None, - "hasParent": True, - }, - { - "file": "^CMakeLists\\.txt$", - "line": 3, - "command": "include", - "hasParent": True, - }, - { - "file": "^CMakeLists\\.txt$", - "line": None, - "command": None, - "hasParent": False, - }, - ], - }, - ], - "sourceGroups": [ - { - "name": "Source Files", - "sourcePaths": [ - "^empty\\.c$", - ], - }, - ], - "compileGroups": [ - { - "language": "C", - "sourcePaths": [ - "^empty\\.c$", - ], - "includes": None, - "defines": None, - "compileCommandFragments": None, - }, - ], - "backtrace": [ - { - "file": "^codemodel-v2\\.cmake$", - "line": 5, - "command": "add_library", - "hasParent": True, - }, - { - "file": "^codemodel-v2\\.cmake$", - "line": None, - "command": None, - "hasParent": True, - }, - { - "file": "^CMakeLists\\.txt$", - "line": 3, - "command": "include", - "hasParent": True, - }, - { - "file": "^CMakeLists\\.txt$", - "line": None, - "command": None, - "hasParent": False, - }, - ], - "folder": None, - "nameOnDisk": "^(lib)?c_lib\\.(a|lib)$", - "artifacts": [ - { - "path": "^((Debug|Release|RelWithDebInfo|MinSizeRel)/)?(lib)?c_lib\\.(a|lib)$", - "_dllExtra": False, - }, - ], - "build": "^\\.$", - "source": "^\\.$", - "install": None, - "link": None, - "archive": { - "lto": None, - }, - "dependencies": [ - { - "id": "^ZERO_CHECK::@6890427a1f51a3e7e1df$", - "backtrace": None, - }, - ], - }, - { - "name": "c_exe", - "id": "^c_exe::@6890427a1f51a3e7e1df$", - "directorySource": "^\\.$", - "projectName": "codemodel-v2", - "type": "EXECUTABLE", - "isGeneratorProvided": None, - "sources": [ - { - "path": "^empty\\.c$", - "isGenerated": None, - "sourceGroupName": "Source Files", - "compileGroupLanguage": "C", - "backtrace": [ - { - "file": "^codemodel-v2\\.cmake$", - "line": 6, - "command": "add_executable", - "hasParent": True, - }, - { - "file": "^codemodel-v2\\.cmake$", - "line": None, - "command": None, - "hasParent": True, - }, - { - "file": "^CMakeLists\\.txt$", - "line": 3, - "command": "include", - "hasParent": True, - }, - { - "file": "^CMakeLists\\.txt$", - "line": None, - "command": None, - "hasParent": False, - }, - ], - }, - ], - "sourceGroups": [ - { - "name": "Source Files", - "sourcePaths": [ - "^empty\\.c$", - ], - }, - ], - "compileGroups": [ - { - "language": "C", - "sourcePaths": [ - "^empty\\.c$", - ], - "includes": None, - "defines": None, - "compileCommandFragments": None, - }, - ], - "backtrace": [ - { - "file": "^codemodel-v2\\.cmake$", - "line": 6, - "command": "add_executable", - "hasParent": True, - }, - { - "file": "^codemodel-v2\\.cmake$", - "line": None, - "command": None, - "hasParent": True, - }, - { - "file": "^CMakeLists\\.txt$", - "line": 3, - "command": "include", - "hasParent": True, - }, - { - "file": "^CMakeLists\\.txt$", - "line": None, - "command": None, - "hasParent": False, - }, - ], - "folder": None, - "nameOnDisk": "^c_exe(\\.exe)?$", - "artifacts": [ - { - "path": "^((Debug|Release|RelWithDebInfo|MinSizeRel)/)?c_exe(\\.exe)?$", - "_dllExtra": False, - }, - { - "path": "^((Debug|Release|RelWithDebInfo|MinSizeRel)/)?c_exe\\.pdb$", - "_dllExtra": True, - }, - ], - "build": "^\\.$", - "source": "^\\.$", - "install": None, - "link": { - "language": "C", - "lto": None, - "commandFragments": None, - }, - "archive": None, - "dependencies": [ - { - "id": "^c_lib::@6890427a1f51a3e7e1df$", - "backtrace": [ - { - "file": "^codemodel-v2\\.cmake$", - "line": 7, - "command": "target_link_libraries", - "hasParent": True, - }, - { - "file": "^codemodel-v2\\.cmake$", - "line": None, - "command": None, - "hasParent": True, - }, - { - "file": "^CMakeLists\\.txt$", - "line": 3, - "command": "include", - "hasParent": True, - }, - { - "file": "^CMakeLists\\.txt$", - "line": None, - "command": None, - "hasParent": False, - }, - ], - }, - { - "id": "^ZERO_CHECK::@6890427a1f51a3e7e1df$", - "backtrace": None, - }, - ], - }, - { - "name": "c_shared_lib", - "id": "^c_shared_lib::@6890427a1f51a3e7e1df$", - "directorySource": "^\\.$", - "projectName": "codemodel-v2", - "type": "SHARED_LIBRARY", - "isGeneratorProvided": None, - "sources": [ - { - "path": "^empty\\.c$", - "isGenerated": None, - "sourceGroupName": "Source Files", - "compileGroupLanguage": "C", - "backtrace": [ - { - "file": "^codemodel-v2\\.cmake$", - "line": 9, - "command": "add_library", - "hasParent": True, - }, - { - "file": "^codemodel-v2\\.cmake$", - "line": None, - "command": None, - "hasParent": True, - }, - { - "file": "^CMakeLists\\.txt$", - "line": 3, - "command": "include", - "hasParent": True, - }, - { - "file": "^CMakeLists\\.txt$", - "line": None, - "command": None, - "hasParent": False, - }, - ], - }, - ], - "sourceGroups": [ - { - "name": "Source Files", - "sourcePaths": [ - "^empty\\.c$", - ], - }, - ], - "compileGroups": [ - { - "language": "C", - "sourcePaths": [ - "^empty\\.c$", - ], - "includes": None, - "defines": [ - { - "define": "c_shared_lib_EXPORTS", - "backtrace": None, - }, - ], - "compileCommandFragments": None, - }, - ], - "backtrace": [ - { - "file": "^codemodel-v2\\.cmake$", - "line": 9, - "command": "add_library", - "hasParent": True, - }, - { - "file": "^codemodel-v2\\.cmake$", - "line": None, - "command": None, - "hasParent": True, - }, - { - "file": "^CMakeLists\\.txt$", - "line": 3, - "command": "include", - "hasParent": True, - }, - { - "file": "^CMakeLists\\.txt$", - "line": None, - "command": None, - "hasParent": False, - }, - ], - "folder": None, - "nameOnDisk": "^(lib|cyg)?c_shared_lib\\.(so|dylib|dll)$", - "artifacts": [ - { - "path": "^lib/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?(lib|cyg)?c_shared_lib\\.(so|dylib|dll)$", - "_dllExtra": False, - }, - { - "path": "^((Debug|Release|RelWithDebInfo|MinSizeRel)/)?(lib)?c_shared_lib\\.(dll\\.a|lib)$", - "_dllExtra": True, - }, - { - "path": "^lib/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?(lib|cyg)?c_shared_lib\\.pdb$", - "_dllExtra": True, - }, - ], - "build": "^\\.$", - "source": "^\\.$", - "install": None, - "link": { - "language": "C", - "lto": True, - "commandFragments": None, - }, - "archive": None, - "dependencies": [ - { - "id": "^ZERO_CHECK::@6890427a1f51a3e7e1df$", - "backtrace": None, - }, - ], - }, - { - "name": "c_shared_exe", - "id": "^c_shared_exe::@6890427a1f51a3e7e1df$", - "directorySource": "^\\.$", - "projectName": "codemodel-v2", - "type": "EXECUTABLE", - "isGeneratorProvided": None, - "sources": [ - { - "path": "^empty\\.c$", - "isGenerated": None, - "sourceGroupName": "Source Files", - "compileGroupLanguage": "C", - "backtrace": [ - { - "file": "^codemodel-v2\\.cmake$", - "line": 10, - "command": "add_executable", - "hasParent": True, - }, - { - "file": "^codemodel-v2\\.cmake$", - "line": None, - "command": None, - "hasParent": True, - }, - { - "file": "^CMakeLists\\.txt$", - "line": 3, - "command": "include", - "hasParent": True, - }, - { - "file": "^CMakeLists\\.txt$", - "line": None, - "command": None, - "hasParent": False, - }, - ], - }, - ], - "sourceGroups": [ - { - "name": "Source Files", - "sourcePaths": [ - "^empty\\.c$", - ], - }, - ], - "compileGroups": [ - { - "language": "C", - "sourcePaths": [ - "^empty\\.c$", - ], - "includes": None, - "defines": None, - "compileCommandFragments": None, - }, - ], - "backtrace": [ - { - "file": "^codemodel-v2\\.cmake$", - "line": 10, - "command": "add_executable", - "hasParent": True, - }, - { - "file": "^codemodel-v2\\.cmake$", - "line": None, - "command": None, - "hasParent": True, - }, - { - "file": "^CMakeLists\\.txt$", - "line": 3, - "command": "include", - "hasParent": True, - }, - { - "file": "^CMakeLists\\.txt$", - "line": None, - "command": None, - "hasParent": False, - }, - ], - "folder": None, - "nameOnDisk": "^c_shared_exe(\\.exe)?$", - "artifacts": [ - { - "path": "^((Debug|Release|RelWithDebInfo|MinSizeRel)/)?c_shared_exe(\\.exe)?$", - "_dllExtra": False, - }, - { - "path": "^((Debug|Release|RelWithDebInfo|MinSizeRel)/)?c_shared_exe\\.pdb$", - "_dllExtra": True, - }, - ], - "build": "^\\.$", - "source": "^\\.$", - "install": None, - "link": { - "language": "C", - "lto": True, - "commandFragments": None, - }, - "archive": None, - "dependencies": [ - { - "id": "^c_shared_lib::@6890427a1f51a3e7e1df$", - "backtrace": [ - { - "file": "^codemodel-v2\\.cmake$", - "line": 11, - "command": "target_link_libraries", - "hasParent": True, - }, - { - "file": "^codemodel-v2\\.cmake$", - "line": None, - "command": None, - "hasParent": True, - }, - { - "file": "^CMakeLists\\.txt$", - "line": 3, - "command": "include", - "hasParent": True, - }, - { - "file": "^CMakeLists\\.txt$", - "line": None, - "command": None, - "hasParent": False, - }, - ], - }, - { - "id": "^ZERO_CHECK::@6890427a1f51a3e7e1df$", - "backtrace": None, - }, - ], - }, - { - "name": "c_static_lib", - "id": "^c_static_lib::@6890427a1f51a3e7e1df$", - "directorySource": "^\\.$", - "projectName": "codemodel-v2", - "type": "STATIC_LIBRARY", - "isGeneratorProvided": None, - "sources": [ - { - "path": "^empty\\.c$", - "isGenerated": None, - "sourceGroupName": "Source Files", - "compileGroupLanguage": "C", - "backtrace": [ - { - "file": "^codemodel-v2\\.cmake$", - "line": 13, - "command": "add_library", - "hasParent": True, - }, - { - "file": "^codemodel-v2\\.cmake$", - "line": None, - "command": None, - "hasParent": True, - }, - { - "file": "^CMakeLists\\.txt$", - "line": 3, - "command": "include", - "hasParent": True, - }, - { - "file": "^CMakeLists\\.txt$", - "line": None, - "command": None, - "hasParent": False, - }, - ], - }, - ], - "sourceGroups": [ - { - "name": "Source Files", - "sourcePaths": [ - "^empty\\.c$", - ], - }, - ], - "compileGroups": [ - { - "language": "C", - "sourcePaths": [ - "^empty\\.c$", - ], - "includes": None, - "defines": None, - "compileCommandFragments": None, - }, - ], - "backtrace": [ - { - "file": "^codemodel-v2\\.cmake$", - "line": 13, - "command": "add_library", - "hasParent": True, - }, - { - "file": "^codemodel-v2\\.cmake$", - "line": None, - "command": None, - "hasParent": True, - }, - { - "file": "^CMakeLists\\.txt$", - "line": 3, - "command": "include", - "hasParent": True, - }, - { - "file": "^CMakeLists\\.txt$", - "line": None, - "command": None, - "hasParent": False, - }, - ], - "folder": None, - "nameOnDisk": "^(lib)?c_static_lib\\.(a|lib)$", - "artifacts": [ - { - "path": "^((Debug|Release|RelWithDebInfo|MinSizeRel)/)?(lib)?c_static_lib\\.(a|lib)$", - "_dllExtra": False, - }, - ], - "build": "^\\.$", - "source": "^\\.$", - "install": None, - "link": None, - "archive": { - "lto": True, - }, - "dependencies": [ - { - "id": "^ZERO_CHECK::@6890427a1f51a3e7e1df$", - "backtrace": None, - }, - ], - }, - { - "name": "c_static_exe", - "id": "^c_static_exe::@6890427a1f51a3e7e1df$", - "directorySource": "^\\.$", - "projectName": "codemodel-v2", - "type": "EXECUTABLE", - "isGeneratorProvided": None, - "sources": [ - { - "path": "^empty\\.c$", - "isGenerated": None, - "sourceGroupName": "Source Files", - "compileGroupLanguage": "C", - "backtrace": [ - { - "file": "^codemodel-v2\\.cmake$", - "line": 14, - "command": "add_executable", - "hasParent": True, - }, - { - "file": "^codemodel-v2\\.cmake$", - "line": None, - "command": None, - "hasParent": True, - }, - { - "file": "^CMakeLists\\.txt$", - "line": 3, - "command": "include", - "hasParent": True, - }, - { - "file": "^CMakeLists\\.txt$", - "line": None, - "command": None, - "hasParent": False, - }, - ], - }, - ], - "sourceGroups": [ - { - "name": "Source Files", - "sourcePaths": [ - "^empty\\.c$", - ], - }, - ], - "compileGroups": [ - { - "language": "C", - "sourcePaths": [ - "^empty\\.c$", - ], - "includes": None, - "defines": None, - "compileCommandFragments": None, - }, - ], - "backtrace": [ - { - "file": "^codemodel-v2\\.cmake$", - "line": 14, - "command": "add_executable", - "hasParent": True, - }, - { - "file": "^codemodel-v2\\.cmake$", - "line": None, - "command": None, - "hasParent": True, - }, - { - "file": "^CMakeLists\\.txt$", - "line": 3, - "command": "include", - "hasParent": True, - }, - { - "file": "^CMakeLists\\.txt$", - "line": None, - "command": None, - "hasParent": False, - }, - ], - "folder": None, - "nameOnDisk": "^c_static_exe(\\.exe)?$", - "artifacts": [ - { - "path": "^((Debug|Release|RelWithDebInfo|MinSizeRel)/)?c_static_exe(\\.exe)?$", - "_dllExtra": False, - }, - { - "path": "^((Debug|Release|RelWithDebInfo|MinSizeRel)/)?c_static_exe\\.pdb$", - "_dllExtra": True, - }, - ], - "build": "^\\.$", - "source": "^\\.$", - "install": None, - "link": { - "language": "C", - "lto": None, - "commandFragments": None, - }, - "archive": None, - "dependencies": [ - { - "id": "^c_static_lib::@6890427a1f51a3e7e1df$", - "backtrace": [ - { - "file": "^codemodel-v2\\.cmake$", - "line": 15, - "command": "target_link_libraries", - "hasParent": True, - }, - { - "file": "^codemodel-v2\\.cmake$", - "line": None, - "command": None, - "hasParent": True, - }, - { - "file": "^CMakeLists\\.txt$", - "line": 3, - "command": "include", - "hasParent": True, - }, - { - "file": "^CMakeLists\\.txt$", - "line": None, - "command": None, - "hasParent": False, - }, - ], - }, - { - "id": "^ZERO_CHECK::@6890427a1f51a3e7e1df$", - "backtrace": None, - }, - ], - }, - { - "name": "ALL_BUILD", - "id": "^ALL_BUILD::@a56b12a3f5c0529fb296$", - "directorySource": "^cxx$", - "projectName": "Cxx", - "type": "UTILITY", - "isGeneratorProvided": True, - "sources": [ - { - "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/cxx/CMakeFiles/ALL_BUILD$", - "isGenerated": True, - "sourceGroupName": "", - "compileGroupLanguage": None, - "backtrace": [ - { - "file": "^cxx/CMakeLists\\.txt$", - "line": None, - "command": None, - "hasParent": False, - }, - ], - }, - { - "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/cxx/CMakeFiles/ALL_BUILD\\.rule$", - "isGenerated": True, - "sourceGroupName": "CMake Rules", - "compileGroupLanguage": None, - "backtrace": [ - { - "file": "^cxx/CMakeLists\\.txt$", - "line": None, - "command": None, - "hasParent": False, - }, - ], - }, - ], - "sourceGroups": [ - { - "name": "", - "sourcePaths": [ - "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/cxx/CMakeFiles/ALL_BUILD$", - ], - }, - { - "name": "CMake Rules", - "sourcePaths": [ - "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/cxx/CMakeFiles/ALL_BUILD\\.rule$", - ], - }, - ], - "compileGroups": None, - "backtrace": [ - { - "file": "^cxx/CMakeLists\\.txt$", - "line": None, - "command": None, - "hasParent": False, - }, - ], - "folder": None, - "nameOnDisk": None, - "artifacts": None, - "build": "^cxx$", - "source": "^cxx$", - "install": None, - "link": None, - "archive": None, - "dependencies": [ - { - "id": "^ZERO_CHECK::@a56b12a3f5c0529fb296$", - "backtrace": None, - }, - { - "id": "^cxx_lib::@a56b12a3f5c0529fb296$", - "backtrace": None, - }, - { - "id": "^cxx_exe::@a56b12a3f5c0529fb296$", - "backtrace": None, - }, - { - "id": "^cxx_shared_lib::@a56b12a3f5c0529fb296$", - "backtrace": None, - }, - { - "id": "^cxx_shared_exe::@a56b12a3f5c0529fb296$", - "backtrace": None, - }, - { - "id": "^cxx_static_lib::@a56b12a3f5c0529fb296$", - "backtrace": None, - }, - { - "id": "^cxx_static_exe::@a56b12a3f5c0529fb296$", - "backtrace": None, - }, - ], - }, - { - "name": "ZERO_CHECK", - "id": "^ZERO_CHECK::@a56b12a3f5c0529fb296$", - "directorySource": "^cxx$", - "projectName": "Cxx", - "type": "UTILITY", - "isGeneratorProvided": True, - "sources": [ - { - "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/cxx/CMakeFiles/ZERO_CHECK$", - "isGenerated": True, - "sourceGroupName": "", - "compileGroupLanguage": None, - "backtrace": [ - { - "file": "^cxx/CMakeLists\\.txt$", - "line": None, - "command": None, - "hasParent": False, - }, - ], - }, - { - "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/cxx/CMakeFiles/ZERO_CHECK\\.rule$", - "isGenerated": True, - "sourceGroupName": "CMake Rules", - "compileGroupLanguage": None, - "backtrace": [ - { - "file": "^cxx/CMakeLists\\.txt$", - "line": None, - "command": None, - "hasParent": False, - }, - ], - }, - ], - "sourceGroups": [ - { - "name": "", - "sourcePaths": [ - "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/cxx/CMakeFiles/ZERO_CHECK$", - ], - }, - { - "name": "CMake Rules", - "sourcePaths": [ - "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/cxx/CMakeFiles/ZERO_CHECK\\.rule$", - ], - }, - ], - "compileGroups": None, - "backtrace": [ - { - "file": "^cxx/CMakeLists\\.txt$", - "line": None, - "command": None, - "hasParent": False, - }, - ], - "folder": None, - "nameOnDisk": None, - "artifacts": None, - "build": "^cxx$", - "source": "^cxx$", - "install": None, - "link": None, - "archive": None, - "dependencies": None, - }, - { - "name": "cxx_lib", - "id": "^cxx_lib::@a56b12a3f5c0529fb296$", - "directorySource": "^cxx$", - "projectName": "Cxx", - "type": "STATIC_LIBRARY", - "isGeneratorProvided": None, - "sources": [ - { - "path": "^empty\\.cxx$", - "isGenerated": None, - "sourceGroupName": "Source Files", - "compileGroupLanguage": "CXX", - "backtrace": [ - { - "file": "^cxx/CMakeLists\\.txt$", - "line": 4, - "command": "add_library", - "hasParent": True, - }, - { - "file": "^cxx/CMakeLists\\.txt$", - "line": None, - "command": None, - "hasParent": False, - }, - ], - }, - ], - "sourceGroups": [ - { - "name": "Source Files", - "sourcePaths": [ - "^empty\\.cxx$", - ], - }, - ], - "compileGroups": [ - { - "language": "CXX", - "sourcePaths": [ - "^empty\\.cxx$", - ], - "includes": None, - "defines": None, - "compileCommandFragments": None, - }, - ], - "backtrace": [ - { - "file": "^cxx/CMakeLists\\.txt$", - "line": 4, - "command": "add_library", - "hasParent": True, - }, - { - "file": "^cxx/CMakeLists\\.txt$", - "line": None, - "command": None, - "hasParent": False, - }, - ], - "folder": None, - "nameOnDisk": "^(lib)?cxx_lib\\.(a|lib)$", - "artifacts": [ - { - "path": "^cxx/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?(lib)?cxx_lib\\.(a|lib)$", - "_dllExtra": False, - }, - ], - "build": "^cxx$", - "source": "^cxx$", - "install": None, - "link": None, - "archive": { - "lto": None, - }, - "dependencies": [ - { - "id": "^ZERO_CHECK::@a56b12a3f5c0529fb296$", - "backtrace": None, - }, - ], - }, - { - "name": "cxx_exe", - "id": "^cxx_exe::@a56b12a3f5c0529fb296$", - "directorySource": "^cxx$", - "projectName": "Cxx", - "type": "EXECUTABLE", - "isGeneratorProvided": None, - "sources": [ - { - "path": "^empty\\.cxx$", - "isGenerated": None, - "sourceGroupName": "Source Files", - "compileGroupLanguage": "CXX", - "backtrace": [ - { - "file": "^cxx/CMakeLists\\.txt$", - "line": 5, - "command": "add_executable", - "hasParent": True, - }, - { - "file": "^cxx/CMakeLists\\.txt$", - "line": None, - "command": None, - "hasParent": False, - }, - ], - }, - ], - "sourceGroups": [ - { - "name": "Source Files", - "sourcePaths": [ - "^empty\\.cxx$", - ], - }, - ], - "compileGroups": [ - { - "language": "CXX", - "sourcePaths": [ - "^empty\\.cxx$", - ], - "includes": None, - "defines": None, - "compileCommandFragments": [ - { - "fragment" : "TargetCompileOptions", - "backtrace": [ - { - "file": "^cxx/CMakeLists\\.txt$", - "line": 17, - "command": "target_compile_options", - "hasParent": True, - }, - { - "file" : "^cxx/CMakeLists\\.txt$", - "line": None, - "command": None, - "hasParent": False, - }, - ], - } - ], - }, - ], - "backtrace": [ - { - "file": "^cxx/CMakeLists\\.txt$", - "line": 5, - "command": "add_executable", - "hasParent": True, - }, - { - "file": "^cxx/CMakeLists\\.txt$", - "line": None, - "command": None, - "hasParent": False, - }, - ], - "folder": "bin", - "nameOnDisk": "^cxx_exe(\\.exe)?$", - "artifacts": [ - { - "path": "^cxx/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?cxx_exe(\\.exe)?$", - "_dllExtra": False, - }, - { - "path": "^cxx/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?cxx_exe\\.pdb$", - "_dllExtra": True, - }, - ], - "build": "^cxx$", - "source": "^cxx$", - "install": { - "prefix": "^(/usr/local|[A-Za-z]:.*/codemodel-v2)$", - "destinations": [ - { - "path": "bin", - "backtrace": [ - { - "file": "^codemodel-v2\\.cmake$", - "line": 37, - "command": "install", - "hasParent": True, - }, - { - "file": "^codemodel-v2\\.cmake$", - "line": None, - "command": None, - "hasParent": True, - }, - { - "file": "^CMakeLists\\.txt$", - "line": 3, - "command": "include", - "hasParent": True, - }, - { - "file": "^CMakeLists\\.txt$", - "line": None, - "command": None, - "hasParent": False, - }, - ], - }, - ], - }, - "link": { - "language": "CXX", - "lto": None, - "commandFragments": [ - { - "fragment" : "TargetLinkOptions", - "role" : "flags", - "backtrace": [ - { - "file": "^cxx/CMakeLists\\.txt$", - "line": 18, - "command": "target_link_options", - "hasParent": True, - }, - { - "file" : "^cxx/CMakeLists\\.txt$", - "line": None, - "command": None, - "hasParent": False, - }, - ], - }, - { - "fragment" : ".*TargetLinkDir\\\"?$", - "role" : "libraryPath", - "backtrace": [ - { - "file": "^cxx/CMakeLists\\.txt$", - "line": 19, - "command": "target_link_directories", - "hasParent": True, - }, - { - "file" : "^cxx/CMakeLists\\.txt$", - "line": None, - "command": None, - "hasParent": False, - }, - ], - }, - { - "fragment" : ".*cxx_lib.*", - "role" : "libraries", - "backtrace": [ - { - "file": "^cxx/CMakeLists\\.txt$", - "line": 6, - "command": "target_link_libraries", - "hasParent": True, - }, - { - "file" : "^cxx/CMakeLists\\.txt$", - "line": None, - "command": None, - "hasParent": False, - }, - ], - }, - ], - }, - "archive": None, - "dependencies": [ - { - "id": "^cxx_lib::@a56b12a3f5c0529fb296$", - "backtrace": [ - { - "file": "^cxx/CMakeLists\\.txt$", - "line": 6, - "command": "target_link_libraries", - "hasParent": True, - }, - { - "file": "^cxx/CMakeLists\\.txt$", - "line": None, - "command": None, - "hasParent": False, - }, - ], - }, - { - "id": "^ZERO_CHECK::@a56b12a3f5c0529fb296$", - "backtrace": None, - }, - ], - }, - { - "name": "cxx_shared_lib", - "id": "^cxx_shared_lib::@a56b12a3f5c0529fb296$", - "directorySource": "^cxx$", - "projectName": "Cxx", - "type": "SHARED_LIBRARY", - "isGeneratorProvided": None, - "sources": [ - { - "path": "^empty\\.cxx$", - "isGenerated": None, - "sourceGroupName": "Source Files", - "compileGroupLanguage": "CXX", - "backtrace": [ - { - "file": "^cxx/CMakeLists\\.txt$", - "line": 9, - "command": "add_library", - "hasParent": True, - }, - { - "file": "^cxx/CMakeLists\\.txt$", - "line": None, - "command": None, - "hasParent": False, - }, - ], - }, - ], - "sourceGroups": [ - { - "name": "Source Files", - "sourcePaths": [ - "^empty\\.cxx$", - ], - }, - ], - "compileGroups": [ - { - "language": "CXX", - "sourcePaths": [ - "^empty\\.cxx$", - ], - "includes": None, - "defines": [ - { - "define": "cxx_shared_lib_EXPORTS", - "backtrace": None, - }, - ], - "compileCommandFragments": None, - }, - ], - "backtrace": [ - { - "file": "^cxx/CMakeLists\\.txt$", - "line": 9, - "command": "add_library", - "hasParent": True, - }, - { - "file": "^cxx/CMakeLists\\.txt$", - "line": None, - "command": None, - "hasParent": False, - }, - ], - "folder": None, - "nameOnDisk": "^(lib|cyg)?cxx_shared_lib\\.(so|dylib|dll)$", - "artifacts": [ - { - "path": "^cxx/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?(lib|cyg)?cxx_shared_lib\\.(so|dylib|dll)$", - "_dllExtra": False, - }, - { - "path": "^cxx/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?(lib)?cxx_shared_lib\\.(dll\\.a|lib)$", - "_dllExtra": True, - }, - { - "path": "^cxx/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?(lib|cyg)?cxx_shared_lib\\.pdb$", - "_dllExtra": True, - }, - ], - "build": "^cxx$", - "source": "^cxx$", - "install": None, - "link": { - "language": "CXX", - "lto": None, - "commandFragments": None, - }, - "archive": None, - "dependencies": [ - { - "id": "^ZERO_CHECK::@a56b12a3f5c0529fb296$", - "backtrace": None, - }, - ], - }, - { - "name": "cxx_shared_exe", - "id": "^cxx_shared_exe::@a56b12a3f5c0529fb296$", - "directorySource": "^cxx$", - "projectName": "Cxx", - "type": "EXECUTABLE", - "isGeneratorProvided": None, - "sources": [ - { - "path": "^empty\\.cxx$", - "isGenerated": None, - "sourceGroupName": "Source Files", - "compileGroupLanguage": "CXX", - "backtrace": [ - { - "file": "^cxx/CMakeLists\\.txt$", - "line": 10, - "command": "add_executable", - "hasParent": True, - }, - { - "file": "^cxx/CMakeLists\\.txt$", - "line": None, - "command": None, - "hasParent": False, - }, - ], - }, - ], - "sourceGroups": [ - { - "name": "Source Files", - "sourcePaths": [ - "^empty\\.cxx$", - ], - }, - ], - "compileGroups": [ - { - "language": "CXX", - "sourcePaths": [ - "^empty\\.cxx$", - ], - "includes": None, - "defines": None, - "compileCommandFragments": None, - }, - ], - "backtrace": [ - { - "file": "^cxx/CMakeLists\\.txt$", - "line": 10, - "command": "add_executable", - "hasParent": True, - }, - { - "file": "^cxx/CMakeLists\\.txt$", - "line": None, - "command": None, - "hasParent": False, - }, - ], - "folder": None, - "nameOnDisk": "^cxx_shared_exe(\\.exe)?$", - "artifacts": [ - { - "path": "^cxx/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?cxx_shared_exe(\\.exe)?$", - "_dllExtra": False, - }, - { - "path": "^cxx/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?cxx_shared_exe\\.pdb$", - "_dllExtra": True, - }, - ], - "build": "^cxx$", - "source": "^cxx$", - "install": None, - "link": { - "language": "CXX", - "lto": None, - "commandFragments": None, - }, - "archive": None, - "dependencies": [ - { - "id": "^cxx_shared_lib::@a56b12a3f5c0529fb296$", - "backtrace": [ - { - "file": "^cxx/CMakeLists\\.txt$", - "line": 11, - "command": "target_link_libraries", - "hasParent": True, - }, - { - "file": "^cxx/CMakeLists\\.txt$", - "line": None, - "command": None, - "hasParent": False, - }, - ], - }, - { - "id": "^ZERO_CHECK::@a56b12a3f5c0529fb296$", - "backtrace": None, - }, - ], - }, - { - "name": "cxx_static_lib", - "id": "^cxx_static_lib::@a56b12a3f5c0529fb296$", - "directorySource": "^cxx$", - "projectName": "Cxx", - "type": "STATIC_LIBRARY", - "isGeneratorProvided": None, - "sources": [ - { - "path": "^empty\\.cxx$", - "isGenerated": None, - "sourceGroupName": "Source Files", - "compileGroupLanguage": "CXX", - "backtrace": [ - { - "file": "^cxx/CMakeLists\\.txt$", - "line": 13, - "command": "add_library", - "hasParent": True, - }, - { - "file": "^cxx/CMakeLists\\.txt$", - "line": None, - "command": None, - "hasParent": False, - }, - ], - }, - ], - "sourceGroups": [ - { - "name": "Source Files", - "sourcePaths": [ - "^empty\\.cxx$", - ], - }, - ], - "compileGroups": [ - { - "language": "CXX", - "sourcePaths": [ - "^empty\\.cxx$", - ], - "includes": None, - "defines": None, - "compileCommandFragments": None, - }, - ], - "backtrace": [ - { - "file": "^cxx/CMakeLists\\.txt$", - "line": 13, - "command": "add_library", - "hasParent": True, - }, - { - "file": "^cxx/CMakeLists\\.txt$", - "line": None, - "command": None, - "hasParent": False, - }, - ], - "folder": None, - "nameOnDisk": "^(lib)?cxx_static_lib\\.(a|lib)$", - "artifacts": [ - { - "path": "^cxx/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?(lib)?cxx_static_lib\\.(a|lib)$", - "_dllExtra": False, - }, - ], - "build": "^cxx$", - "source": "^cxx$", - "install": None, - "link": None, - "archive": { - "lto": None, - }, - "dependencies": [ - { - "id": "^ZERO_CHECK::@a56b12a3f5c0529fb296$", - "backtrace": None, - }, - ], - }, - { - "name": "cxx_static_exe", - "id": "^cxx_static_exe::@a56b12a3f5c0529fb296$", - "directorySource": "^cxx$", - "projectName": "Cxx", - "type": "EXECUTABLE", - "isGeneratorProvided": None, - "sources": [ - { - "path": "^empty\\.cxx$", - "isGenerated": None, - "sourceGroupName": "Source Files", - "compileGroupLanguage": "CXX", - "backtrace": [ - { - "file": "^cxx/CMakeLists\\.txt$", - "line": 14, - "command": "add_executable", - "hasParent": True, - }, - { - "file": "^cxx/CMakeLists\\.txt$", - "line": None, - "command": None, - "hasParent": False, - }, - ], - }, - ], - "sourceGroups": [ - { - "name": "Source Files", - "sourcePaths": [ - "^empty\\.cxx$", - ], - }, - ], - "compileGroups": [ - { - "language": "CXX", - "sourcePaths": [ - "^empty\\.cxx$", - ], - "includes": None, - "defines": None, - "compileCommandFragments": None, - }, - ], - "backtrace": [ - { - "file": "^cxx/CMakeLists\\.txt$", - "line": 14, - "command": "add_executable", - "hasParent": True, - }, - { - "file": "^cxx/CMakeLists\\.txt$", - "line": None, - "command": None, - "hasParent": False, - }, - ], - "folder": None, - "nameOnDisk": "^cxx_static_exe(\\.exe)?$", - "artifacts": [ - { - "path": "^cxx/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?cxx_static_exe(\\.exe)?$", - "_dllExtra": False, - }, - { - "path": "^cxx/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?cxx_static_exe\\.pdb$", - "_dllExtra": True, - }, - ], - "build": "^cxx$", - "source": "^cxx$", - "install": None, - "link": { - "language": "CXX", - "lto": None, - "commandFragments": None, - }, - "archive": None, - "dependencies": [ - { - "id": "^cxx_static_lib::@a56b12a3f5c0529fb296$", - "backtrace": [ - { - "file": "^cxx/CMakeLists\\.txt$", - "line": 15, - "command": "target_link_libraries", - "hasParent": True, - }, - { - "file": "^cxx/CMakeLists\\.txt$", - "line": None, - "command": None, - "hasParent": False, - }, - ], - }, - { - "id": "^ZERO_CHECK::@a56b12a3f5c0529fb296$", - "backtrace": None, - }, - ], - }, - { - "name": "ALL_BUILD", - "id": "^ALL_BUILD::@53632cba2752272bb008$", - "directorySource": "^alias$", - "projectName": "Alias", - "type": "UTILITY", - "isGeneratorProvided": True, - "sources": [ - { - "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/alias/CMakeFiles/ALL_BUILD$", - "isGenerated": True, - "sourceGroupName": "", - "compileGroupLanguage": None, - "backtrace": [ - { - "file": "^alias/CMakeLists\\.txt$", - "line": None, - "command": None, - "hasParent": False, - }, - ], - }, - { - "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/alias/CMakeFiles/ALL_BUILD\\.rule$", - "isGenerated": True, - "sourceGroupName": "CMake Rules", - "compileGroupLanguage": None, - "backtrace": [ - { - "file": "^alias/CMakeLists\\.txt$", - "line": None, - "command": None, - "hasParent": False, - }, - ], - }, - ], - "sourceGroups": [ - { - "name": "", - "sourcePaths": [ - "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/alias/CMakeFiles/ALL_BUILD$", - ], - }, - { - "name": "CMake Rules", - "sourcePaths": [ - "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/alias/CMakeFiles/ALL_BUILD\\.rule$", - ], - }, - ], - "compileGroups": None, - "backtrace": [ - { - "file": "^alias/CMakeLists\\.txt$", - "line": None, - "command": None, - "hasParent": False, - }, - ], - "folder": None, - "nameOnDisk": None, - "artifacts": None, - "build": "^alias$", - "source": "^alias$", - "install": None, - "link": None, - "archive": None, - "dependencies": [ - { - "id": "^ZERO_CHECK::@53632cba2752272bb008$", - "backtrace": None, - }, - { - "id": "^c_alias_exe::@53632cba2752272bb008$", - "backtrace": None, - }, - { - "id": "^cxx_alias_exe::@53632cba2752272bb008$", - "backtrace": None, - }, - ], - }, - { - "name": "ZERO_CHECK", - "id": "^ZERO_CHECK::@53632cba2752272bb008$", - "directorySource": "^alias$", - "projectName": "Alias", - "type": "UTILITY", - "isGeneratorProvided": True, - "sources": [ - { - "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/alias/CMakeFiles/ZERO_CHECK$", - "isGenerated": True, - "sourceGroupName": "", - "compileGroupLanguage": None, - "backtrace": [ - { - "file": "^alias/CMakeLists\\.txt$", - "line": None, - "command": None, - "hasParent": False, - }, - ], - }, - { - "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/alias/CMakeFiles/ZERO_CHECK\\.rule$", - "isGenerated": True, - "sourceGroupName": "CMake Rules", - "compileGroupLanguage": None, - "backtrace": [ - { - "file": "^alias/CMakeLists\\.txt$", - "line": None, - "command": None, - "hasParent": False, - }, - ], - }, - ], - "sourceGroups": [ - { - "name": "", - "sourcePaths": [ - "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/alias/CMakeFiles/ZERO_CHECK$", - ], - }, - { - "name": "CMake Rules", - "sourcePaths": [ - "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/alias/CMakeFiles/ZERO_CHECK\\.rule$", - ], - }, - ], - "compileGroups": None, - "backtrace": [ - { - "file": "^alias/CMakeLists\\.txt$", - "line": None, - "command": None, - "hasParent": False, - }, - ], - "folder": None, - "nameOnDisk": None, - "artifacts": None, - "build": "^alias$", - "source": "^alias$", - "install": None, - "link": None, - "archive": None, - "dependencies": None, - }, - { - "name": "c_alias_exe", - "id": "^c_alias_exe::@53632cba2752272bb008$", - "directorySource": "^alias$", - "projectName": "Alias", - "type": "EXECUTABLE", - "isGeneratorProvided": None, - "sources": [ - { - "path": "^empty\\.c$", - "isGenerated": None, - "sourceGroupName": "Source Files", - "compileGroupLanguage": "C", - "backtrace": [ - { - "file": "^alias/CMakeLists\\.txt$", - "line": 5, - "command": "add_executable", - "hasParent": True, - }, - { - "file": "^alias/CMakeLists\\.txt$", - "line": None, - "command": None, - "hasParent": False, - }, - ], - }, - ], - "sourceGroups": [ - { - "name": "Source Files", - "sourcePaths": [ - "^empty\\.c$", - ], - }, - ], - "compileGroups": [ - { - "language": "C", - "sourcePaths": [ - "^empty\\.c$", - ], - "includes": None, - "defines": None, - "compileCommandFragments": None, - }, - ], - "backtrace": [ - { - "file": "^alias/CMakeLists\\.txt$", - "line": 5, - "command": "add_executable", - "hasParent": True, - }, - { - "file": "^alias/CMakeLists\\.txt$", - "line": None, - "command": None, - "hasParent": False, - }, - ], - "folder": None, - "nameOnDisk": "^c_alias_exe(\\.exe)?$", - "artifacts": [ - { - "path": "^alias/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?c_alias_exe(\\.exe)?$", - "_dllExtra": False, - }, - { - "path": "^alias/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?c_alias_exe\\.pdb$", - "_dllExtra": True, - }, - ], - "build": "^alias$", - "source": "^alias$", - "install": None, - "link": { - "language": "C", - "lto": None, - "commandFragments": None, - }, - "archive": None, - "dependencies": [ - { - "id": "^c_lib::@6890427a1f51a3e7e1df$", - "backtrace": [ - { - "file": "^alias/CMakeLists\\.txt$", - "line": 6, - "command": "target_link_libraries", - "hasParent": True, - }, - { - "file": "^alias/CMakeLists\\.txt$", - "line": None, - "command": None, - "hasParent": False, - }, - ], - }, - { - "id": "^ZERO_CHECK::@53632cba2752272bb008$", - "backtrace": None, - }, - ], - }, - { - "name": "cxx_alias_exe", - "id": "^cxx_alias_exe::@53632cba2752272bb008$", - "directorySource": "^alias$", - "projectName": "Alias", - "type": "EXECUTABLE", - "isGeneratorProvided": None, - "sources": [ - { - "path": "^empty\\.cxx$", - "isGenerated": None, - "sourceGroupName": "Source Files", - "compileGroupLanguage": "CXX", - "backtrace": [ - { - "file": "^alias/CMakeLists\\.txt$", - "line": 9, - "command": "add_executable", - "hasParent": True, - }, - { - "file": "^alias/CMakeLists\\.txt$", - "line": None, - "command": None, - "hasParent": False, - }, - ], - }, - ], - "sourceGroups": [ - { - "name": "Source Files", - "sourcePaths": [ - "^empty\\.cxx$", - ], - }, - ], - "compileGroups": [ - { - "language": "CXX", - "sourcePaths": [ - "^empty\\.cxx$", - ], - "includes": None, - "defines": None, - "compileCommandFragments": None, - }, - ], - "backtrace": [ - { - "file": "^alias/CMakeLists\\.txt$", - "line": 9, - "command": "add_executable", - "hasParent": True, - }, - { - "file": "^alias/CMakeLists\\.txt$", - "line": None, - "command": None, - "hasParent": False, - }, - ], - "folder": None, - "nameOnDisk": "^cxx_alias_exe(\\.exe)?$", - "artifacts": [ - { - "path": "^alias/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?cxx_alias_exe(\\.exe)?$", - "_dllExtra": False, - }, - { - "path": "^alias/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?cxx_alias_exe\\.pdb$", - "_dllExtra": True, - }, - ], - "build": "^alias$", - "source": "^alias$", - "install": None, - "link": { - "language": "CXX", - "lto": None, - "commandFragments": None, - }, - "archive": None, - "dependencies": [ - { - "id": "^cxx_lib::@a56b12a3f5c0529fb296$", - "backtrace": [ - { - "file": "^alias/CMakeLists\\.txt$", - "line": 10, - "command": "target_link_libraries", - "hasParent": True, - }, - { - "file": "^alias/CMakeLists\\.txt$", - "line": None, - "command": None, - "hasParent": False, - }, - ], - }, - { - "id": "^ZERO_CHECK::@53632cba2752272bb008$", - "backtrace": None, - }, - ], - }, - { - "name": "ALL_BUILD", - "id": "^ALL_BUILD::@5ed5358f70faf8d8af7a$", - "directorySource": "^object$", - "projectName": "Object", - "type": "UTILITY", - "isGeneratorProvided": True, - "sources": [ - { - "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/object/CMakeFiles/ALL_BUILD$", - "isGenerated": True, - "sourceGroupName": "", - "compileGroupLanguage": None, - "backtrace": [ - { - "file": "^object/CMakeLists\\.txt$", - "line": None, - "command": None, - "hasParent": False, - }, - ], - }, - { - "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/object/CMakeFiles/ALL_BUILD\\.rule$", - "isGenerated": True, - "sourceGroupName": "CMake Rules", - "compileGroupLanguage": None, - "backtrace": [ - { - "file": "^object/CMakeLists\\.txt$", - "line": None, - "command": None, - "hasParent": False, - }, - ], - }, - ], - "sourceGroups": [ - { - "name": "", - "sourcePaths": [ - "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/object/CMakeFiles/ALL_BUILD$", - ], - }, - { - "name": "CMake Rules", - "sourcePaths": [ - "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/object/CMakeFiles/ALL_BUILD\\.rule$", - ], - }, - ], - "compileGroups": None, - "backtrace": [ - { - "file": "^object/CMakeLists\\.txt$", - "line": None, - "command": None, - "hasParent": False, - }, - ], - "folder": None, - "nameOnDisk": None, - "artifacts": None, - "build": "^object$", - "source": "^object$", - "install": None, - "link": None, - "archive": None, - "dependencies": [ - { - "id": "^ZERO_CHECK::@5ed5358f70faf8d8af7a$", - "backtrace": None, - }, - { - "id": "^c_object_lib::@5ed5358f70faf8d8af7a$", - "backtrace": None, - }, - { - "id": "^c_object_exe::@5ed5358f70faf8d8af7a$", - "backtrace": None, - }, - { - "id": "^cxx_object_lib::@5ed5358f70faf8d8af7a$", - "backtrace": None, - }, - { - "id": "^cxx_object_exe::@5ed5358f70faf8d8af7a$", - "backtrace": None, - }, - ], - }, - { - "name": "ZERO_CHECK", - "id": "^ZERO_CHECK::@5ed5358f70faf8d8af7a$", - "directorySource": "^object$", - "projectName": "Object", - "type": "UTILITY", - "isGeneratorProvided": True, - "sources": [ - { - "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/object/CMakeFiles/ZERO_CHECK$", - "isGenerated": True, - "sourceGroupName": "", - "compileGroupLanguage": None, - "backtrace": [ - { - "file": "^object/CMakeLists\\.txt$", - "line": None, - "command": None, - "hasParent": False, - }, - ], - }, - { - "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/object/CMakeFiles/ZERO_CHECK\\.rule$", - "isGenerated": True, - "sourceGroupName": "CMake Rules", - "compileGroupLanguage": None, - "backtrace": [ - { - "file": "^object/CMakeLists\\.txt$", - "line": None, - "command": None, - "hasParent": False, - }, - ], - }, - ], - "sourceGroups": [ - { - "name": "", - "sourcePaths": [ - "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/object/CMakeFiles/ZERO_CHECK$", - ], - }, - { - "name": "CMake Rules", - "sourcePaths": [ - "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/object/CMakeFiles/ZERO_CHECK\\.rule$", - ], - }, - ], - "compileGroups": None, - "backtrace": [ - { - "file": "^object/CMakeLists\\.txt$", - "line": None, - "command": None, - "hasParent": False, - }, - ], - "folder": None, - "nameOnDisk": None, - "artifacts": None, - "build": "^object$", - "source": "^object$", - "install": None, - "link": None, - "archive": None, - "dependencies": None, - }, - { - "name": "c_object_lib", - "id": "^c_object_lib::@5ed5358f70faf8d8af7a$", - "directorySource": "^object$", - "projectName": "Object", - "type": "OBJECT_LIBRARY", - "isGeneratorProvided": None, - "sources": [ - { - "path": "^empty\\.c$", - "isGenerated": None, - "sourceGroupName": "Source Files", - "compileGroupLanguage": "C", - "backtrace": [ - { - "file": "^object/CMakeLists\\.txt$", - "line": 5, - "command": "add_library", - "hasParent": True, - }, - { - "file": "^object/CMakeLists\\.txt$", - "line": None, - "command": None, - "hasParent": False, - }, - ], - }, - ], - "sourceGroups": [ - { - "name": "Source Files", - "sourcePaths": [ - "^empty\\.c$", - ], - }, - ], - "compileGroups": [ - { - "language": "C", - "sourcePaths": [ - "^empty\\.c$", - ], - "includes": None, - "defines": None, - "compileCommandFragments": None, - }, - ], - "backtrace": [ - { - "file": "^object/CMakeLists\\.txt$", - "line": 5, - "command": "add_library", - "hasParent": True, - }, - { - "file": "^object/CMakeLists\\.txt$", - "line": None, - "command": None, - "hasParent": False, - }, - ], - "folder": None, - "nameOnDisk": None, - "artifacts": [ - { - "path": "^object/.*/empty(\\.c)?\\.o(bj)?$", - "_dllExtra": False, - }, - ], - "build": "^object$", - "source": "^object$", - "install": None, - "link": None, - "archive": None, - "dependencies": [ - { - "id": "^ZERO_CHECK::@5ed5358f70faf8d8af7a$", - "backtrace": None, - }, - ], - }, - { - "name": "c_object_exe", - "id": "^c_object_exe::@5ed5358f70faf8d8af7a$", - "directorySource": "^object$", - "projectName": "Object", - "type": "EXECUTABLE", - "isGeneratorProvided": None, - "sources": [ - { - "path": "^empty\\.c$", - "isGenerated": None, - "sourceGroupName": "Source Files", - "compileGroupLanguage": "C", - "backtrace": [ - { - "file": "^object/CMakeLists\\.txt$", - "line": 6, - "command": "add_executable", - "hasParent": True, - }, - { - "file": "^object/CMakeLists\\.txt$", - "line": None, - "command": None, - "hasParent": False, - }, - ], - }, - { - "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/object/.*/empty(\\.c)?\\.o(bj)?$", - "isGenerated": True, - "sourceGroupName": "Object Libraries", - "compileGroupLanguage": None, - "backtrace": [ - { - "file": "^object/CMakeLists\\.txt$", - "line": 7, - "command": "target_link_libraries", - "hasParent": True, - }, - { - "file": "^object/CMakeLists\\.txt$", - "line": None, - "command": None, - "hasParent": False, - }, - ], - }, - ], - "sourceGroups": [ - { - "name": "Source Files", - "sourcePaths": [ - "^empty\\.c$", - ], - }, - { - "name": "Object Libraries", - "sourcePaths": [ - "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/object/.*/empty(\\.c)?\\.o(bj)?$", - ], - }, - ], - "compileGroups": [ - { - "language": "C", - "sourcePaths": [ - "^empty\\.c$", - ], - "includes": None, - "defines": None, - "compileCommandFragments": None, - }, - ], - "backtrace": [ - { - "file": "^object/CMakeLists\\.txt$", - "line": 6, - "command": "add_executable", - "hasParent": True, - }, - { - "file": "^object/CMakeLists\\.txt$", - "line": None, - "command": None, - "hasParent": False, - }, - ], - "folder": None, - "nameOnDisk": "^c_object_exe(\\.exe)?$", - "artifacts": [ - { - "path": "^object/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?c_object_exe(\\.exe)?$", - "_dllExtra": False, - }, - { - "path": "^object/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?c_object_exe\\.pdb$", - "_dllExtra": True, - }, - ], - "build": "^object$", - "source": "^object$", - "install": { - "prefix": "^(/usr/local|[A-Za-z]:.*/codemodel-v2)$", - "destinations": [ - { - "path": "bin", - "backtrace": [ - { - "file": "^object/CMakeLists\\.txt$", - "line": 13, - "command": "install", - "hasParent": True, - }, - { - "file": "^object/CMakeLists\\.txt$", - "line": None, - "command": None, - "hasParent": False, - }, - ], - }, - ], - }, - "link": { - "language": "C", - "lto": None, - "commandFragments": None, - }, - "archive": None, - "dependencies": [ - { - "id": "^c_object_lib::@5ed5358f70faf8d8af7a$", - # FIXME: Add a backtrace here when it becomes available. - # You'll know when it's available, because this test will - # fail. - "backtrace": None, - }, - { - "id": "^ZERO_CHECK::@5ed5358f70faf8d8af7a$", - "backtrace": None, - }, - ], - }, - { - "name": "cxx_object_lib", - "id": "^cxx_object_lib::@5ed5358f70faf8d8af7a$", - "directorySource": "^object$", - "projectName": "Object", - "type": "OBJECT_LIBRARY", - "isGeneratorProvided": None, - "sources": [ - { - "path": "^empty\\.cxx$", - "isGenerated": None, - "sourceGroupName": "Source Files", - "compileGroupLanguage": "CXX", - "backtrace": [ - { - "file": "^object/CMakeLists\\.txt$", - "line": 9, - "command": "add_library", - "hasParent": True, - }, - { - "file": "^object/CMakeLists\\.txt$", - "line": None, - "command": None, - "hasParent": False, - }, - ], - }, - ], - "sourceGroups": [ - { - "name": "Source Files", - "sourcePaths": [ - "^empty\\.cxx$", - ], - }, - ], - "compileGroups": [ - { - "language": "CXX", - "sourcePaths": [ - "^empty\\.cxx$", - ], - "includes": None, - "defines": None, - "compileCommandFragments": None, - }, - ], - "backtrace": [ - { - "file": "^object/CMakeLists\\.txt$", - "line": 9, - "command": "add_library", - "hasParent": True, - }, - { - "file": "^object/CMakeLists\\.txt$", - "line": None, - "command": None, - "hasParent": False, - }, - ], - "folder": None, - "nameOnDisk": None, - "artifacts": [ - { - "path": "^object/.*/empty(\\.cxx)?\\.o(bj)?$", - "_dllExtra": False, - }, - ], - "build": "^object$", - "source": "^object$", - "install": None, - "link": None, - "archive": None, - "dependencies": [ - { - "id": "^ZERO_CHECK::@5ed5358f70faf8d8af7a$", - "backtrace": None, - }, - ], - }, - { - "name": "cxx_object_exe", - "id": "^cxx_object_exe::@5ed5358f70faf8d8af7a$", - "directorySource": "^object$", - "projectName": "Object", - "type": "EXECUTABLE", - "isGeneratorProvided": None, - "sources": [ - { - "path": "^empty\\.cxx$", - "isGenerated": None, - "sourceGroupName": "Source Files", - "compileGroupLanguage": "CXX", - "backtrace": [ - { - "file": "^object/CMakeLists\\.txt$", - "line": 10, - "command": "add_executable", - "hasParent": True, - }, - { - "file": "^object/CMakeLists\\.txt$", - "line": None, - "command": None, - "hasParent": False, - }, - ], - }, - { - "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/object/.*/empty(\\.cxx)?\\.o(bj)?$", - "isGenerated": True, - "sourceGroupName": "Object Libraries", - "compileGroupLanguage": None, - "backtrace": [ - { - "file": "^object/CMakeLists\\.txt$", - "line": 11, - "command": "target_link_libraries", - "hasParent": True, - }, - { - "file": "^object/CMakeLists\\.txt$", - "line": None, - "command": None, - "hasParent": False, - }, - ], - }, - ], - "sourceGroups": [ - { - "name": "Source Files", - "sourcePaths": [ - "^empty\\.cxx$", - ], - }, - { - "name": "Object Libraries", - "sourcePaths": [ - "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/object/.*/empty(\\.cxx)?\\.o(bj)?$", - ], - }, - ], - "compileGroups": [ - { - "language": "CXX", - "sourcePaths": [ - "^empty\\.cxx$", - ], - "includes": None, - "defines": None, - "compileCommandFragments": None, - }, - ], - "backtrace": [ - { - "file": "^object/CMakeLists\\.txt$", - "line": 10, - "command": "add_executable", - "hasParent": True, - }, - { - "file": "^object/CMakeLists\\.txt$", - "line": None, - "command": None, - "hasParent": False, - }, - ], - "folder": None, - "nameOnDisk": "^cxx_object_exe(\\.exe)?$", - "artifacts": [ - { - "path": "^object/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?cxx_object_exe(\\.exe)?$", - "_dllExtra": False, - }, - { - "path": "^object/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?cxx_object_exe\\.pdb$", - "_dllExtra": True, - }, - ], - "build": "^object$", - "source": "^object$", - "install": { - "prefix": "^(/usr/local|[A-Za-z]:.*/codemodel-v2)$", - "destinations": [ - { - "path": "bin", - "backtrace": [ - { - "file": "^object/CMakeLists\\.txt$", - "line": 13, - "command": "install", - "hasParent": True, - }, - { - "file": "^object/CMakeLists\\.txt$", - "line": None, - "command": None, - "hasParent": False, - }, - ], - }, - ], - }, - "link": { - "language": "CXX", - "lto": None, - "commandFragments": None, - }, - "archive": None, - "dependencies": [ - { - "id": "^cxx_object_lib::@5ed5358f70faf8d8af7a$", - # FIXME: Add a backtrace here when it becomes available. - # You'll know when it's available, because this test will - # fail. - "backtrace": None, - }, - { - "id": "^ZERO_CHECK::@5ed5358f70faf8d8af7a$", - "backtrace": None, - }, - ], - }, - { - "name": "ALL_BUILD", - "id": "^ALL_BUILD::@ba7eb709d0b48779c6c8$", - "directorySource": "^imported$", - "projectName": "Imported", - "type": "UTILITY", - "isGeneratorProvided": True, - "sources": [ - { - "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/imported/CMakeFiles/ALL_BUILD$", - "isGenerated": True, - "sourceGroupName": "", - "compileGroupLanguage": None, - "backtrace": [ - { - "file": "^imported/CMakeLists\\.txt$", - "line": None, - "command": None, - "hasParent": False, - }, - ], - }, - { - "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/imported/CMakeFiles/ALL_BUILD\\.rule$", - "isGenerated": True, - "sourceGroupName": "CMake Rules", - "compileGroupLanguage": None, - "backtrace": [ - { - "file": "^imported/CMakeLists\\.txt$", - "line": None, - "command": None, - "hasParent": False, - }, - ], - }, - ], - "sourceGroups": [ - { - "name": "", - "sourcePaths": [ - "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/imported/CMakeFiles/ALL_BUILD$", - ], - }, - { - "name": "CMake Rules", - "sourcePaths": [ - "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/imported/CMakeFiles/ALL_BUILD\\.rule$", - ], - }, - ], - "compileGroups": None, - "backtrace": [ - { - "file": "^imported/CMakeLists\\.txt$", - "line": None, - "command": None, - "hasParent": False, - }, - ], - "folder": None, - "nameOnDisk": None, - "artifacts": None, - "build": "^imported$", - "source": "^imported$", - "install": None, - "link": None, - "archive": None, - "dependencies": [ - { - "id": "^ZERO_CHECK::@ba7eb709d0b48779c6c8$", - "backtrace": None, - }, - { - "id": "^link_imported_exe::@ba7eb709d0b48779c6c8$", - "backtrace": None, - }, - { - "id": "^link_imported_shared_exe::@ba7eb709d0b48779c6c8$", - "backtrace": None, - }, - { - "id": "^link_imported_static_exe::@ba7eb709d0b48779c6c8$", - "backtrace": None, - }, - { - "id": "^link_imported_object_exe::@ba7eb709d0b48779c6c8$", - "backtrace": None, - }, - { - "id": "^link_imported_interface_exe::@ba7eb709d0b48779c6c8$", - "backtrace": None, - }, - ], - }, - { - "name": "ZERO_CHECK", - "id": "^ZERO_CHECK::@ba7eb709d0b48779c6c8$", - "directorySource": "^imported$", - "projectName": "Imported", - "type": "UTILITY", - "isGeneratorProvided": True, - "sources": [ - { - "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/imported/CMakeFiles/ZERO_CHECK$", - "isGenerated": True, - "sourceGroupName": "", - "compileGroupLanguage": None, - "backtrace": [ - { - "file": "^imported/CMakeLists\\.txt$", - "line": None, - "command": None, - "hasParent": False, - }, - ], - }, - { - "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/imported/CMakeFiles/ZERO_CHECK\\.rule$", - "isGenerated": True, - "sourceGroupName": "CMake Rules", - "compileGroupLanguage": None, - "backtrace": [ - { - "file": "^imported/CMakeLists\\.txt$", - "line": None, - "command": None, - "hasParent": False, - }, - ], - }, - ], - "sourceGroups": [ - { - "name": "", - "sourcePaths": [ - "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/imported/CMakeFiles/ZERO_CHECK$", - ], - }, - { - "name": "CMake Rules", - "sourcePaths": [ - "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/imported/CMakeFiles/ZERO_CHECK\\.rule$", - ], - }, - ], - "compileGroups": None, - "backtrace": [ - { - "file": "^imported/CMakeLists\\.txt$", - "line": None, - "command": None, - "hasParent": False, - }, - ], - "folder": None, - "nameOnDisk": None, - "artifacts": None, - "build": "^imported$", - "source": "^imported$", - "install": None, - "link": None, - "archive": None, - "dependencies": None, - }, - { - "name": "link_imported_exe", - "id": "^link_imported_exe::@ba7eb709d0b48779c6c8$", - "directorySource": "^imported$", - "projectName": "Imported", - "type": "EXECUTABLE", - "isGeneratorProvided": None, - "sources": [ - { - "path": "^empty\\.c$", - "isGenerated": None, - "sourceGroupName": "Source Files", - "compileGroupLanguage": "C", - "backtrace": [ - { - "file": "^imported/CMakeLists\\.txt$", - "line": 5, - "command": "add_executable", - "hasParent": True, - }, - { - "file": "^imported/CMakeLists\\.txt$", - "line": None, - "command": None, - "hasParent": False, - }, - ], - }, - ], - "sourceGroups": [ - { - "name": "Source Files", - "sourcePaths": [ - "^empty\\.c$", - ], - }, - ], - "compileGroups": [ - { - "language": "C", - "sourcePaths": [ - "^empty\\.c$", - ], - "includes": None, - "defines": None, - "compileCommandFragments": None, - }, - ], - "backtrace": [ - { - "file": "^imported/CMakeLists\\.txt$", - "line": 5, - "command": "add_executable", - "hasParent": True, - }, - { - "file": "^imported/CMakeLists\\.txt$", - "line": None, - "command": None, - "hasParent": False, - }, - ], - "folder": None, - "nameOnDisk": "^link_imported_exe(\\.exe)?$", - "artifacts": [ - { - "path": "^imported/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?link_imported_exe(\\.exe)?$", - "_dllExtra": False, - }, - { - "path": "^imported/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?link_imported_exe\\.pdb$", - "_dllExtra": True, - }, - ], - "build": "^imported$", - "source": "^imported$", - "install": None, - "link": { - "language": "C", - "lto": None, - "commandFragments": None, - }, - "archive": None, - "dependencies": [ - { - "id": "^ZERO_CHECK::@ba7eb709d0b48779c6c8$", - "backtrace": None, - }, - ], - }, - { - "name": "link_imported_shared_exe", - "id": "^link_imported_shared_exe::@ba7eb709d0b48779c6c8$", - "directorySource": "^imported$", - "projectName": "Imported", - "type": "EXECUTABLE", - "isGeneratorProvided": None, - "sources": [ - { - "path": "^empty\\.c$", - "isGenerated": None, - "sourceGroupName": "Source Files", - "compileGroupLanguage": "C", - "backtrace": [ - { - "file": "^imported/CMakeLists\\.txt$", - "line": 9, - "command": "add_executable", - "hasParent": True, - }, - { - "file": "^imported/CMakeLists\\.txt$", - "line": None, - "command": None, - "hasParent": False, - }, - ], - }, - ], - "sourceGroups": [ - { - "name": "Source Files", - "sourcePaths": [ - "^empty\\.c$", - ], - }, - ], - "compileGroups": [ - { - "language": "C", - "sourcePaths": [ - "^empty\\.c$", - ], - "includes": None, - "defines": None, - "compileCommandFragments": None, - }, - ], - "backtrace": [ - { - "file": "^imported/CMakeLists\\.txt$", - "line": 9, - "command": "add_executable", - "hasParent": True, - }, - { - "file": "^imported/CMakeLists\\.txt$", - "line": None, - "command": None, - "hasParent": False, - }, - ], - "folder": None, - "nameOnDisk": "^link_imported_shared_exe(\\.exe)?$", - "artifacts": [ - { - "path": "^imported/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?link_imported_shared_exe(\\.exe)?$", - "_dllExtra": False, - }, - { - "path": "^imported/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?link_imported_shared_exe\\.pdb$", - "_dllExtra": True, - }, - ], - "build": "^imported$", - "source": "^imported$", - "install": None, - "link": { - "language": "C", - "lto": None, - "commandFragments": None, - }, - "archive": None, - "dependencies": [ - { - "id": "^ZERO_CHECK::@ba7eb709d0b48779c6c8$", - "backtrace": None, - }, - ], - }, - { - "name": "link_imported_static_exe", - "id": "^link_imported_static_exe::@ba7eb709d0b48779c6c8$", - "directorySource": "^imported$", - "projectName": "Imported", - "type": "EXECUTABLE", - "isGeneratorProvided": None, - "sources": [ - { - "path": "^empty\\.c$", - "isGenerated": None, - "sourceGroupName": "Source Files", - "compileGroupLanguage": "C", - "backtrace": [ - { - "file": "^imported/CMakeLists\\.txt$", - "line": 13, - "command": "add_executable", - "hasParent": True, - }, - { - "file": "^imported/CMakeLists\\.txt$", - "line": None, - "command": None, - "hasParent": False, - }, - ], - }, - ], - "sourceGroups": [ - { - "name": "Source Files", - "sourcePaths": [ - "^empty\\.c$", - ], - }, - ], - "compileGroups": [ - { - "language": "C", - "sourcePaths": [ - "^empty\\.c$", - ], - "includes": None, - "defines": None, - "compileCommandFragments": None, - }, - ], - "backtrace": [ - { - "file": "^imported/CMakeLists\\.txt$", - "line": 13, - "command": "add_executable", - "hasParent": True, - }, - { - "file": "^imported/CMakeLists\\.txt$", - "line": None, - "command": None, - "hasParent": False, - }, - ], - "folder": None, - "nameOnDisk": "^link_imported_static_exe(\\.exe)?$", - "artifacts": [ - { - "path": "^imported/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?link_imported_static_exe(\\.exe)?$", - "_dllExtra": False, - }, - { - "path": "^imported/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?link_imported_static_exe\\.pdb$", - "_dllExtra": True, - }, - ], - "build": "^imported$", - "source": "^imported$", - "install": None, - "link": { - "language": "C", - "lto": None, - "commandFragments": None, - }, - "archive": None, - "dependencies": [ - { - "id": "^ZERO_CHECK::@ba7eb709d0b48779c6c8$", - "backtrace": None, - }, - ], - }, - { - "name": "link_imported_object_exe", - "id": "^link_imported_object_exe::@ba7eb709d0b48779c6c8$", - "directorySource": "^imported$", - "projectName": "Imported", - "type": "EXECUTABLE", - "isGeneratorProvided": None, - "sources": [ - { - "path": "^empty\\.c$", - "isGenerated": None, - "sourceGroupName": "Source Files", - "compileGroupLanguage": "C", - "backtrace": [ - { - "file": "^imported/CMakeLists\\.txt$", - "line": 18, - "command": "add_executable", - "hasParent": True, - }, - { - "file": "^imported/CMakeLists\\.txt$", - "line": None, - "command": None, - "hasParent": False, - }, - ], - }, - ], - "sourceGroups": [ - { - "name": "Source Files", - "sourcePaths": [ - "^empty\\.c$", - ], - }, - ], - "compileGroups": [ - { - "language": "C", - "sourcePaths": [ - "^empty\\.c$", - ], - "includes": None, - "defines": None, - "compileCommandFragments": None, - }, - ], - "backtrace": [ - { - "file": "^imported/CMakeLists\\.txt$", - "line": 18, - "command": "add_executable", - "hasParent": True, - }, - { - "file": "^imported/CMakeLists\\.txt$", - "line": None, - "command": None, - "hasParent": False, - }, - ], - "folder": None, - "nameOnDisk": "^link_imported_object_exe(\\.exe)?$", - "artifacts": [ - { - "path": "^imported/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?link_imported_object_exe(\\.exe)?$", - "_dllExtra": False, - }, - { - "path": "^imported/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?link_imported_object_exe\\.pdb$", - "_dllExtra": True, - }, - ], - "build": "^imported$", - "source": "^imported$", - "install": None, - "link": { - "language": "C", - "lto": None, - "commandFragments": None, - }, - "archive": None, - "dependencies": [ - { - "id": "^ZERO_CHECK::@ba7eb709d0b48779c6c8$", - "backtrace": None, - }, - ], - }, - { - "name": "link_imported_interface_exe", - "id": "^link_imported_interface_exe::@ba7eb709d0b48779c6c8$", - "directorySource": "^imported$", - "projectName": "Imported", - "type": "EXECUTABLE", - "isGeneratorProvided": None, - "sources": [ - { - "path": "^empty\\.c$", - "isGenerated": None, - "sourceGroupName": "Source Files", - "compileGroupLanguage": "C", - "backtrace": [ - { - "file": "^imported/CMakeLists\\.txt$", - "line": 23, - "command": "add_executable", - "hasParent": True, - }, - { - "file": "^imported/CMakeLists\\.txt$", - "line": None, - "command": None, - "hasParent": False, - }, - ], - }, - ], - "sourceGroups": [ - { - "name": "Source Files", - "sourcePaths": [ - "^empty\\.c$", - ], - }, - ], - "compileGroups": [ - { - "language": "C", - "sourcePaths": [ - "^empty\\.c$", - ], - "includes": None, - "defines": None, - "compileCommandFragments": None, - }, - ], - "backtrace": [ - { - "file": "^imported/CMakeLists\\.txt$", - "line": 23, - "command": "add_executable", - "hasParent": True, - }, - { - "file": "^imported/CMakeLists\\.txt$", - "line": None, - "command": None, - "hasParent": False, - }, - ], - "folder": None, - "nameOnDisk": "^link_imported_interface_exe(\\.exe)?$", - "artifacts": [ - { - "path": "^imported/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?link_imported_interface_exe(\\.exe)?$", - "_dllExtra": False, - }, - { - "path": "^imported/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?link_imported_interface_exe\\.pdb$", - "_dllExtra": True, - }, - ], - "build": "^imported$", - "source": "^imported$", - "install": None, - "link": { - "language": "C", - "lto": None, - "commandFragments": None, - }, - "archive": None, - "dependencies": [ - { - "id": "^ZERO_CHECK::@ba7eb709d0b48779c6c8$", - "backtrace": None, - }, - ], - }, - { - "name": "ALL_BUILD", - "id": "^ALL_BUILD::@c11385ffed57b860da63$", - "directorySource": "^custom$", - "projectName": "Custom", - "type": "UTILITY", - "isGeneratorProvided": True, - "sources": [ - { - "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/custom/CMakeFiles/ALL_BUILD$", - "isGenerated": True, - "sourceGroupName": "", - "compileGroupLanguage": None, - "backtrace": [ - { - "file": "^custom/CMakeLists\\.txt$", - "line": None, - "command": None, - "hasParent": False, - }, - ], - }, - { - "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/custom/CMakeFiles/ALL_BUILD\\.rule$", - "isGenerated": True, - "sourceGroupName": "CMake Rules", - "compileGroupLanguage": None, - "backtrace": [ - { - "file": "^custom/CMakeLists\\.txt$", - "line": None, - "command": None, - "hasParent": False, - }, - ], - }, - ], - "sourceGroups": [ - { - "name": "", - "sourcePaths": [ - "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/custom/CMakeFiles/ALL_BUILD$", - ], - }, - { - "name": "CMake Rules", - "sourcePaths": [ - "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/custom/CMakeFiles/ALL_BUILD\\.rule$", - ], - }, - ], - "compileGroups": None, - "backtrace": [ - { - "file": "^custom/CMakeLists\\.txt$", - "line": None, - "command": None, - "hasParent": False, - }, - ], - "folder": None, - "nameOnDisk": None, - "artifacts": None, - "build": "^custom$", - "source": "^custom$", - "install": None, - "link": None, - "archive": None, - "dependencies": [ - { - "id": "^ZERO_CHECK::@c11385ffed57b860da63$", - "backtrace": None, - }, - { - "id": "^custom_exe::@c11385ffed57b860da63$", - "backtrace": None, - }, - ], - }, - { - "name": "ZERO_CHECK", - "id": "^ZERO_CHECK::@c11385ffed57b860da63$", - "directorySource": "^custom$", - "projectName": "Custom", - "type": "UTILITY", - "isGeneratorProvided": True, - "sources": [ - { - "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/custom/CMakeFiles/ZERO_CHECK$", - "isGenerated": True, - "sourceGroupName": "", - "compileGroupLanguage": None, - "backtrace": [ - { - "file": "^custom/CMakeLists\\.txt$", - "line": None, - "command": None, - "hasParent": False, - }, - ], - }, - { - "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/custom/CMakeFiles/ZERO_CHECK\\.rule$", - "isGenerated": True, - "sourceGroupName": "CMake Rules", - "compileGroupLanguage": None, - "backtrace": [ - { - "file": "^custom/CMakeLists\\.txt$", - "line": None, - "command": None, - "hasParent": False, - }, - ], - }, - ], - "sourceGroups": [ - { - "name": "", - "sourcePaths": [ - "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/custom/CMakeFiles/ZERO_CHECK$", - ], - }, - { - "name": "CMake Rules", - "sourcePaths": [ - "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/custom/CMakeFiles/ZERO_CHECK\\.rule$", - ], - }, - ], - "compileGroups": None, - "backtrace": [ - { - "file": "^custom/CMakeLists\\.txt$", - "line": None, - "command": None, - "hasParent": False, - }, - ], - "folder": None, - "nameOnDisk": None, - "artifacts": None, - "build": "^custom$", - "source": "^custom$", - "install": None, - "link": None, - "archive": None, - "dependencies": None, - }, - { - "name": "custom_tgt", - "id": "^custom_tgt::@c11385ffed57b860da63$", - "directorySource": "^custom$", - "projectName": "Custom", - "type": "UTILITY", - "isGeneratorProvided": None, - "sources": [ - { - "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/custom/CMakeFiles/custom_tgt$", - "isGenerated": True, - "sourceGroupName": "", - "compileGroupLanguage": None, - "backtrace": [ - { - "file": "^custom/CMakeLists\\.txt$", - "line": 3, - "command": "add_custom_target", - "hasParent": True, - }, - { - "file": "^custom/CMakeLists\\.txt$", - "line": None, - "command": None, - "hasParent": False, - }, - ], - }, - { - "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/(custom/)?CMakeFiles/([0-9a-f]+/)?custom_tgt\\.rule$", - "isGenerated": True, - "sourceGroupName": "CMake Rules", - "compileGroupLanguage": None, - "backtrace": [ - { - "file": "^custom/CMakeLists\\.txt$", - "line": None, - "command": None, - "hasParent": False, - }, - ], - }, - ], - "sourceGroups": [ - { - "name": "", - "sourcePaths": [ - "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/custom/CMakeFiles/custom_tgt$", - ], - }, - { - "name": "CMake Rules", - "sourcePaths": [ - "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/(custom/)?CMakeFiles/([0-9a-f]+/)?custom_tgt\\.rule$", - ], - }, - ], - "compileGroups": None, - "backtrace": [ - { - "file": "^custom/CMakeLists\\.txt$", - "line": 3, - "command": "add_custom_target", - "hasParent": True, - }, - { - "file": "^custom/CMakeLists\\.txt$", - "line": None, - "command": None, - "hasParent": False, - }, - ], - "folder": None, - "nameOnDisk": None, - "artifacts": None, - "build": "^custom$", - "source": "^custom$", - "install": None, - "link": None, - "archive": None, - "dependencies": [ - { - "id": "^ZERO_CHECK::@c11385ffed57b860da63$", - "backtrace": None, - }, - ], - }, - { - "name": "custom_exe", - "id": "^custom_exe::@c11385ffed57b860da63$", - "directorySource": "^custom$", - "projectName": "Custom", - "type": "EXECUTABLE", - "isGeneratorProvided": None, - "sources": [ - { - "path": "^empty\\.c$", - "isGenerated": None, - "sourceGroupName": "Source Files", - "compileGroupLanguage": "C", - "backtrace": [ - { - "file": "^custom/CMakeLists\\.txt$", - "line": 4, - "command": "add_executable", - "hasParent": True, - }, - { - "file": "^custom/CMakeLists\\.txt$", - "line": None, - "command": None, - "hasParent": False, - }, - ], - }, - ], - "sourceGroups": [ - { - "name": "Source Files", - "sourcePaths": [ - "^empty\\.c$", - ], - }, - ], - "compileGroups": [ - { - "language": "C", - "sourcePaths": [ - "^empty\\.c$", - ], - "includes": None, - "defines": None, - "compileCommandFragments": None, - }, - ], - "backtrace": [ - { - "file": "^custom/CMakeLists\\.txt$", - "line": 4, - "command": "add_executable", - "hasParent": True, - }, - { - "file": "^custom/CMakeLists\\.txt$", - "line": None, - "command": None, - "hasParent": False, - }, - ], - "folder": None, - "nameOnDisk": "^custom_exe(\\.exe)?$", - "artifacts": [ - { - "path": "^custom/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?custom_exe(\\.exe)?$", - "_dllExtra": False, - }, - { - "path": "^custom/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?custom_exe\\.pdb$", - "_dllExtra": True, - }, - ], - "build": "^custom$", - "source": "^custom$", - "install": None, - "link": { - "language": "C", - "lto": None, - "commandFragments": None, - }, - "archive": None, - "dependencies": [ - { - "id": "^custom_tgt::@c11385ffed57b860da63$", - "backtrace": [ - { - "file": "^custom/CMakeLists\\.txt$", - "line": 5, - "command": "add_dependencies", - "hasParent": True, - }, - { - "file": "^custom/CMakeLists\\.txt$", - "line": None, - "command": None, - "hasParent": False, - }, - ], - }, - { - "id": "^ZERO_CHECK::@c11385ffed57b860da63$", - "backtrace": None, - }, - ], - }, - { - "name": "ALL_BUILD", - "id": "^ALL_BUILD::@[0-9a-f]+$", - "directorySource": "^.*/Tests/RunCMake/FileAPIExternalSource$", - "projectName": "External", - "type": "UTILITY", - "isGeneratorProvided": True, - "sources": [ - { - "path": "^.*/Tests/RunCMake/FileAPI/FileAPIExternalBuild/CMakeFiles/ALL_BUILD$", - "isGenerated": True, - "sourceGroupName": "", - "compileGroupLanguage": None, - "backtrace": [ - { - "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$", - "line": None, - "command": None, - "hasParent": False, - }, - ], - }, - { - "path": "^.*/Tests/RunCMake/FileAPI/FileAPIExternalBuild/CMakeFiles/ALL_BUILD\\.rule$", - "isGenerated": True, - "sourceGroupName": "CMake Rules", - "compileGroupLanguage": None, - "backtrace": [ - { - "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$", - "line": None, - "command": None, - "hasParent": False, - }, - ], - }, - ], - "sourceGroups": [ - { - "name": "", - "sourcePaths": [ - "^.*/Tests/RunCMake/FileAPI/FileAPIExternalBuild/CMakeFiles/ALL_BUILD$", - ], - }, - { - "name": "CMake Rules", - "sourcePaths": [ - "^.*/Tests/RunCMake/FileAPI/FileAPIExternalBuild/CMakeFiles/ALL_BUILD\\.rule$", - ], - }, - ], - "compileGroups": None, - "backtrace": [ - { - "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$", - "line": None, - "command": None, - "hasParent": False, - }, - ], - "folder": None, - "nameOnDisk": None, - "artifacts": None, - "build": "^.*/Tests/RunCMake/FileAPI/FileAPIExternalBuild$", - "source": "^.*/Tests/RunCMake/FileAPIExternalSource$", - "install": None, - "link": None, - "archive": None, - "dependencies": [ - { - "id": "^ZERO_CHECK::@[0-9a-f]+$", - "backtrace": None, - }, - { - "id": "^generated_exe::@[0-9a-f]+$", - "backtrace": None, - }, - ], - }, - { - "name": "ZERO_CHECK", - "id": "^ZERO_CHECK::@[0-9a-f]+$", - "directorySource": "^.*/Tests/RunCMake/FileAPIExternalSource$", - "projectName": "External", - "type": "UTILITY", - "isGeneratorProvided": True, - "sources": [ - { - "path": "^.*/Tests/RunCMake/FileAPI/FileAPIExternalBuild/CMakeFiles/ZERO_CHECK$", - "isGenerated": True, - "sourceGroupName": "", - "compileGroupLanguage": None, - "backtrace": [ - { - "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$", - "line": None, - "command": None, - "hasParent": False, - }, - ], - }, - { - "path": "^.*/Tests/RunCMake/FileAPI/FileAPIExternalBuild/CMakeFiles/ZERO_CHECK\\.rule$", - "isGenerated": True, - "sourceGroupName": "CMake Rules", - "compileGroupLanguage": None, - "backtrace": [ - { - "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$", - "line": None, - "command": None, - "hasParent": False, - }, - ], - }, - ], - "sourceGroups": [ - { - "name": "", - "sourcePaths": [ - "^.*/Tests/RunCMake/FileAPI/FileAPIExternalBuild/CMakeFiles/ZERO_CHECK$", - ], - }, - { - "name": "CMake Rules", - "sourcePaths": [ - "^.*/Tests/RunCMake/FileAPI/FileAPIExternalBuild/CMakeFiles/ZERO_CHECK\\.rule$", - ], - }, - ], - "compileGroups": None, - "backtrace": [ - { - "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$", - "line": None, - "command": None, - "hasParent": False, - }, - ], - "folder": None, - "nameOnDisk": None, - "artifacts": None, - "build": "^.*/Tests/RunCMake/FileAPI/FileAPIExternalBuild$", - "source": "^.*/Tests/RunCMake/FileAPIExternalSource$", - "install": None, - "link": None, - "archive": None, - "dependencies": None, - }, - { - "name": "generated_exe", - "id": "^generated_exe::@[0-9a-f]+$", - "directorySource": "^.*/Tests/RunCMake/FileAPIExternalSource$", - "projectName": "External", - "type": "EXECUTABLE", - "isGeneratorProvided": None, - "sources": [ - { - "path": "^.*/Tests/RunCMake/FileAPIExternalSource/empty\\.c$", - "isGenerated": None, - "sourceGroupName": "Source Files", - "compileGroupLanguage": "C", - "backtrace": [ - { - "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$", - "line": 5, - "command": "add_executable", - "hasParent": True, - }, - { - "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$", - "line": None, - "command": None, - "hasParent": False, - }, - ], - }, - { - "path": "^.*/Tests/RunCMake/FileAPI/FileAPIExternalBuild/generated\\.cxx$", - "isGenerated": True, - "sourceGroupName": "Generated Source Files", - "compileGroupLanguage": "CXX", - "backtrace": [ - { - "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$", - "line": 6, - "command": "target_sources", - "hasParent": True, - }, - { - "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$", - "line": None, - "command": None, - "hasParent": False, - }, - ], - }, - ], - "sourceGroups": [ - { - "name": "Source Files", - "sourcePaths": [ - "^.*/Tests/RunCMake/FileAPIExternalSource/empty\\.c$", - ], - }, - { - "name": "Generated Source Files", - "sourcePaths": [ - "^.*/Tests/RunCMake/FileAPI/FileAPIExternalBuild/generated\\.cxx$", - ], - }, - ], - "compileGroups": [ - { - "language": "C", - "sourcePaths": [ - "^.*/Tests/RunCMake/FileAPIExternalSource/empty\\.c$", - ], - "includes": [ - { - "path": "^.*/Tests/RunCMake/FileAPI/FileAPIExternalBuild$", - "isSystem": None, - "backtrace": [ - { - "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$", - "line": 10, - "command": "set_property", - "hasParent": True, - }, - { - "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$", - "line": None, - "command": None, - "hasParent": False, - }, - ], - }, - { - "path": "^.*/Tests/RunCMake/FileAPIExternalSource$", - "isSystem": True, - "backtrace": [ - { - "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$", - "line": 11, - "command": "target_include_directories", - "hasParent": True, - }, - { - "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$", - "line": None, - "command": None, - "hasParent": False, - }, - ], - }, - ], - "defines": [ - { - "define": "EMPTY_C=1", - "backtrace": [ - { - "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$", - "line": 9, - "command": "set_property", - "hasParent": True, - }, - { - "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$", - "line": None, - "command": None, - "hasParent": False, - }, - ], - }, - { - "define": "SRC_DUMMY", - "backtrace": [ - { - "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$", - "line": 9, - "command": "set_property", - "hasParent": True, - }, - { - "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$", - "line": None, - "command": None, - "hasParent": False, - }, - ], - }, - { - "define": "GENERATED_EXE=1", - "backtrace": [ - { - "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$", - "line": 12, - "command": "target_compile_definitions", - "hasParent": True, - }, - { - "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$", - "line": None, - "command": None, - "hasParent": False, - }, - ], - }, - { - "define": "TGT_DUMMY", - "backtrace": [ - { - "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$", - "line": 12, - "command": "target_compile_definitions", - "hasParent": True, - }, - { - "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$", - "line": None, - "command": None, - "hasParent": False, - }, - ], - }, - ], - "compileCommandFragments": [ - { - "fragment" : "SRC_COMPILE_OPTIONS_DUMMY", - "backtrace": [ - { - "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$", - "line": 13, - "command": "set_source_files_properties", - "hasParent": True, - }, - { - "file" : "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$", - "line": None, - "command": None, - "hasParent": False, - }, - ], - } - ], - }, - { - "language": "CXX", - "sourcePaths": [ - "^.*/Tests/RunCMake/FileAPI/FileAPIExternalBuild/generated\\.cxx$", - ], - "includes": [ - { - "path": "^.*/Tests/RunCMake/FileAPIExternalSource$", - "isSystem": True, - "backtrace": [ - { - "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$", - "line": 11, - "command": "target_include_directories", - "hasParent": True, - }, - { - "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$", - "line": None, - "command": None, - "hasParent": False, - }, - ], - }, - ], - "defines": [ - { - "define": "GENERATED_EXE=1", - "backtrace": [ - { - "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$", - "line": 12, - "command": "target_compile_definitions", - "hasParent": True, - }, - { - "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$", - "line": None, - "command": None, - "hasParent": False, - }, - ], - }, - { - "define": "TGT_DUMMY", - "backtrace": [ - { - "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$", - "line": 12, - "command": "target_compile_definitions", - "hasParent": True, - }, - { - "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$", - "line": None, - "command": None, - "hasParent": False, - }, - ], - }, - ], - "compileCommandFragments": None, - }, - ], - "backtrace": [ - { - "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$", - "line": 5, - "command": "add_executable", - "hasParent": True, - }, - { - "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$", - "line": None, - "command": None, - "hasParent": False, - }, - ], - "folder": None, - "nameOnDisk": "^generated_exe(\\.exe)?$", - "artifacts": [ - { - "path": "^.*/Tests/RunCMake/FileAPI/FileAPIExternalBuild/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?generated_exe(\\.exe)?$", - "_dllExtra": False, - }, - { - "path": "^.*/Tests/RunCMake/FileAPI/FileAPIExternalBuild/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?generated_exe\\.pdb$", - "_dllExtra": True, - }, - ], - "build": "^.*/Tests/RunCMake/FileAPI/FileAPIExternalBuild$", - "source": "^.*/Tests/RunCMake/FileAPIExternalSource$", - "install": None, - "link": { - "language": "CXX", - "lto": None, - "commandFragments": None, - }, - "archive": None, - "dependencies": [ - { - "id": "^ZERO_CHECK::@[0-9a-f]+$", - "backtrace": None, - }, - ], - }, + read_codemodel_json_data("targets/all_build_top.json"), + read_codemodel_json_data("targets/zero_check_top.json"), + read_codemodel_json_data("targets/interface_exe.json"), + read_codemodel_json_data("targets/c_lib.json"), + read_codemodel_json_data("targets/c_exe.json"), + read_codemodel_json_data("targets/c_shared_lib.json"), + read_codemodel_json_data("targets/c_shared_exe.json"), + read_codemodel_json_data("targets/c_static_lib.json"), + read_codemodel_json_data("targets/c_static_exe.json"), + + read_codemodel_json_data("targets/all_build_cxx.json"), + read_codemodel_json_data("targets/zero_check_cxx.json"), + read_codemodel_json_data("targets/cxx_lib.json"), + read_codemodel_json_data("targets/cxx_exe.json"), + read_codemodel_json_data("targets/cxx_shared_lib.json"), + read_codemodel_json_data("targets/cxx_shared_exe.json"), + read_codemodel_json_data("targets/cxx_static_lib.json"), + read_codemodel_json_data("targets/cxx_static_exe.json"), + + read_codemodel_json_data("targets/all_build_alias.json"), + read_codemodel_json_data("targets/zero_check_alias.json"), + read_codemodel_json_data("targets/c_alias_exe.json"), + read_codemodel_json_data("targets/cxx_alias_exe.json"), + + read_codemodel_json_data("targets/all_build_object.json"), + read_codemodel_json_data("targets/zero_check_object.json"), + read_codemodel_json_data("targets/c_object_lib.json"), + read_codemodel_json_data("targets/c_object_exe.json"), + read_codemodel_json_data("targets/cxx_object_lib.json"), + read_codemodel_json_data("targets/cxx_object_exe.json"), + + read_codemodel_json_data("targets/all_build_imported.json"), + read_codemodel_json_data("targets/zero_check_imported.json"), + read_codemodel_json_data("targets/link_imported_exe.json"), + read_codemodel_json_data("targets/link_imported_shared_exe.json"), + read_codemodel_json_data("targets/link_imported_static_exe.json"), + read_codemodel_json_data("targets/link_imported_object_exe.json"), + read_codemodel_json_data("targets/link_imported_interface_exe.json"), + + read_codemodel_json_data("targets/all_build_custom.json"), + read_codemodel_json_data("targets/zero_check_custom.json"), + read_codemodel_json_data("targets/custom_tgt.json"), + read_codemodel_json_data("targets/custom_exe.json"), + read_codemodel_json_data("targets/all_build_external.json"), + read_codemodel_json_data("targets/zero_check_external.json"), + read_codemodel_json_data("targets/generated_exe.json"), ] if not os.path.exists(os.path.join(reply_dir, "..", "..", "..", "..", "ipo_enabled.txt")): @@ -5164,126 +655,13 @@ def check_targets(c, g, inSource): def gen_check_projects(c, g): expected = [ - { - "name": "codemodel-v2", - "parentName": None, - "childNames": [ - "Alias", - "Custom", - "Cxx", - "Imported", - "Object", - "External", - ], - "directorySources": [ - "^\\.$", - "^dir$", - "^dir/dir$", - ], - "targetIds": [ - "^ALL_BUILD::@6890427a1f51a3e7e1df$", - "^ZERO_CHECK::@6890427a1f51a3e7e1df$", - "^interface_exe::@6890427a1f51a3e7e1df$", - "^c_lib::@6890427a1f51a3e7e1df$", - "^c_exe::@6890427a1f51a3e7e1df$", - "^c_shared_lib::@6890427a1f51a3e7e1df$", - "^c_shared_exe::@6890427a1f51a3e7e1df$", - "^c_static_lib::@6890427a1f51a3e7e1df$", - "^c_static_exe::@6890427a1f51a3e7e1df$", - ], - }, - { - "name": "Cxx", - "parentName": "codemodel-v2", - "childNames": None, - "directorySources": [ - "^cxx$", - ], - "targetIds": [ - "^ALL_BUILD::@a56b12a3f5c0529fb296$", - "^ZERO_CHECK::@a56b12a3f5c0529fb296$", - "^cxx_lib::@a56b12a3f5c0529fb296$", - "^cxx_exe::@a56b12a3f5c0529fb296$", - "^cxx_shared_lib::@a56b12a3f5c0529fb296$", - "^cxx_shared_exe::@a56b12a3f5c0529fb296$", - "^cxx_static_lib::@a56b12a3f5c0529fb296$", - "^cxx_static_exe::@a56b12a3f5c0529fb296$", - ], - }, - { - "name": "Alias", - "parentName": "codemodel-v2", - "childNames": None, - "directorySources": [ - "^alias$", - ], - "targetIds": [ - "^ALL_BUILD::@53632cba2752272bb008$", - "^ZERO_CHECK::@53632cba2752272bb008$", - "^c_alias_exe::@53632cba2752272bb008$", - "^cxx_alias_exe::@53632cba2752272bb008$", - ], - }, - { - "name": "Object", - "parentName": "codemodel-v2", - "childNames": None, - "directorySources": [ - "^object$", - ], - "targetIds": [ - "^ALL_BUILD::@5ed5358f70faf8d8af7a$", - "^ZERO_CHECK::@5ed5358f70faf8d8af7a$", - "^c_object_lib::@5ed5358f70faf8d8af7a$", - "^c_object_exe::@5ed5358f70faf8d8af7a$", - "^cxx_object_lib::@5ed5358f70faf8d8af7a$", - "^cxx_object_exe::@5ed5358f70faf8d8af7a$", - ], - }, - { - "name": "Imported", - "parentName": "codemodel-v2", - "childNames": None, - "directorySources": [ - "^imported$", - ], - "targetIds": [ - "^ALL_BUILD::@ba7eb709d0b48779c6c8$", - "^ZERO_CHECK::@ba7eb709d0b48779c6c8$", - "^link_imported_exe::@ba7eb709d0b48779c6c8$", - "^link_imported_shared_exe::@ba7eb709d0b48779c6c8$", - "^link_imported_static_exe::@ba7eb709d0b48779c6c8$", - "^link_imported_object_exe::@ba7eb709d0b48779c6c8$", - "^link_imported_interface_exe::@ba7eb709d0b48779c6c8$", - ], - }, - { - "name": "Custom", - "parentName": "codemodel-v2", - "childNames": None, - "directorySources": [ - "^custom$", - ], - "targetIds": [ - "^ALL_BUILD::@c11385ffed57b860da63$", - "^ZERO_CHECK::@c11385ffed57b860da63$", - "^custom_tgt::@c11385ffed57b860da63$", - "^custom_exe::@c11385ffed57b860da63$", - ], - }, - { - "name": "External", - "parentName": "codemodel-v2", - "childNames": None, - "directorySources": [ - "^.*/Tests/RunCMake/FileAPIExternalSource$", - ], - "targetIds": [ - "^ALL_BUILD::@[0-9a-f]+$", - "^ZERO_CHECK::@[0-9a-f]+$", - "^generated_exe::@[0-9a-f]+$", - ], - }, + read_codemodel_json_data("projects/codemodel-v2.json"), + read_codemodel_json_data("projects/cxx.json"), + read_codemodel_json_data("projects/alias.json"), + read_codemodel_json_data("projects/object.json"), + read_codemodel_json_data("projects/imported.json"), + read_codemodel_json_data("projects/custom.json"), + read_codemodel_json_data("projects/external.json"), ] if matches(g["name"], "^Visual Studio "): diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/alias.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/alias.json new file mode 100644 index 0000000..9f0c48a --- /dev/null +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/alias.json @@ -0,0 +1,15 @@ +{ + "source": "^alias$", + "build": "^alias$", + "parentSource": "^\\.$", + "childSources": null, + "targetIds": [ + "^ALL_BUILD::@53632cba2752272bb008$", + "^ZERO_CHECK::@53632cba2752272bb008$", + "^c_alias_exe::@53632cba2752272bb008$", + "^cxx_alias_exe::@53632cba2752272bb008$" + ], + "projectName": "Alias", + "minimumCMakeVersion": "3.12", + "hasInstallRule": null +} diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/custom.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/custom.json new file mode 100644 index 0000000..afd41f3 --- /dev/null +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/custom.json @@ -0,0 +1,15 @@ +{ + "source": "^custom$", + "build": "^custom$", + "parentSource": "^\\.$", + "childSources": null, + "targetIds": [ + "^ALL_BUILD::@c11385ffed57b860da63$", + "^ZERO_CHECK::@c11385ffed57b860da63$", + "^custom_exe::@c11385ffed57b860da63$", + "^custom_tgt::@c11385ffed57b860da63$" + ], + "projectName": "Custom", + "minimumCMakeVersion": "3.12", + "hasInstallRule": null +} diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/cxx.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/cxx.json new file mode 100644 index 0000000..ebe717a --- /dev/null +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/cxx.json @@ -0,0 +1,19 @@ +{ + "source": "^cxx$", + "build": "^cxx$", + "parentSource": "^\\.$", + "childSources": null, + "targetIds": [ + "^ALL_BUILD::@a56b12a3f5c0529fb296$", + "^ZERO_CHECK::@a56b12a3f5c0529fb296$", + "^cxx_exe::@a56b12a3f5c0529fb296$", + "^cxx_lib::@a56b12a3f5c0529fb296$", + "^cxx_shared_exe::@a56b12a3f5c0529fb296$", + "^cxx_shared_lib::@a56b12a3f5c0529fb296$", + "^cxx_static_exe::@a56b12a3f5c0529fb296$", + "^cxx_static_lib::@a56b12a3f5c0529fb296$" + ], + "projectName": "Cxx", + "minimumCMakeVersion": "3.12", + "hasInstallRule": null +} diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/dir.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/dir.json new file mode 100644 index 0000000..afbd43a --- /dev/null +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/dir.json @@ -0,0 +1,12 @@ +{ + "source": "^dir$", + "build": "^dir$", + "parentSource": "^\\.$", + "childSources": [ + "^dir/dir$" + ], + "targetIds": null, + "projectName": "codemodel-v2", + "minimumCMakeVersion": "3.12", + "hasInstallRule": null +} diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/dir_dir.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/dir_dir.json new file mode 100644 index 0000000..3737ad5 --- /dev/null +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/dir_dir.json @@ -0,0 +1,10 @@ +{ + "source": "^dir/dir$", + "build": "^dir/dir$", + "parentSource": "^dir$", + "childSources": null, + "targetIds": null, + "projectName": "codemodel-v2", + "minimumCMakeVersion": "3.12", + "hasInstallRule": null +} diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/external.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/external.json new file mode 100644 index 0000000..521e3c7 --- /dev/null +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/external.json @@ -0,0 +1,14 @@ +{ + "source": "^.*/Tests/RunCMake/FileAPIExternalSource$", + "build": "^.*/Tests/RunCMake/FileAPI/FileAPIExternalBuild$", + "parentSource": "^\\.$", + "childSources": null, + "targetIds": [ + "^ALL_BUILD::@[0-9a-f]+$", + "^ZERO_CHECK::@[0-9a-f]+$", + "^generated_exe::@[0-9a-f]+$" + ], + "projectName": "External", + "minimumCMakeVersion": "3.12", + "hasInstallRule": null +} diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/imported.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/imported.json new file mode 100644 index 0000000..a41b79b --- /dev/null +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/imported.json @@ -0,0 +1,18 @@ +{ + "source": "^imported$", + "build": "^imported$", + "parentSource": "^\\.$", + "childSources": null, + "targetIds": [ + "^ALL_BUILD::@ba7eb709d0b48779c6c8$", + "^ZERO_CHECK::@ba7eb709d0b48779c6c8$", + "^link_imported_exe::@ba7eb709d0b48779c6c8$", + "^link_imported_interface_exe::@ba7eb709d0b48779c6c8$", + "^link_imported_object_exe::@ba7eb709d0b48779c6c8$", + "^link_imported_shared_exe::@ba7eb709d0b48779c6c8$", + "^link_imported_static_exe::@ba7eb709d0b48779c6c8$" + ], + "projectName": "Imported", + "minimumCMakeVersion": "3.12", + "hasInstallRule": null +} diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/object.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/object.json new file mode 100644 index 0000000..1e647ad --- /dev/null +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/object.json @@ -0,0 +1,17 @@ +{ + "source": "^object$", + "build": "^object$", + "parentSource": "^\\.$", + "childSources": null, + "targetIds": [ + "^ALL_BUILD::@5ed5358f70faf8d8af7a$", + "^ZERO_CHECK::@5ed5358f70faf8d8af7a$", + "^c_object_exe::@5ed5358f70faf8d8af7a$", + "^c_object_lib::@5ed5358f70faf8d8af7a$", + "^cxx_object_exe::@5ed5358f70faf8d8af7a$", + "^cxx_object_lib::@5ed5358f70faf8d8af7a$" + ], + "projectName": "Object", + "minimumCMakeVersion": "3.13", + "hasInstallRule": true +} diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/top.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/top.json new file mode 100644 index 0000000..c144953 --- /dev/null +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/top.json @@ -0,0 +1,28 @@ +{ + "source": "^\\.$", + "build": "^\\.$", + "parentSource": null, + "childSources": [ + "^alias$", + "^custom$", + "^cxx$", + "^imported$", + "^object$", + "^.*/Tests/RunCMake/FileAPIExternalSource$", + "^dir$" + ], + "targetIds": [ + "^ALL_BUILD::@6890427a1f51a3e7e1df$", + "^ZERO_CHECK::@6890427a1f51a3e7e1df$", + "^c_exe::@6890427a1f51a3e7e1df$", + "^c_lib::@6890427a1f51a3e7e1df$", + "^c_shared_exe::@6890427a1f51a3e7e1df$", + "^c_shared_lib::@6890427a1f51a3e7e1df$", + "^c_static_exe::@6890427a1f51a3e7e1df$", + "^c_static_lib::@6890427a1f51a3e7e1df$", + "^interface_exe::@6890427a1f51a3e7e1df$" + ], + "projectName": "codemodel-v2", + "minimumCMakeVersion": "3.12", + "hasInstallRule": true +} diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/projects/alias.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/projects/alias.json new file mode 100644 index 0000000..8ede60f --- /dev/null +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/projects/alias.json @@ -0,0 +1,14 @@ +{ + "name": "Alias", + "parentName": "codemodel-v2", + "childNames": null, + "directorySources": [ + "^alias$" + ], + "targetIds": [ + "^ALL_BUILD::@53632cba2752272bb008$", + "^ZERO_CHECK::@53632cba2752272bb008$", + "^c_alias_exe::@53632cba2752272bb008$", + "^cxx_alias_exe::@53632cba2752272bb008$" + ] +} diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/projects/codemodel-v2.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/projects/codemodel-v2.json new file mode 100644 index 0000000..f3aac63 --- /dev/null +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/projects/codemodel-v2.json @@ -0,0 +1,28 @@ +{ + "name": "codemodel-v2", + "parentName": null, + "childNames": [ + "Alias", + "Custom", + "Cxx", + "Imported", + "Object", + "External" + ], + "directorySources": [ + "^\\.$", + "^dir$", + "^dir/dir$" + ], + "targetIds": [ + "^ALL_BUILD::@6890427a1f51a3e7e1df$", + "^ZERO_CHECK::@6890427a1f51a3e7e1df$", + "^interface_exe::@6890427a1f51a3e7e1df$", + "^c_lib::@6890427a1f51a3e7e1df$", + "^c_exe::@6890427a1f51a3e7e1df$", + "^c_shared_lib::@6890427a1f51a3e7e1df$", + "^c_shared_exe::@6890427a1f51a3e7e1df$", + "^c_static_lib::@6890427a1f51a3e7e1df$", + "^c_static_exe::@6890427a1f51a3e7e1df$" + ] +} diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/projects/custom.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/projects/custom.json new file mode 100644 index 0000000..0aeb727 --- /dev/null +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/projects/custom.json @@ -0,0 +1,14 @@ +{ + "name": "Custom", + "parentName": "codemodel-v2", + "childNames": null, + "directorySources": [ + "^custom$" + ], + "targetIds": [ + "^ALL_BUILD::@c11385ffed57b860da63$", + "^ZERO_CHECK::@c11385ffed57b860da63$", + "^custom_tgt::@c11385ffed57b860da63$", + "^custom_exe::@c11385ffed57b860da63$" + ] +} diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/projects/cxx.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/projects/cxx.json new file mode 100644 index 0000000..296ae6c --- /dev/null +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/projects/cxx.json @@ -0,0 +1,18 @@ +{ + "name": "Cxx", + "parentName": "codemodel-v2", + "childNames": null, + "directorySources": [ + "^cxx$" + ], + "targetIds": [ + "^ALL_BUILD::@a56b12a3f5c0529fb296$", + "^ZERO_CHECK::@a56b12a3f5c0529fb296$", + "^cxx_lib::@a56b12a3f5c0529fb296$", + "^cxx_exe::@a56b12a3f5c0529fb296$", + "^cxx_shared_lib::@a56b12a3f5c0529fb296$", + "^cxx_shared_exe::@a56b12a3f5c0529fb296$", + "^cxx_static_lib::@a56b12a3f5c0529fb296$", + "^cxx_static_exe::@a56b12a3f5c0529fb296$" + ] +} diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/projects/external.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/projects/external.json new file mode 100644 index 0000000..3c9afff --- /dev/null +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/projects/external.json @@ -0,0 +1,13 @@ +{ + "name": "External", + "parentName": "codemodel-v2", + "childNames": null, + "directorySources": [ + "^.*/Tests/RunCMake/FileAPIExternalSource$" + ], + "targetIds": [ + "^ALL_BUILD::@[0-9a-f]+$", + "^ZERO_CHECK::@[0-9a-f]+$", + "^generated_exe::@[0-9a-f]+$" + ] +} diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/projects/imported.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/projects/imported.json new file mode 100644 index 0000000..dc40b72 --- /dev/null +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/projects/imported.json @@ -0,0 +1,17 @@ +{ + "name": "Imported", + "parentName": "codemodel-v2", + "childNames": null, + "directorySources": [ + "^imported$" + ], + "targetIds": [ + "^ALL_BUILD::@ba7eb709d0b48779c6c8$", + "^ZERO_CHECK::@ba7eb709d0b48779c6c8$", + "^link_imported_exe::@ba7eb709d0b48779c6c8$", + "^link_imported_shared_exe::@ba7eb709d0b48779c6c8$", + "^link_imported_static_exe::@ba7eb709d0b48779c6c8$", + "^link_imported_object_exe::@ba7eb709d0b48779c6c8$", + "^link_imported_interface_exe::@ba7eb709d0b48779c6c8$" + ] +} diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/projects/object.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/projects/object.json new file mode 100644 index 0000000..219f4eb --- /dev/null +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/projects/object.json @@ -0,0 +1,16 @@ +{ + "name": "Object", + "parentName": "codemodel-v2", + "childNames": null, + "directorySources": [ + "^object$" + ], + "targetIds": [ + "^ALL_BUILD::@5ed5358f70faf8d8af7a$", + "^ZERO_CHECK::@5ed5358f70faf8d8af7a$", + "^c_object_lib::@5ed5358f70faf8d8af7a$", + "^c_object_exe::@5ed5358f70faf8d8af7a$", + "^cxx_object_lib::@5ed5358f70faf8d8af7a$", + "^cxx_object_exe::@5ed5358f70faf8d8af7a$" + ] +} diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_alias.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_alias.json new file mode 100644 index 0000000..eabf739 --- /dev/null +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_alias.json @@ -0,0 +1,83 @@ +{ + "name": "ALL_BUILD", + "id": "^ALL_BUILD::@53632cba2752272bb008$", + "directorySource": "^alias$", + "projectName": "Alias", + "type": "UTILITY", + "isGeneratorProvided": true, + "sources": [ + { + "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/alias/CMakeFiles/ALL_BUILD$", + "isGenerated": true, + "sourceGroupName": "", + "compileGroupLanguage": null, + "backtrace": [ + { + "file": "^alias/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ] + }, + { + "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/alias/CMakeFiles/ALL_BUILD\\.rule$", + "isGenerated": true, + "sourceGroupName": "CMake Rules", + "compileGroupLanguage": null, + "backtrace": [ + { + "file": "^alias/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ] + } + ], + "sourceGroups": [ + { + "name": "", + "sourcePaths": [ + "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/alias/CMakeFiles/ALL_BUILD$" + ] + }, + { + "name": "CMake Rules", + "sourcePaths": [ + "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/alias/CMakeFiles/ALL_BUILD\\.rule$" + ] + } + ], + "compileGroups": null, + "backtrace": [ + { + "file": "^alias/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ], + "folder": null, + "nameOnDisk": null, + "artifacts": null, + "build": "^alias$", + "source": "^alias$", + "install": null, + "link": null, + "archive": null, + "dependencies": [ + { + "id": "^ZERO_CHECK::@53632cba2752272bb008$", + "backtrace": null + }, + { + "id": "^c_alias_exe::@53632cba2752272bb008$", + "backtrace": null + }, + { + "id": "^cxx_alias_exe::@53632cba2752272bb008$", + "backtrace": null + } + ] +} diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_custom.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_custom.json new file mode 100644 index 0000000..a5ff686 --- /dev/null +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_custom.json @@ -0,0 +1,79 @@ +{ + "name": "ALL_BUILD", + "id": "^ALL_BUILD::@c11385ffed57b860da63$", + "directorySource": "^custom$", + "projectName": "Custom", + "type": "UTILITY", + "isGeneratorProvided": true, + "sources": [ + { + "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/custom/CMakeFiles/ALL_BUILD$", + "isGenerated": true, + "sourceGroupName": "", + "compileGroupLanguage": null, + "backtrace": [ + { + "file": "^custom/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ] + }, + { + "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/custom/CMakeFiles/ALL_BUILD\\.rule$", + "isGenerated": true, + "sourceGroupName": "CMake Rules", + "compileGroupLanguage": null, + "backtrace": [ + { + "file": "^custom/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ] + } + ], + "sourceGroups": [ + { + "name": "", + "sourcePaths": [ + "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/custom/CMakeFiles/ALL_BUILD$" + ] + }, + { + "name": "CMake Rules", + "sourcePaths": [ + "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/custom/CMakeFiles/ALL_BUILD\\.rule$" + ] + } + ], + "compileGroups": null, + "backtrace": [ + { + "file": "^custom/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ], + "folder": null, + "nameOnDisk": null, + "artifacts": null, + "build": "^custom$", + "source": "^custom$", + "install": null, + "link": null, + "archive": null, + "dependencies": [ + { + "id": "^ZERO_CHECK::@c11385ffed57b860da63$", + "backtrace": null + }, + { + "id": "^custom_exe::@c11385ffed57b860da63$", + "backtrace": null + } + ] +} diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_cxx.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_cxx.json new file mode 100644 index 0000000..92a7944 --- /dev/null +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_cxx.json @@ -0,0 +1,99 @@ +{ + "name": "ALL_BUILD", + "id": "^ALL_BUILD::@a56b12a3f5c0529fb296$", + "directorySource": "^cxx$", + "projectName": "Cxx", + "type": "UTILITY", + "isGeneratorProvided": true, + "sources": [ + { + "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/cxx/CMakeFiles/ALL_BUILD$", + "isGenerated": true, + "sourceGroupName": "", + "compileGroupLanguage": null, + "backtrace": [ + { + "file": "^cxx/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ] + }, + { + "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/cxx/CMakeFiles/ALL_BUILD\\.rule$", + "isGenerated": true, + "sourceGroupName": "CMake Rules", + "compileGroupLanguage": null, + "backtrace": [ + { + "file": "^cxx/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ] + } + ], + "sourceGroups": [ + { + "name": "", + "sourcePaths": [ + "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/cxx/CMakeFiles/ALL_BUILD$" + ] + }, + { + "name": "CMake Rules", + "sourcePaths": [ + "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/cxx/CMakeFiles/ALL_BUILD\\.rule$" + ] + } + ], + "compileGroups": null, + "backtrace": [ + { + "file": "^cxx/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ], + "folder": null, + "nameOnDisk": null, + "artifacts": null, + "build": "^cxx$", + "source": "^cxx$", + "install": null, + "link": null, + "archive": null, + "dependencies": [ + { + "id": "^ZERO_CHECK::@a56b12a3f5c0529fb296$", + "backtrace": null + }, + { + "id": "^cxx_lib::@a56b12a3f5c0529fb296$", + "backtrace": null + }, + { + "id": "^cxx_exe::@a56b12a3f5c0529fb296$", + "backtrace": null + }, + { + "id": "^cxx_shared_lib::@a56b12a3f5c0529fb296$", + "backtrace": null + }, + { + "id": "^cxx_shared_exe::@a56b12a3f5c0529fb296$", + "backtrace": null + }, + { + "id": "^cxx_static_lib::@a56b12a3f5c0529fb296$", + "backtrace": null + }, + { + "id": "^cxx_static_exe::@a56b12a3f5c0529fb296$", + "backtrace": null + } + ] +} diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_external.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_external.json new file mode 100644 index 0000000..017335c --- /dev/null +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_external.json @@ -0,0 +1,79 @@ +{ + "name": "ALL_BUILD", + "id": "^ALL_BUILD::@[0-9a-f]+$", + "directorySource": "^.*/Tests/RunCMake/FileAPIExternalSource$", + "projectName": "External", + "type": "UTILITY", + "isGeneratorProvided": true, + "sources": [ + { + "path": "^.*/Tests/RunCMake/FileAPI/FileAPIExternalBuild/CMakeFiles/ALL_BUILD$", + "isGenerated": true, + "sourceGroupName": "", + "compileGroupLanguage": null, + "backtrace": [ + { + "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ] + }, + { + "path": "^.*/Tests/RunCMake/FileAPI/FileAPIExternalBuild/CMakeFiles/ALL_BUILD\\.rule$", + "isGenerated": true, + "sourceGroupName": "CMake Rules", + "compileGroupLanguage": null, + "backtrace": [ + { + "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ] + } + ], + "sourceGroups": [ + { + "name": "", + "sourcePaths": [ + "^.*/Tests/RunCMake/FileAPI/FileAPIExternalBuild/CMakeFiles/ALL_BUILD$" + ] + }, + { + "name": "CMake Rules", + "sourcePaths": [ + "^.*/Tests/RunCMake/FileAPI/FileAPIExternalBuild/CMakeFiles/ALL_BUILD\\.rule$" + ] + } + ], + "compileGroups": null, + "backtrace": [ + { + "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ], + "folder": null, + "nameOnDisk": null, + "artifacts": null, + "build": "^.*/Tests/RunCMake/FileAPI/FileAPIExternalBuild$", + "source": "^.*/Tests/RunCMake/FileAPIExternalSource$", + "install": null, + "link": null, + "archive": null, + "dependencies": [ + { + "id": "^ZERO_CHECK::@[0-9a-f]+$", + "backtrace": null + }, + { + "id": "^generated_exe::@[0-9a-f]+$", + "backtrace": null + } + ] +} diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_imported.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_imported.json new file mode 100644 index 0000000..2de5b15 --- /dev/null +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_imported.json @@ -0,0 +1,95 @@ +{ + "name": "ALL_BUILD", + "id": "^ALL_BUILD::@ba7eb709d0b48779c6c8$", + "directorySource": "^imported$", + "projectName": "Imported", + "type": "UTILITY", + "isGeneratorProvided": true, + "sources": [ + { + "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/imported/CMakeFiles/ALL_BUILD$", + "isGenerated": true, + "sourceGroupName": "", + "compileGroupLanguage": null, + "backtrace": [ + { + "file": "^imported/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ] + }, + { + "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/imported/CMakeFiles/ALL_BUILD\\.rule$", + "isGenerated": true, + "sourceGroupName": "CMake Rules", + "compileGroupLanguage": null, + "backtrace": [ + { + "file": "^imported/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ] + } + ], + "sourceGroups": [ + { + "name": "", + "sourcePaths": [ + "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/imported/CMakeFiles/ALL_BUILD$" + ] + }, + { + "name": "CMake Rules", + "sourcePaths": [ + "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/imported/CMakeFiles/ALL_BUILD\\.rule$" + ] + } + ], + "compileGroups": null, + "backtrace": [ + { + "file": "^imported/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ], + "folder": null, + "nameOnDisk": null, + "artifacts": null, + "build": "^imported$", + "source": "^imported$", + "install": null, + "link": null, + "archive": null, + "dependencies": [ + { + "id": "^ZERO_CHECK::@ba7eb709d0b48779c6c8$", + "backtrace": null + }, + { + "id": "^link_imported_exe::@ba7eb709d0b48779c6c8$", + "backtrace": null + }, + { + "id": "^link_imported_shared_exe::@ba7eb709d0b48779c6c8$", + "backtrace": null + }, + { + "id": "^link_imported_static_exe::@ba7eb709d0b48779c6c8$", + "backtrace": null + }, + { + "id": "^link_imported_object_exe::@ba7eb709d0b48779c6c8$", + "backtrace": null + }, + { + "id": "^link_imported_interface_exe::@ba7eb709d0b48779c6c8$", + "backtrace": null + } + ] +} diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_object.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_object.json new file mode 100644 index 0000000..9d8899a --- /dev/null +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_object.json @@ -0,0 +1,91 @@ +{ + "name": "ALL_BUILD", + "id": "^ALL_BUILD::@5ed5358f70faf8d8af7a$", + "directorySource": "^object$", + "projectName": "Object", + "type": "UTILITY", + "isGeneratorProvided": true, + "sources": [ + { + "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/object/CMakeFiles/ALL_BUILD$", + "isGenerated": true, + "sourceGroupName": "", + "compileGroupLanguage": null, + "backtrace": [ + { + "file": "^object/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ] + }, + { + "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/object/CMakeFiles/ALL_BUILD\\.rule$", + "isGenerated": true, + "sourceGroupName": "CMake Rules", + "compileGroupLanguage": null, + "backtrace": [ + { + "file": "^object/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ] + } + ], + "sourceGroups": [ + { + "name": "", + "sourcePaths": [ + "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/object/CMakeFiles/ALL_BUILD$" + ] + }, + { + "name": "CMake Rules", + "sourcePaths": [ + "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/object/CMakeFiles/ALL_BUILD\\.rule$" + ] + } + ], + "compileGroups": null, + "backtrace": [ + { + "file": "^object/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ], + "folder": null, + "nameOnDisk": null, + "artifacts": null, + "build": "^object$", + "source": "^object$", + "install": null, + "link": null, + "archive": null, + "dependencies": [ + { + "id": "^ZERO_CHECK::@5ed5358f70faf8d8af7a$", + "backtrace": null + }, + { + "id": "^c_object_lib::@5ed5358f70faf8d8af7a$", + "backtrace": null + }, + { + "id": "^c_object_exe::@5ed5358f70faf8d8af7a$", + "backtrace": null + }, + { + "id": "^cxx_object_lib::@5ed5358f70faf8d8af7a$", + "backtrace": null + }, + { + "id": "^cxx_object_exe::@5ed5358f70faf8d8af7a$", + "backtrace": null + } + ] +} diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_top.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_top.json new file mode 100644 index 0000000..b4def78 --- /dev/null +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_top.json @@ -0,0 +1,179 @@ +{ + "name": "ALL_BUILD", + "id": "^ALL_BUILD::@6890427a1f51a3e7e1df$", + "directorySource": "^\\.$", + "projectName": "codemodel-v2", + "type": "UTILITY", + "isGeneratorProvided": true, + "sources": [ + { + "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/CMakeFiles/ALL_BUILD$", + "isGenerated": true, + "sourceGroupName": "", + "compileGroupLanguage": null, + "backtrace": [ + { + "file": "^CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ] + }, + { + "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/CMakeFiles/ALL_BUILD\\.rule$", + "isGenerated": true, + "sourceGroupName": "CMake Rules", + "compileGroupLanguage": null, + "backtrace": [ + { + "file": "^CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ] + } + ], + "sourceGroups": [ + { + "name": "", + "sourcePaths": [ + "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/CMakeFiles/ALL_BUILD$" + ] + }, + { + "name": "CMake Rules", + "sourcePaths": [ + "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/CMakeFiles/ALL_BUILD\\.rule$" + ] + } + ], + "compileGroups": null, + "backtrace": [ + { + "file": "^CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ], + "folder": null, + "nameOnDisk": null, + "artifacts": null, + "build": "^\\.$", + "source": "^\\.$", + "install": null, + "link": null, + "archive": null, + "dependencies": [ + { + "id": "^ZERO_CHECK::@6890427a1f51a3e7e1df$", + "backtrace": null + }, + { + "id": "^interface_exe::@6890427a1f51a3e7e1df$", + "backtrace": null + }, + { + "id": "^c_lib::@6890427a1f51a3e7e1df$", + "backtrace": null + }, + { + "id": "^c_exe::@6890427a1f51a3e7e1df$", + "backtrace": null + }, + { + "id": "^c_shared_lib::@6890427a1f51a3e7e1df$", + "backtrace": null + }, + { + "id": "^c_shared_exe::@6890427a1f51a3e7e1df$", + "backtrace": null + }, + { + "id": "^c_static_lib::@6890427a1f51a3e7e1df$", + "backtrace": null + }, + { + "id": "^c_static_exe::@6890427a1f51a3e7e1df$", + "backtrace": null + }, + { + "id": "^c_alias_exe::@53632cba2752272bb008$", + "backtrace": null + }, + { + "id": "^cxx_alias_exe::@53632cba2752272bb008$", + "backtrace": null + }, + { + "id": "^cxx_lib::@a56b12a3f5c0529fb296$", + "backtrace": null + }, + { + "id": "^cxx_exe::@a56b12a3f5c0529fb296$", + "backtrace": null + }, + { + "id": "^cxx_shared_lib::@a56b12a3f5c0529fb296$", + "backtrace": null + }, + { + "id": "^cxx_shared_exe::@a56b12a3f5c0529fb296$", + "backtrace": null + }, + { + "id": "^cxx_static_lib::@a56b12a3f5c0529fb296$", + "backtrace": null + }, + { + "id": "^cxx_static_exe::@a56b12a3f5c0529fb296$", + "backtrace": null + }, + { + "id": "^c_object_lib::@5ed5358f70faf8d8af7a$", + "backtrace": null + }, + { + "id": "^c_object_exe::@5ed5358f70faf8d8af7a$", + "backtrace": null + }, + { + "id": "^cxx_object_lib::@5ed5358f70faf8d8af7a$", + "backtrace": null + }, + { + "id": "^cxx_object_exe::@5ed5358f70faf8d8af7a$", + "backtrace": null + }, + { + "id": "^link_imported_exe::@ba7eb709d0b48779c6c8$", + "backtrace": null + }, + { + "id": "^link_imported_shared_exe::@ba7eb709d0b48779c6c8$", + "backtrace": null + }, + { + "id": "^link_imported_static_exe::@ba7eb709d0b48779c6c8$", + "backtrace": null + }, + { + "id": "^link_imported_object_exe::@ba7eb709d0b48779c6c8$", + "backtrace": null + }, + { + "id": "^link_imported_interface_exe::@ba7eb709d0b48779c6c8$", + "backtrace": null + }, + { + "id": "^custom_exe::@c11385ffed57b860da63$", + "backtrace": null + }, + { + "id": "^generated_exe::@[0-9a-f]+$", + "backtrace": null + } + ] +} diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_alias_exe.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_alias_exe.json new file mode 100644 index 0000000..ac7c94d --- /dev/null +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_alias_exe.json @@ -0,0 +1,107 @@ +{ + "name": "c_alias_exe", + "id": "^c_alias_exe::@53632cba2752272bb008$", + "directorySource": "^alias$", + "projectName": "Alias", + "type": "EXECUTABLE", + "isGeneratorProvided": null, + "sources": [ + { + "path": "^empty\\.c$", + "isGenerated": null, + "sourceGroupName": "Source Files", + "compileGroupLanguage": "C", + "backtrace": [ + { + "file": "^alias/CMakeLists\\.txt$", + "line": 5, + "command": "add_executable", + "hasParent": true + }, + { + "file": "^alias/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ] + } + ], + "sourceGroups": [ + { + "name": "Source Files", + "sourcePaths": [ + "^empty\\.c$" + ] + } + ], + "compileGroups": [ + { + "language": "C", + "sourcePaths": [ + "^empty\\.c$" + ], + "includes": null, + "defines": null, + "compileCommandFragments": null + } + ], + "backtrace": [ + { + "file": "^alias/CMakeLists\\.txt$", + "line": 5, + "command": "add_executable", + "hasParent": true + }, + { + "file": "^alias/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ], + "folder": null, + "nameOnDisk": "^c_alias_exe(\\.exe)?$", + "artifacts": [ + { + "path": "^alias/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?c_alias_exe(\\.exe)?$", + "_dllExtra": false + }, + { + "path": "^alias/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?c_alias_exe\\.pdb$", + "_dllExtra": true + } + ], + "build": "^alias$", + "source": "^alias$", + "install": null, + "link": { + "language": "C", + "lto": null, + "commandFragments": null + }, + "archive": null, + "dependencies": [ + { + "id": "^c_lib::@6890427a1f51a3e7e1df$", + "backtrace": [ + { + "file": "^alias/CMakeLists\\.txt$", + "line": 6, + "command": "target_link_libraries", + "hasParent": true + }, + { + "file": "^alias/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ] + }, + { + "id": "^ZERO_CHECK::@53632cba2752272bb008$", + "backtrace": null + } + ] +} diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_exe.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_exe.json new file mode 100644 index 0000000..7af74c4 --- /dev/null +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_exe.json @@ -0,0 +1,143 @@ +{ + "name": "c_exe", + "id": "^c_exe::@6890427a1f51a3e7e1df$", + "directorySource": "^\\.$", + "projectName": "codemodel-v2", + "type": "EXECUTABLE", + "isGeneratorProvided": null, + "sources": [ + { + "path": "^empty\\.c$", + "isGenerated": null, + "sourceGroupName": "Source Files", + "compileGroupLanguage": "C", + "backtrace": [ + { + "file": "^codemodel-v2\\.cmake$", + "line": 6, + "command": "add_executable", + "hasParent": true + }, + { + "file": "^codemodel-v2\\.cmake$", + "line": null, + "command": null, + "hasParent": true + }, + { + "file": "^CMakeLists\\.txt$", + "line": 3, + "command": "include", + "hasParent": true + }, + { + "file": "^CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ] + } + ], + "sourceGroups": [ + { + "name": "Source Files", + "sourcePaths": [ + "^empty\\.c$" + ] + } + ], + "compileGroups": [ + { + "language": "C", + "sourcePaths": [ + "^empty\\.c$" + ], + "includes": null, + "defines": null, + "compileCommandFragments": null + } + ], + "backtrace": [ + { + "file": "^codemodel-v2\\.cmake$", + "line": 6, + "command": "add_executable", + "hasParent": true + }, + { + "file": "^codemodel-v2\\.cmake$", + "line": null, + "command": null, + "hasParent": true + }, + { + "file": "^CMakeLists\\.txt$", + "line": 3, + "command": "include", + "hasParent": true + }, + { + "file": "^CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ], + "folder": null, + "nameOnDisk": "^c_exe(\\.exe)?$", + "artifacts": [ + { + "path": "^((Debug|Release|RelWithDebInfo|MinSizeRel)/)?c_exe(\\.exe)?$", + "_dllExtra": false + }, + { + "path": "^((Debug|Release|RelWithDebInfo|MinSizeRel)/)?c_exe\\.pdb$", + "_dllExtra": true + } + ], + "build": "^\\.$", + "source": "^\\.$", + "install": null, + "link": { + "language": "C", + "lto": null, + "commandFragments": null + }, + "archive": null, + "dependencies": [ + { + "id": "^c_lib::@6890427a1f51a3e7e1df$", + "backtrace": [ + { + "file": "^codemodel-v2\\.cmake$", + "line": 7, + "command": "target_link_libraries", + "hasParent": true + }, + { + "file": "^codemodel-v2\\.cmake$", + "line": null, + "command": null, + "hasParent": true + }, + { + "file": "^CMakeLists\\.txt$", + "line": 3, + "command": "include", + "hasParent": true + }, + { + "file": "^CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ] + }, + { + "id": "^ZERO_CHECK::@6890427a1f51a3e7e1df$", + "backtrace": null + } + ] +} diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_lib.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_lib.json new file mode 100644 index 0000000..0ca1962 --- /dev/null +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_lib.json @@ -0,0 +1,108 @@ +{ + "name": "c_lib", + "id": "^c_lib::@6890427a1f51a3e7e1df$", + "directorySource": "^\\.$", + "projectName": "codemodel-v2", + "type": "STATIC_LIBRARY", + "isGeneratorProvided": null, + "sources": [ + { + "path": "^empty\\.c$", + "isGenerated": null, + "sourceGroupName": "Source Files", + "compileGroupLanguage": "C", + "backtrace": [ + { + "file": "^codemodel-v2\\.cmake$", + "line": 5, + "command": "add_library", + "hasParent": true + }, + { + "file": "^codemodel-v2\\.cmake$", + "line": null, + "command": null, + "hasParent": true + }, + { + "file": "^CMakeLists\\.txt$", + "line": 3, + "command": "include", + "hasParent": true + }, + { + "file": "^CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ] + } + ], + "sourceGroups": [ + { + "name": "Source Files", + "sourcePaths": [ + "^empty\\.c$" + ] + } + ], + "compileGroups": [ + { + "language": "C", + "sourcePaths": [ + "^empty\\.c$" + ], + "includes": null, + "defines": null, + "compileCommandFragments": null + } + ], + "backtrace": [ + { + "file": "^codemodel-v2\\.cmake$", + "line": 5, + "command": "add_library", + "hasParent": true + }, + { + "file": "^codemodel-v2\\.cmake$", + "line": null, + "command": null, + "hasParent": true + }, + { + "file": "^CMakeLists\\.txt$", + "line": 3, + "command": "include", + "hasParent": true + }, + { + "file": "^CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ], + "folder": null, + "nameOnDisk": "^(lib)?c_lib\\.(a|lib)$", + "artifacts": [ + { + "path": "^((Debug|Release|RelWithDebInfo|MinSizeRel)/)?(lib)?c_lib\\.(a|lib)$", + "_dllExtra": false + } + ], + "build": "^\\.$", + "source": "^\\.$", + "install": null, + "link": null, + "archive": { + "lto": null + }, + "dependencies": [ + { + "id": "^ZERO_CHECK::@6890427a1f51a3e7e1df$", + "backtrace": null + } + ] +} diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_object_exe.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_object_exe.json new file mode 100644 index 0000000..3c9ace3 --- /dev/null +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_object_exe.json @@ -0,0 +1,154 @@ +{ + "name": "c_object_exe", + "id": "^c_object_exe::@5ed5358f70faf8d8af7a$", + "directorySource": "^object$", + "projectName": "Object", + "type": "EXECUTABLE", + "isGeneratorProvided": null, + "sources": [ + { + "path": "^empty\\.c$", + "isGenerated": null, + "sourceGroupName": "Source Files", + "compileGroupLanguage": "C", + "backtrace": [ + { + "file": "^object/CMakeLists\\.txt$", + "line": 6, + "command": "add_executable", + "hasParent": true + }, + { + "file": "^object/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ] + }, + { + "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/object/.*/empty(\\.c)?\\.o(bj)?$", + "isGenerated": true, + "sourceGroupName": "Object Libraries", + "compileGroupLanguage": null, + "backtrace": [ + { + "file": "^object/CMakeLists\\.txt$", + "line": 7, + "command": "target_link_libraries", + "hasParent": true + }, + { + "file": "^object/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ] + } + ], + "sourceGroups": [ + { + "name": "Source Files", + "sourcePaths": [ + "^empty\\.c$" + ] + }, + { + "name": "Object Libraries", + "sourcePaths": [ + "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/object/.*/empty(\\.c)?\\.o(bj)?$" + ] + } + ], + "compileGroups": [ + { + "language": "C", + "sourcePaths": [ + "^empty\\.c$" + ], + "includes": null, + "defines": null, + "compileCommandFragments": null + } + ], + "backtrace": [ + { + "file": "^object/CMakeLists\\.txt$", + "line": 6, + "command": "add_executable", + "hasParent": true + }, + { + "file": "^object/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ], + "folder": null, + "nameOnDisk": "^c_object_exe(\\.exe)?$", + "artifacts": [ + { + "path": "^object/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?c_object_exe(\\.exe)?$", + "_dllExtra": false + }, + { + "path": "^object/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?c_object_exe\\.pdb$", + "_dllExtra": true + } + ], + "build": "^object$", + "source": "^object$", + "install": { + "prefix": "^(/usr/local|[A-Za-z]:.*/codemodel-v2)$", + "destinations": [ + { + "path": "bin", + "backtrace": [ + { + "file": "^object/CMakeLists\\.txt$", + "line": 13, + "command": "install", + "hasParent": true + }, + { + "file": "^object/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ] + } + ] + }, + "link": { + "language": "C", + "lto": null, + "commandFragments": null + }, + "archive": null, + "dependencies": [ + { + "id": "^c_object_lib::@5ed5358f70faf8d8af7a$", + "backtrace": [ + { + "file": "^object/CMakeLists\\.txt$", + "line": 7, + "command": "target_link_libraries", + "hasParent": true + }, + { + "file": "^object/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ] + }, + { + "id": "^ZERO_CHECK::@5ed5358f70faf8d8af7a$", + "backtrace": null + } + ] +} diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_object_lib.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_object_lib.json new file mode 100644 index 0000000..e3a20df --- /dev/null +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_object_lib.json @@ -0,0 +1,82 @@ +{ + "name": "c_object_lib", + "id": "^c_object_lib::@5ed5358f70faf8d8af7a$", + "directorySource": "^object$", + "projectName": "Object", + "type": "OBJECT_LIBRARY", + "isGeneratorProvided": null, + "sources": [ + { + "path": "^empty\\.c$", + "isGenerated": null, + "sourceGroupName": "Source Files", + "compileGroupLanguage": "C", + "backtrace": [ + { + "file": "^object/CMakeLists\\.txt$", + "line": 5, + "command": "add_library", + "hasParent": true + }, + { + "file": "^object/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ] + } + ], + "sourceGroups": [ + { + "name": "Source Files", + "sourcePaths": [ + "^empty\\.c$" + ] + } + ], + "compileGroups": [ + { + "language": "C", + "sourcePaths": [ + "^empty\\.c$" + ], + "includes": null, + "defines": null, + "compileCommandFragments": null + } + ], + "backtrace": [ + { + "file": "^object/CMakeLists\\.txt$", + "line": 5, + "command": "add_library", + "hasParent": true + }, + { + "file": "^object/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ], + "folder": null, + "nameOnDisk": null, + "artifacts": [ + { + "path": "^object/.*/empty(\\.c)?\\.o(bj)?$", + "_dllExtra": false + } + ], + "build": "^object$", + "source": "^object$", + "install": null, + "link": null, + "archive": null, + "dependencies": [ + { + "id": "^ZERO_CHECK::@5ed5358f70faf8d8af7a$", + "backtrace": null + } + ] +} diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_shared_exe.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_shared_exe.json new file mode 100644 index 0000000..0d4018a --- /dev/null +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_shared_exe.json @@ -0,0 +1,143 @@ +{ + "name": "c_shared_exe", + "id": "^c_shared_exe::@6890427a1f51a3e7e1df$", + "directorySource": "^\\.$", + "projectName": "codemodel-v2", + "type": "EXECUTABLE", + "isGeneratorProvided": null, + "sources": [ + { + "path": "^empty\\.c$", + "isGenerated": null, + "sourceGroupName": "Source Files", + "compileGroupLanguage": "C", + "backtrace": [ + { + "file": "^codemodel-v2\\.cmake$", + "line": 10, + "command": "add_executable", + "hasParent": true + }, + { + "file": "^codemodel-v2\\.cmake$", + "line": null, + "command": null, + "hasParent": true + }, + { + "file": "^CMakeLists\\.txt$", + "line": 3, + "command": "include", + "hasParent": true + }, + { + "file": "^CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ] + } + ], + "sourceGroups": [ + { + "name": "Source Files", + "sourcePaths": [ + "^empty\\.c$" + ] + } + ], + "compileGroups": [ + { + "language": "C", + "sourcePaths": [ + "^empty\\.c$" + ], + "includes": null, + "defines": null, + "compileCommandFragments": null + } + ], + "backtrace": [ + { + "file": "^codemodel-v2\\.cmake$", + "line": 10, + "command": "add_executable", + "hasParent": true + }, + { + "file": "^codemodel-v2\\.cmake$", + "line": null, + "command": null, + "hasParent": true + }, + { + "file": "^CMakeLists\\.txt$", + "line": 3, + "command": "include", + "hasParent": true + }, + { + "file": "^CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ], + "folder": null, + "nameOnDisk": "^c_shared_exe(\\.exe)?$", + "artifacts": [ + { + "path": "^((Debug|Release|RelWithDebInfo|MinSizeRel)/)?c_shared_exe(\\.exe)?$", + "_dllExtra": false + }, + { + "path": "^((Debug|Release|RelWithDebInfo|MinSizeRel)/)?c_shared_exe\\.pdb$", + "_dllExtra": true + } + ], + "build": "^\\.$", + "source": "^\\.$", + "install": null, + "link": { + "language": "C", + "lto": true, + "commandFragments": null + }, + "archive": null, + "dependencies": [ + { + "id": "^c_shared_lib::@6890427a1f51a3e7e1df$", + "backtrace": [ + { + "file": "^codemodel-v2\\.cmake$", + "line": 11, + "command": "target_link_libraries", + "hasParent": true + }, + { + "file": "^codemodel-v2\\.cmake$", + "line": null, + "command": null, + "hasParent": true + }, + { + "file": "^CMakeLists\\.txt$", + "line": 3, + "command": "include", + "hasParent": true + }, + { + "file": "^CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ] + }, + { + "id": "^ZERO_CHECK::@6890427a1f51a3e7e1df$", + "backtrace": null + } + ] +} diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_shared_lib.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_shared_lib.json new file mode 100644 index 0000000..176a857 --- /dev/null +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_shared_lib.json @@ -0,0 +1,123 @@ +{ + "name": "c_shared_lib", + "id": "^c_shared_lib::@6890427a1f51a3e7e1df$", + "directorySource": "^\\.$", + "projectName": "codemodel-v2", + "type": "SHARED_LIBRARY", + "isGeneratorProvided": null, + "sources": [ + { + "path": "^empty\\.c$", + "isGenerated": null, + "sourceGroupName": "Source Files", + "compileGroupLanguage": "C", + "backtrace": [ + { + "file": "^codemodel-v2\\.cmake$", + "line": 9, + "command": "add_library", + "hasParent": true + }, + { + "file": "^codemodel-v2\\.cmake$", + "line": null, + "command": null, + "hasParent": true + }, + { + "file": "^CMakeLists\\.txt$", + "line": 3, + "command": "include", + "hasParent": true + }, + { + "file": "^CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ] + } + ], + "sourceGroups": [ + { + "name": "Source Files", + "sourcePaths": [ + "^empty\\.c$" + ] + } + ], + "compileGroups": [ + { + "language": "C", + "sourcePaths": [ + "^empty\\.c$" + ], + "includes": null, + "defines": [ + { + "define": "c_shared_lib_EXPORTS", + "backtrace": null + } + ], + "compileCommandFragments": null + } + ], + "backtrace": [ + { + "file": "^codemodel-v2\\.cmake$", + "line": 9, + "command": "add_library", + "hasParent": true + }, + { + "file": "^codemodel-v2\\.cmake$", + "line": null, + "command": null, + "hasParent": true + }, + { + "file": "^CMakeLists\\.txt$", + "line": 3, + "command": "include", + "hasParent": true + }, + { + "file": "^CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ], + "folder": null, + "nameOnDisk": "^(lib|cyg)?c_shared_lib\\.(so|dylib|dll)$", + "artifacts": [ + { + "path": "^lib/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?(lib|cyg)?c_shared_lib\\.(so|dylib|dll)$", + "_dllExtra": false + }, + { + "path": "^((Debug|Release|RelWithDebInfo|MinSizeRel)/)?(lib)?c_shared_lib\\.(dll\\.a|lib)$", + "_dllExtra": true + }, + { + "path": "^lib/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?(lib|cyg)?c_shared_lib\\.pdb$", + "_dllExtra": true + } + ], + "build": "^\\.$", + "source": "^\\.$", + "install": null, + "link": { + "language": "C", + "lto": true, + "commandFragments": null + }, + "archive": null, + "dependencies": [ + { + "id": "^ZERO_CHECK::@6890427a1f51a3e7e1df$", + "backtrace": null + } + ] +} diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_static_exe.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_static_exe.json new file mode 100644 index 0000000..5542277 --- /dev/null +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_static_exe.json @@ -0,0 +1,143 @@ +{ + "name": "c_static_exe", + "id": "^c_static_exe::@6890427a1f51a3e7e1df$", + "directorySource": "^\\.$", + "projectName": "codemodel-v2", + "type": "EXECUTABLE", + "isGeneratorProvided": null, + "sources": [ + { + "path": "^empty\\.c$", + "isGenerated": null, + "sourceGroupName": "Source Files", + "compileGroupLanguage": "C", + "backtrace": [ + { + "file": "^codemodel-v2\\.cmake$", + "line": 14, + "command": "add_executable", + "hasParent": true + }, + { + "file": "^codemodel-v2\\.cmake$", + "line": null, + "command": null, + "hasParent": true + }, + { + "file": "^CMakeLists\\.txt$", + "line": 3, + "command": "include", + "hasParent": true + }, + { + "file": "^CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ] + } + ], + "sourceGroups": [ + { + "name": "Source Files", + "sourcePaths": [ + "^empty\\.c$" + ] + } + ], + "compileGroups": [ + { + "language": "C", + "sourcePaths": [ + "^empty\\.c$" + ], + "includes": null, + "defines": null, + "compileCommandFragments": null + } + ], + "backtrace": [ + { + "file": "^codemodel-v2\\.cmake$", + "line": 14, + "command": "add_executable", + "hasParent": true + }, + { + "file": "^codemodel-v2\\.cmake$", + "line": null, + "command": null, + "hasParent": true + }, + { + "file": "^CMakeLists\\.txt$", + "line": 3, + "command": "include", + "hasParent": true + }, + { + "file": "^CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ], + "folder": null, + "nameOnDisk": "^c_static_exe(\\.exe)?$", + "artifacts": [ + { + "path": "^((Debug|Release|RelWithDebInfo|MinSizeRel)/)?c_static_exe(\\.exe)?$", + "_dllExtra": false + }, + { + "path": "^((Debug|Release|RelWithDebInfo|MinSizeRel)/)?c_static_exe\\.pdb$", + "_dllExtra": true + } + ], + "build": "^\\.$", + "source": "^\\.$", + "install": null, + "link": { + "language": "C", + "lto": null, + "commandFragments": null + }, + "archive": null, + "dependencies": [ + { + "id": "^c_static_lib::@6890427a1f51a3e7e1df$", + "backtrace": [ + { + "file": "^codemodel-v2\\.cmake$", + "line": 15, + "command": "target_link_libraries", + "hasParent": true + }, + { + "file": "^codemodel-v2\\.cmake$", + "line": null, + "command": null, + "hasParent": true + }, + { + "file": "^CMakeLists\\.txt$", + "line": 3, + "command": "include", + "hasParent": true + }, + { + "file": "^CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ] + }, + { + "id": "^ZERO_CHECK::@6890427a1f51a3e7e1df$", + "backtrace": null + } + ] +} diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_static_lib.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_static_lib.json new file mode 100644 index 0000000..4b63897 --- /dev/null +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_static_lib.json @@ -0,0 +1,108 @@ +{ + "name": "c_static_lib", + "id": "^c_static_lib::@6890427a1f51a3e7e1df$", + "directorySource": "^\\.$", + "projectName": "codemodel-v2", + "type": "STATIC_LIBRARY", + "isGeneratorProvided": null, + "sources": [ + { + "path": "^empty\\.c$", + "isGenerated": null, + "sourceGroupName": "Source Files", + "compileGroupLanguage": "C", + "backtrace": [ + { + "file": "^codemodel-v2\\.cmake$", + "line": 13, + "command": "add_library", + "hasParent": true + }, + { + "file": "^codemodel-v2\\.cmake$", + "line": null, + "command": null, + "hasParent": true + }, + { + "file": "^CMakeLists\\.txt$", + "line": 3, + "command": "include", + "hasParent": true + }, + { + "file": "^CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ] + } + ], + "sourceGroups": [ + { + "name": "Source Files", + "sourcePaths": [ + "^empty\\.c$" + ] + } + ], + "compileGroups": [ + { + "language": "C", + "sourcePaths": [ + "^empty\\.c$" + ], + "includes": null, + "defines": null, + "compileCommandFragments": null + } + ], + "backtrace": [ + { + "file": "^codemodel-v2\\.cmake$", + "line": 13, + "command": "add_library", + "hasParent": true + }, + { + "file": "^codemodel-v2\\.cmake$", + "line": null, + "command": null, + "hasParent": true + }, + { + "file": "^CMakeLists\\.txt$", + "line": 3, + "command": "include", + "hasParent": true + }, + { + "file": "^CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ], + "folder": null, + "nameOnDisk": "^(lib)?c_static_lib\\.(a|lib)$", + "artifacts": [ + { + "path": "^((Debug|Release|RelWithDebInfo|MinSizeRel)/)?(lib)?c_static_lib\\.(a|lib)$", + "_dllExtra": false + } + ], + "build": "^\\.$", + "source": "^\\.$", + "install": null, + "link": null, + "archive": { + "lto": true + }, + "dependencies": [ + { + "id": "^ZERO_CHECK::@6890427a1f51a3e7e1df$", + "backtrace": null + } + ] +} diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/custom_exe.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/custom_exe.json new file mode 100644 index 0000000..ab301e9 --- /dev/null +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/custom_exe.json @@ -0,0 +1,107 @@ +{ + "name": "custom_exe", + "id": "^custom_exe::@c11385ffed57b860da63$", + "directorySource": "^custom$", + "projectName": "Custom", + "type": "EXECUTABLE", + "isGeneratorProvided": null, + "sources": [ + { + "path": "^empty\\.c$", + "isGenerated": null, + "sourceGroupName": "Source Files", + "compileGroupLanguage": "C", + "backtrace": [ + { + "file": "^custom/CMakeLists\\.txt$", + "line": 4, + "command": "add_executable", + "hasParent": true + }, + { + "file": "^custom/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ] + } + ], + "sourceGroups": [ + { + "name": "Source Files", + "sourcePaths": [ + "^empty\\.c$" + ] + } + ], + "compileGroups": [ + { + "language": "C", + "sourcePaths": [ + "^empty\\.c$" + ], + "includes": null, + "defines": null, + "compileCommandFragments": null + } + ], + "backtrace": [ + { + "file": "^custom/CMakeLists\\.txt$", + "line": 4, + "command": "add_executable", + "hasParent": true + }, + { + "file": "^custom/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ], + "folder": null, + "nameOnDisk": "^custom_exe(\\.exe)?$", + "artifacts": [ + { + "path": "^custom/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?custom_exe(\\.exe)?$", + "_dllExtra": false + }, + { + "path": "^custom/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?custom_exe\\.pdb$", + "_dllExtra": true + } + ], + "build": "^custom$", + "source": "^custom$", + "install": null, + "link": { + "language": "C", + "lto": null, + "commandFragments": null + }, + "archive": null, + "dependencies": [ + { + "id": "^custom_tgt::@c11385ffed57b860da63$", + "backtrace": [ + { + "file": "^custom/CMakeLists\\.txt$", + "line": 5, + "command": "add_dependencies", + "hasParent": true + }, + { + "file": "^custom/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ] + }, + { + "id": "^ZERO_CHECK::@c11385ffed57b860da63$", + "backtrace": null + } + ] +} diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/custom_tgt.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/custom_tgt.json new file mode 100644 index 0000000..a7106fc --- /dev/null +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/custom_tgt.json @@ -0,0 +1,87 @@ +{ + "name": "custom_tgt", + "id": "^custom_tgt::@c11385ffed57b860da63$", + "directorySource": "^custom$", + "projectName": "Custom", + "type": "UTILITY", + "isGeneratorProvided": null, + "sources": [ + { + "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/custom/CMakeFiles/custom_tgt$", + "isGenerated": true, + "sourceGroupName": "", + "compileGroupLanguage": null, + "backtrace": [ + { + "file": "^custom/CMakeLists\\.txt$", + "line": 3, + "command": "add_custom_target", + "hasParent": true + }, + { + "file": "^custom/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ] + }, + { + "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/(custom/)?CMakeFiles/([0-9a-f]+/)?custom_tgt\\.rule$", + "isGenerated": true, + "sourceGroupName": "CMake Rules", + "compileGroupLanguage": null, + "backtrace": [ + { + "file": "^custom/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ] + } + ], + "sourceGroups": [ + { + "name": "", + "sourcePaths": [ + "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/custom/CMakeFiles/custom_tgt$" + ] + }, + { + "name": "CMake Rules", + "sourcePaths": [ + "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/(custom/)?CMakeFiles/([0-9a-f]+/)?custom_tgt\\.rule$" + ] + } + ], + "compileGroups": null, + "backtrace": [ + { + "file": "^custom/CMakeLists\\.txt$", + "line": 3, + "command": "add_custom_target", + "hasParent": true + }, + { + "file": "^custom/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ], + "folder": null, + "nameOnDisk": null, + "artifacts": null, + "build": "^custom$", + "source": "^custom$", + "install": null, + "link": null, + "archive": null, + "dependencies": [ + { + "id": "^ZERO_CHECK::@c11385ffed57b860da63$", + "backtrace": null + } + ] +} diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_alias_exe.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_alias_exe.json new file mode 100644 index 0000000..837f252 --- /dev/null +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_alias_exe.json @@ -0,0 +1,107 @@ +{ + "name": "cxx_alias_exe", + "id": "^cxx_alias_exe::@53632cba2752272bb008$", + "directorySource": "^alias$", + "projectName": "Alias", + "type": "EXECUTABLE", + "isGeneratorProvided": null, + "sources": [ + { + "path": "^empty\\.cxx$", + "isGenerated": null, + "sourceGroupName": "Source Files", + "compileGroupLanguage": "CXX", + "backtrace": [ + { + "file": "^alias/CMakeLists\\.txt$", + "line": 9, + "command": "add_executable", + "hasParent": true + }, + { + "file": "^alias/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ] + } + ], + "sourceGroups": [ + { + "name": "Source Files", + "sourcePaths": [ + "^empty\\.cxx$" + ] + } + ], + "compileGroups": [ + { + "language": "CXX", + "sourcePaths": [ + "^empty\\.cxx$" + ], + "includes": null, + "defines": null, + "compileCommandFragments": null + } + ], + "backtrace": [ + { + "file": "^alias/CMakeLists\\.txt$", + "line": 9, + "command": "add_executable", + "hasParent": true + }, + { + "file": "^alias/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ], + "folder": null, + "nameOnDisk": "^cxx_alias_exe(\\.exe)?$", + "artifacts": [ + { + "path": "^alias/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?cxx_alias_exe(\\.exe)?$", + "_dllExtra": false + }, + { + "path": "^alias/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?cxx_alias_exe\\.pdb$", + "_dllExtra": true + } + ], + "build": "^alias$", + "source": "^alias$", + "install": null, + "link": { + "language": "CXX", + "lto": null, + "commandFragments": null + }, + "archive": null, + "dependencies": [ + { + "id": "^cxx_lib::@a56b12a3f5c0529fb296$", + "backtrace": [ + { + "file": "^alias/CMakeLists\\.txt$", + "line": 10, + "command": "target_link_libraries", + "hasParent": true + }, + { + "file": "^alias/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ] + }, + { + "id": "^ZERO_CHECK::@53632cba2752272bb008$", + "backtrace": null + } + ] +} diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe.json new file mode 100644 index 0000000..7631837 --- /dev/null +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe.json @@ -0,0 +1,213 @@ +{ + "name": "cxx_exe", + "id": "^cxx_exe::@a56b12a3f5c0529fb296$", + "directorySource": "^cxx$", + "projectName": "Cxx", + "type": "EXECUTABLE", + "isGeneratorProvided": null, + "sources": [ + { + "path": "^empty\\.cxx$", + "isGenerated": null, + "sourceGroupName": "Source Files", + "compileGroupLanguage": "CXX", + "backtrace": [ + { + "file": "^cxx/CMakeLists\\.txt$", + "line": 5, + "command": "add_executable", + "hasParent": true + }, + { + "file": "^cxx/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ] + } + ], + "sourceGroups": [ + { + "name": "Source Files", + "sourcePaths": [ + "^empty\\.cxx$" + ] + } + ], + "compileGroups": [ + { + "language": "CXX", + "sourcePaths": [ + "^empty\\.cxx$" + ], + "includes": null, + "defines": null, + "compileCommandFragments": [ + { + "fragment" : "TargetCompileOptions", + "backtrace": [ + { + "file": "^cxx/CMakeLists\\.txt$", + "line": 17, + "command": "target_compile_options", + "hasParent": true + }, + { + "file" : "^cxx/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ] + } + ] + } + ], + "backtrace": [ + { + "file": "^cxx/CMakeLists\\.txt$", + "line": 5, + "command": "add_executable", + "hasParent": true + }, + { + "file": "^cxx/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ], + "folder": "bin", + "nameOnDisk": "^cxx_exe(\\.exe)?$", + "artifacts": [ + { + "path": "^cxx/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?cxx_exe(\\.exe)?$", + "_dllExtra": false + }, + { + "path": "^cxx/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?cxx_exe\\.pdb$", + "_dllExtra": true + } + ], + "build": "^cxx$", + "source": "^cxx$", + "install": { + "prefix": "^(/usr/local|[A-Za-z]:.*/codemodel-v2)$", + "destinations": [ + { + "path": "bin", + "backtrace": [ + { + "file": "^codemodel-v2\\.cmake$", + "line": 37, + "command": "install", + "hasParent": true + }, + { + "file": "^codemodel-v2\\.cmake$", + "line": null, + "command": null, + "hasParent": true + }, + { + "file": "^CMakeLists\\.txt$", + "line": 3, + "command": "include", + "hasParent": true + }, + { + "file": "^CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ] + } + ] + }, + "link": { + "language": "CXX", + "lto": null, + "commandFragments": [ + { + "fragment" : "TargetLinkOptions", + "role" : "flags", + "backtrace": [ + { + "file": "^cxx/CMakeLists\\.txt$", + "line": 18, + "command": "target_link_options", + "hasParent": true + }, + { + "file" : "^cxx/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ] + }, + { + "fragment" : ".*TargetLinkDir\\\"?$", + "role" : "libraryPath", + "backtrace": [ + { + "file": "^cxx/CMakeLists\\.txt$", + "line": 19, + "command": "target_link_directories", + "hasParent": true + }, + { + "file" : "^cxx/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ] + }, + { + "fragment" : ".*cxx_lib.*", + "role" : "libraries", + "backtrace": [ + { + "file": "^cxx/CMakeLists\\.txt$", + "line": 6, + "command": "target_link_libraries", + "hasParent": true + }, + { + "file" : "^cxx/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ] + } + ] + }, + "archive": null, + "dependencies": [ + { + "id": "^cxx_lib::@a56b12a3f5c0529fb296$", + "backtrace": [ + { + "file": "^cxx/CMakeLists\\.txt$", + "line": 6, + "command": "target_link_libraries", + "hasParent": true + }, + { + "file": "^cxx/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ] + }, + { + "id": "^ZERO_CHECK::@a56b12a3f5c0529fb296$", + "backtrace": null + } + ] +} diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_lib.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_lib.json new file mode 100644 index 0000000..94ac081 --- /dev/null +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_lib.json @@ -0,0 +1,84 @@ +{ + "name": "cxx_lib", + "id": "^cxx_lib::@a56b12a3f5c0529fb296$", + "directorySource": "^cxx$", + "projectName": "Cxx", + "type": "STATIC_LIBRARY", + "isGeneratorProvided": null, + "sources": [ + { + "path": "^empty\\.cxx$", + "isGenerated": null, + "sourceGroupName": "Source Files", + "compileGroupLanguage": "CXX", + "backtrace": [ + { + "file": "^cxx/CMakeLists\\.txt$", + "line": 4, + "command": "add_library", + "hasParent": true + }, + { + "file": "^cxx/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ] + } + ], + "sourceGroups": [ + { + "name": "Source Files", + "sourcePaths": [ + "^empty\\.cxx$" + ] + } + ], + "compileGroups": [ + { + "language": "CXX", + "sourcePaths": [ + "^empty\\.cxx$" + ], + "includes": null, + "defines": null, + "compileCommandFragments": null + } + ], + "backtrace": [ + { + "file": "^cxx/CMakeLists\\.txt$", + "line": 4, + "command": "add_library", + "hasParent": true + }, + { + "file": "^cxx/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ], + "folder": null, + "nameOnDisk": "^(lib)?cxx_lib\\.(a|lib)$", + "artifacts": [ + { + "path": "^cxx/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?(lib)?cxx_lib\\.(a|lib)$", + "_dllExtra": false + } + ], + "build": "^cxx$", + "source": "^cxx$", + "install": null, + "link": null, + "archive": { + "lto": null + }, + "dependencies": [ + { + "id": "^ZERO_CHECK::@a56b12a3f5c0529fb296$", + "backtrace": null + } + ] +} diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_object_exe.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_object_exe.json new file mode 100644 index 0000000..119c91d --- /dev/null +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_object_exe.json @@ -0,0 +1,154 @@ +{ + "name": "cxx_object_exe", + "id": "^cxx_object_exe::@5ed5358f70faf8d8af7a$", + "directorySource": "^object$", + "projectName": "Object", + "type": "EXECUTABLE", + "isGeneratorProvided": null, + "sources": [ + { + "path": "^empty\\.cxx$", + "isGenerated": null, + "sourceGroupName": "Source Files", + "compileGroupLanguage": "CXX", + "backtrace": [ + { + "file": "^object/CMakeLists\\.txt$", + "line": 10, + "command": "add_executable", + "hasParent": true + }, + { + "file": "^object/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ] + }, + { + "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/object/.*/empty(\\.cxx)?\\.o(bj)?$", + "isGenerated": true, + "sourceGroupName": "Object Libraries", + "compileGroupLanguage": null, + "backtrace": [ + { + "file": "^object/CMakeLists\\.txt$", + "line": 11, + "command": "target_link_libraries", + "hasParent": true + }, + { + "file": "^object/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ] + } + ], + "sourceGroups": [ + { + "name": "Source Files", + "sourcePaths": [ + "^empty\\.cxx$" + ] + }, + { + "name": "Object Libraries", + "sourcePaths": [ + "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/object/.*/empty(\\.cxx)?\\.o(bj)?$" + ] + } + ], + "compileGroups": [ + { + "language": "CXX", + "sourcePaths": [ + "^empty\\.cxx$" + ], + "includes": null, + "defines": null, + "compileCommandFragments": null + } + ], + "backtrace": [ + { + "file": "^object/CMakeLists\\.txt$", + "line": 10, + "command": "add_executable", + "hasParent": true + }, + { + "file": "^object/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ], + "folder": null, + "nameOnDisk": "^cxx_object_exe(\\.exe)?$", + "artifacts": [ + { + "path": "^object/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?cxx_object_exe(\\.exe)?$", + "_dllExtra": false + }, + { + "path": "^object/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?cxx_object_exe\\.pdb$", + "_dllExtra": true + } + ], + "build": "^object$", + "source": "^object$", + "install": { + "prefix": "^(/usr/local|[A-Za-z]:.*/codemodel-v2)$", + "destinations": [ + { + "path": "bin", + "backtrace": [ + { + "file": "^object/CMakeLists\\.txt$", + "line": 13, + "command": "install", + "hasParent": true + }, + { + "file": "^object/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ] + } + ] + }, + "link": { + "language": "CXX", + "lto": null, + "commandFragments": null + }, + "archive": null, + "dependencies": [ + { + "id": "^cxx_object_lib::@5ed5358f70faf8d8af7a$", + "backtrace": [ + { + "file": "^object/CMakeLists\\.txt$", + "line": 11, + "command": "target_link_libraries", + "hasParent": true + }, + { + "file": "^object/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ] + }, + { + "id": "^ZERO_CHECK::@5ed5358f70faf8d8af7a$", + "backtrace": null + } + ] +} diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_object_lib.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_object_lib.json new file mode 100644 index 0000000..8e99f7d --- /dev/null +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_object_lib.json @@ -0,0 +1,82 @@ +{ + "name": "cxx_object_lib", + "id": "^cxx_object_lib::@5ed5358f70faf8d8af7a$", + "directorySource": "^object$", + "projectName": "Object", + "type": "OBJECT_LIBRARY", + "isGeneratorProvided": null, + "sources": [ + { + "path": "^empty\\.cxx$", + "isGenerated": null, + "sourceGroupName": "Source Files", + "compileGroupLanguage": "CXX", + "backtrace": [ + { + "file": "^object/CMakeLists\\.txt$", + "line": 9, + "command": "add_library", + "hasParent": true + }, + { + "file": "^object/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ] + } + ], + "sourceGroups": [ + { + "name": "Source Files", + "sourcePaths": [ + "^empty\\.cxx$" + ] + } + ], + "compileGroups": [ + { + "language": "CXX", + "sourcePaths": [ + "^empty\\.cxx$" + ], + "includes": null, + "defines": null, + "compileCommandFragments": null + } + ], + "backtrace": [ + { + "file": "^object/CMakeLists\\.txt$", + "line": 9, + "command": "add_library", + "hasParent": true + }, + { + "file": "^object/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ], + "folder": null, + "nameOnDisk": null, + "artifacts": [ + { + "path": "^object/.*/empty(\\.cxx)?\\.o(bj)?$", + "_dllExtra": false + } + ], + "build": "^object$", + "source": "^object$", + "install": null, + "link": null, + "archive": null, + "dependencies": [ + { + "id": "^ZERO_CHECK::@5ed5358f70faf8d8af7a$", + "backtrace": null + } + ] +} diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_shared_exe.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_shared_exe.json new file mode 100644 index 0000000..4421c8f --- /dev/null +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_shared_exe.json @@ -0,0 +1,107 @@ +{ + "name": "cxx_shared_exe", + "id": "^cxx_shared_exe::@a56b12a3f5c0529fb296$", + "directorySource": "^cxx$", + "projectName": "Cxx", + "type": "EXECUTABLE", + "isGeneratorProvided": null, + "sources": [ + { + "path": "^empty\\.cxx$", + "isGenerated": null, + "sourceGroupName": "Source Files", + "compileGroupLanguage": "CXX", + "backtrace": [ + { + "file": "^cxx/CMakeLists\\.txt$", + "line": 10, + "command": "add_executable", + "hasParent": true + }, + { + "file": "^cxx/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ] + } + ], + "sourceGroups": [ + { + "name": "Source Files", + "sourcePaths": [ + "^empty\\.cxx$" + ] + } + ], + "compileGroups": [ + { + "language": "CXX", + "sourcePaths": [ + "^empty\\.cxx$" + ], + "includes": null, + "defines": null, + "compileCommandFragments": null + } + ], + "backtrace": [ + { + "file": "^cxx/CMakeLists\\.txt$", + "line": 10, + "command": "add_executable", + "hasParent": true + }, + { + "file": "^cxx/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ], + "folder": null, + "nameOnDisk": "^cxx_shared_exe(\\.exe)?$", + "artifacts": [ + { + "path": "^cxx/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?cxx_shared_exe(\\.exe)?$", + "_dllExtra": false + }, + { + "path": "^cxx/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?cxx_shared_exe\\.pdb$", + "_dllExtra": true + } + ], + "build": "^cxx$", + "source": "^cxx$", + "install": null, + "link": { + "language": "CXX", + "lto": null, + "commandFragments": null + }, + "archive": null, + "dependencies": [ + { + "id": "^cxx_shared_lib::@a56b12a3f5c0529fb296$", + "backtrace": [ + { + "file": "^cxx/CMakeLists\\.txt$", + "line": 11, + "command": "target_link_libraries", + "hasParent": true + }, + { + "file": "^cxx/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ] + }, + { + "id": "^ZERO_CHECK::@a56b12a3f5c0529fb296$", + "backtrace": null + } + ] +} diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_shared_lib.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_shared_lib.json new file mode 100644 index 0000000..171a4f5 --- /dev/null +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_shared_lib.json @@ -0,0 +1,99 @@ +{ + "name": "cxx_shared_lib", + "id": "^cxx_shared_lib::@a56b12a3f5c0529fb296$", + "directorySource": "^cxx$", + "projectName": "Cxx", + "type": "SHARED_LIBRARY", + "isGeneratorProvided": null, + "sources": [ + { + "path": "^empty\\.cxx$", + "isGenerated": null, + "sourceGroupName": "Source Files", + "compileGroupLanguage": "CXX", + "backtrace": [ + { + "file": "^cxx/CMakeLists\\.txt$", + "line": 9, + "command": "add_library", + "hasParent": true + }, + { + "file": "^cxx/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ] + } + ], + "sourceGroups": [ + { + "name": "Source Files", + "sourcePaths": [ + "^empty\\.cxx$" + ] + } + ], + "compileGroups": [ + { + "language": "CXX", + "sourcePaths": [ + "^empty\\.cxx$" + ], + "includes": null, + "defines": [ + { + "define": "cxx_shared_lib_EXPORTS", + "backtrace": null + } + ], + "compileCommandFragments": null + } + ], + "backtrace": [ + { + "file": "^cxx/CMakeLists\\.txt$", + "line": 9, + "command": "add_library", + "hasParent": true + }, + { + "file": "^cxx/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ], + "folder": null, + "nameOnDisk": "^(lib|cyg)?cxx_shared_lib\\.(so|dylib|dll)$", + "artifacts": [ + { + "path": "^cxx/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?(lib|cyg)?cxx_shared_lib\\.(so|dylib|dll)$", + "_dllExtra": false + }, + { + "path": "^cxx/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?(lib)?cxx_shared_lib\\.(dll\\.a|lib)$", + "_dllExtra": true + }, + { + "path": "^cxx/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?(lib|cyg)?cxx_shared_lib\\.pdb$", + "_dllExtra": true + } + ], + "build": "^cxx$", + "source": "^cxx$", + "install": null, + "link": { + "language": "CXX", + "lto": null, + "commandFragments": null + }, + "archive": null, + "dependencies": [ + { + "id": "^ZERO_CHECK::@a56b12a3f5c0529fb296$", + "backtrace": null + } + ] +} diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_static_exe.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_static_exe.json new file mode 100644 index 0000000..52c42de --- /dev/null +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_static_exe.json @@ -0,0 +1,107 @@ +{ + "name": "cxx_static_exe", + "id": "^cxx_static_exe::@a56b12a3f5c0529fb296$", + "directorySource": "^cxx$", + "projectName": "Cxx", + "type": "EXECUTABLE", + "isGeneratorProvided": null, + "sources": [ + { + "path": "^empty\\.cxx$", + "isGenerated": null, + "sourceGroupName": "Source Files", + "compileGroupLanguage": "CXX", + "backtrace": [ + { + "file": "^cxx/CMakeLists\\.txt$", + "line": 14, + "command": "add_executable", + "hasParent": true + }, + { + "file": "^cxx/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ] + } + ], + "sourceGroups": [ + { + "name": "Source Files", + "sourcePaths": [ + "^empty\\.cxx$" + ] + } + ], + "compileGroups": [ + { + "language": "CXX", + "sourcePaths": [ + "^empty\\.cxx$" + ], + "includes": null, + "defines": null, + "compileCommandFragments": null + } + ], + "backtrace": [ + { + "file": "^cxx/CMakeLists\\.txt$", + "line": 14, + "command": "add_executable", + "hasParent": true + }, + { + "file": "^cxx/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ], + "folder": null, + "nameOnDisk": "^cxx_static_exe(\\.exe)?$", + "artifacts": [ + { + "path": "^cxx/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?cxx_static_exe(\\.exe)?$", + "_dllExtra": false + }, + { + "path": "^cxx/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?cxx_static_exe\\.pdb$", + "_dllExtra": true + } + ], + "build": "^cxx$", + "source": "^cxx$", + "install": null, + "link": { + "language": "CXX", + "lto": null, + "commandFragments": null + }, + "archive": null, + "dependencies": [ + { + "id": "^cxx_static_lib::@a56b12a3f5c0529fb296$", + "backtrace": [ + { + "file": "^cxx/CMakeLists\\.txt$", + "line": 15, + "command": "target_link_libraries", + "hasParent": true + }, + { + "file": "^cxx/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ] + }, + { + "id": "^ZERO_CHECK::@a56b12a3f5c0529fb296$", + "backtrace": null + } + ] +} diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_static_lib.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_static_lib.json new file mode 100644 index 0000000..98298be --- /dev/null +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_static_lib.json @@ -0,0 +1,84 @@ +{ + "name": "cxx_static_lib", + "id": "^cxx_static_lib::@a56b12a3f5c0529fb296$", + "directorySource": "^cxx$", + "projectName": "Cxx", + "type": "STATIC_LIBRARY", + "isGeneratorProvided": null, + "sources": [ + { + "path": "^empty\\.cxx$", + "isGenerated": null, + "sourceGroupName": "Source Files", + "compileGroupLanguage": "CXX", + "backtrace": [ + { + "file": "^cxx/CMakeLists\\.txt$", + "line": 13, + "command": "add_library", + "hasParent": true + }, + { + "file": "^cxx/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ] + } + ], + "sourceGroups": [ + { + "name": "Source Files", + "sourcePaths": [ + "^empty\\.cxx$" + ] + } + ], + "compileGroups": [ + { + "language": "CXX", + "sourcePaths": [ + "^empty\\.cxx$" + ], + "includes": null, + "defines": null, + "compileCommandFragments": null + } + ], + "backtrace": [ + { + "file": "^cxx/CMakeLists\\.txt$", + "line": 13, + "command": "add_library", + "hasParent": true + }, + { + "file": "^cxx/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ], + "folder": null, + "nameOnDisk": "^(lib)?cxx_static_lib\\.(a|lib)$", + "artifacts": [ + { + "path": "^cxx/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?(lib)?cxx_static_lib\\.(a|lib)$", + "_dllExtra": false + } + ], + "build": "^cxx$", + "source": "^cxx$", + "install": null, + "link": null, + "archive": { + "lto": null + }, + "dependencies": [ + { + "id": "^ZERO_CHECK::@a56b12a3f5c0529fb296$", + "backtrace": null + } + ] +} diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/generated_exe.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/generated_exe.json new file mode 100644 index 0000000..d41bbb2 --- /dev/null +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/generated_exe.json @@ -0,0 +1,303 @@ +{ + "name": "generated_exe", + "id": "^generated_exe::@[0-9a-f]+$", + "directorySource": "^.*/Tests/RunCMake/FileAPIExternalSource$", + "projectName": "External", + "type": "EXECUTABLE", + "isGeneratorProvided": null, + "sources": [ + { + "path": "^.*/Tests/RunCMake/FileAPIExternalSource/empty\\.c$", + "isGenerated": null, + "sourceGroupName": "Source Files", + "compileGroupLanguage": "C", + "backtrace": [ + { + "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$", + "line": 5, + "command": "add_executable", + "hasParent": true + }, + { + "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ] + }, + { + "path": "^.*/Tests/RunCMake/FileAPI/FileAPIExternalBuild/generated\\.cxx$", + "isGenerated": true, + "sourceGroupName": "Generated Source Files", + "compileGroupLanguage": "CXX", + "backtrace": [ + { + "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$", + "line": 6, + "command": "target_sources", + "hasParent": true + }, + { + "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ] + } + ], + "sourceGroups": [ + { + "name": "Source Files", + "sourcePaths": [ + "^.*/Tests/RunCMake/FileAPIExternalSource/empty\\.c$" + ] + }, + { + "name": "Generated Source Files", + "sourcePaths": [ + "^.*/Tests/RunCMake/FileAPI/FileAPIExternalBuild/generated\\.cxx$" + ] + } + ], + "compileGroups": [ + { + "language": "C", + "sourcePaths": [ + "^.*/Tests/RunCMake/FileAPIExternalSource/empty\\.c$" + ], + "includes": [ + { + "path": "^.*/Tests/RunCMake/FileAPI/FileAPIExternalBuild$", + "isSystem": null, + "backtrace": [ + { + "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$", + "line": 10, + "command": "set_property", + "hasParent": true + }, + { + "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ] + }, + { + "path": "^.*/Tests/RunCMake/FileAPIExternalSource$", + "isSystem": true, + "backtrace": [ + { + "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$", + "line": 11, + "command": "target_include_directories", + "hasParent": true + }, + { + "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ] + } + ], + "defines": [ + { + "define": "EMPTY_C=1", + "backtrace": [ + { + "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$", + "line": 9, + "command": "set_property", + "hasParent": true + }, + { + "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ] + }, + { + "define": "SRC_DUMMY", + "backtrace": [ + { + "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$", + "line": 9, + "command": "set_property", + "hasParent": true + }, + { + "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ] + }, + { + "define": "GENERATED_EXE=1", + "backtrace": [ + { + "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$", + "line": 12, + "command": "target_compile_definitions", + "hasParent": true + }, + { + "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ] + }, + { + "define": "TGT_DUMMY", + "backtrace": [ + { + "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$", + "line": 12, + "command": "target_compile_definitions", + "hasParent": true + }, + { + "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ] + } + ], + "compileCommandFragments": [ + { + "fragment" : "SRC_COMPILE_OPTIONS_DUMMY", + "backtrace": [ + { + "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$", + "line": 13, + "command": "set_source_files_properties", + "hasParent": true + }, + { + "file" : "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ] + } + ] + }, + { + "language": "CXX", + "sourcePaths": [ + "^.*/Tests/RunCMake/FileAPI/FileAPIExternalBuild/generated\\.cxx$" + ], + "includes": [ + { + "path": "^.*/Tests/RunCMake/FileAPIExternalSource$", + "isSystem": true, + "backtrace": [ + { + "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$", + "line": 11, + "command": "target_include_directories", + "hasParent": true + }, + { + "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ] + } + ], + "defines": [ + { + "define": "GENERATED_EXE=1", + "backtrace": [ + { + "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$", + "line": 12, + "command": "target_compile_definitions", + "hasParent": true + }, + { + "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ] + }, + { + "define": "TGT_DUMMY", + "backtrace": [ + { + "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$", + "line": 12, + "command": "target_compile_definitions", + "hasParent": true + }, + { + "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ] + } + ], + "compileCommandFragments": null + } + ], + "backtrace": [ + { + "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$", + "line": 5, + "command": "add_executable", + "hasParent": true + }, + { + "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ], + "folder": null, + "nameOnDisk": "^generated_exe(\\.exe)?$", + "artifacts": [ + { + "path": "^.*/Tests/RunCMake/FileAPI/FileAPIExternalBuild/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?generated_exe(\\.exe)?$", + "_dllExtra": false + }, + { + "path": "^.*/Tests/RunCMake/FileAPI/FileAPIExternalBuild/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?generated_exe\\.pdb$", + "_dllExtra": true + } + ], + "build": "^.*/Tests/RunCMake/FileAPI/FileAPIExternalBuild$", + "source": "^.*/Tests/RunCMake/FileAPIExternalSource$", + "install": null, + "link": { + "language": "CXX", + "lto": null, + "commandFragments": null + }, + "archive": null, + "dependencies": [ + { + "id": "^ZERO_CHECK::@[0-9a-f]+$", + "backtrace": null + } + ] +} diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/interface_exe.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/interface_exe.json new file mode 100644 index 0000000..fe0524c --- /dev/null +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/interface_exe.json @@ -0,0 +1,152 @@ +{ + "name": "interface_exe", + "id": "^interface_exe::@6890427a1f51a3e7e1df$", + "directorySource": "^\\.$", + "projectName": "codemodel-v2", + "type": "EXECUTABLE", + "isGeneratorProvided": null, + "sources": [ + { + "path": "^empty\\.c$", + "isGenerated": null, + "sourceGroupName": "Source Files", + "compileGroupLanguage": "C", + "backtrace": [ + { + "file": "^include_test\\.cmake$", + "line": 3, + "command": "add_executable", + "hasParent": true + }, + { + "file": "^include_test\\.cmake$", + "line": null, + "command": null, + "hasParent": true + }, + { + "file": "^codemodel-v2\\.cmake$", + "line": 3, + "command": "include", + "hasParent": true + }, + { + "file": "^codemodel-v2\\.cmake$", + "line": null, + "command": null, + "hasParent": true + }, + { + "file": "^CMakeLists\\.txt$", + "line": 3, + "command": "include", + "hasParent": true + }, + { + "file": "^CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ] + } + ], + "sourceGroups": [ + { + "name": "Source Files", + "sourcePaths": [ + "^empty\\.c$" + ] + } + ], + "compileGroups": [ + { + "language": "C", + "sourcePaths": [ + "^empty\\.c$" + ], + "includes": null, + "defines": [ + { + "define": "interface_exe_EXPORTS", + "backtrace": null + } + ], + "compileCommandFragments": null + } + ], + "backtrace": [ + { + "file": "^include_test\\.cmake$", + "line": 3, + "command": "add_executable", + "hasParent": true + }, + { + "file": "^include_test\\.cmake$", + "line": null, + "command": null, + "hasParent": true + }, + { + "file": "^codemodel-v2\\.cmake$", + "line": 3, + "command": "include", + "hasParent": true + }, + { + "file": "^codemodel-v2\\.cmake$", + "line": null, + "command": null, + "hasParent": true + }, + { + "file": "^CMakeLists\\.txt$", + "line": 3, + "command": "include", + "hasParent": true + }, + { + "file": "^CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ], + "folder": null, + "nameOnDisk": "^my_interface_exe\\.myexe$", + "artifacts": [ + { + "path": "^bin/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?my_interface_exe\\.myexe$", + "_dllExtra": false + }, + { + "path": "^lib/my_interface_exe\\.imp$", + "_aixExtra": true, + "_dllExtra": false + }, + { + "path": "^lib/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?(lib)?my_interface_exe\\.(dll\\.a|lib)$", + "_dllExtra": true + }, + { + "path": "^bin/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?my_interface_exe\\.pdb$", + "_dllExtra": true + } + ], + "build": "^\\.$", + "source": "^\\.$", + "install": null, + "link": { + "language": "C", + "lto": null, + "commandFragments": null + }, + "archive": null, + "dependencies": [ + { + "id": "^ZERO_CHECK::@6890427a1f51a3e7e1df$", + "backtrace": null + } + ] +} diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/link_imported_exe.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/link_imported_exe.json new file mode 100644 index 0000000..312f4c5 --- /dev/null +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/link_imported_exe.json @@ -0,0 +1,90 @@ +{ + "name": "link_imported_exe", + "id": "^link_imported_exe::@ba7eb709d0b48779c6c8$", + "directorySource": "^imported$", + "projectName": "Imported", + "type": "EXECUTABLE", + "isGeneratorProvided": null, + "sources": [ + { + "path": "^empty\\.c$", + "isGenerated": null, + "sourceGroupName": "Source Files", + "compileGroupLanguage": "C", + "backtrace": [ + { + "file": "^imported/CMakeLists\\.txt$", + "line": 5, + "command": "add_executable", + "hasParent": true + }, + { + "file": "^imported/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ] + } + ], + "sourceGroups": [ + { + "name": "Source Files", + "sourcePaths": [ + "^empty\\.c$" + ] + } + ], + "compileGroups": [ + { + "language": "C", + "sourcePaths": [ + "^empty\\.c$" + ], + "includes": null, + "defines": null, + "compileCommandFragments": null + } + ], + "backtrace": [ + { + "file": "^imported/CMakeLists\\.txt$", + "line": 5, + "command": "add_executable", + "hasParent": true + }, + { + "file": "^imported/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ], + "folder": null, + "nameOnDisk": "^link_imported_exe(\\.exe)?$", + "artifacts": [ + { + "path": "^imported/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?link_imported_exe(\\.exe)?$", + "_dllExtra": false + }, + { + "path": "^imported/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?link_imported_exe\\.pdb$", + "_dllExtra": true + } + ], + "build": "^imported$", + "source": "^imported$", + "install": null, + "link": { + "language": "C", + "lto": null, + "commandFragments": null + }, + "archive": null, + "dependencies": [ + { + "id": "^ZERO_CHECK::@ba7eb709d0b48779c6c8$", + "backtrace": null + } + ] +} diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/link_imported_interface_exe.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/link_imported_interface_exe.json new file mode 100644 index 0000000..7d0e6df --- /dev/null +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/link_imported_interface_exe.json @@ -0,0 +1,90 @@ +{ + "name": "link_imported_interface_exe", + "id": "^link_imported_interface_exe::@ba7eb709d0b48779c6c8$", + "directorySource": "^imported$", + "projectName": "Imported", + "type": "EXECUTABLE", + "isGeneratorProvided": null, + "sources": [ + { + "path": "^empty\\.c$", + "isGenerated": null, + "sourceGroupName": "Source Files", + "compileGroupLanguage": "C", + "backtrace": [ + { + "file": "^imported/CMakeLists\\.txt$", + "line": 23, + "command": "add_executable", + "hasParent": true + }, + { + "file": "^imported/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ] + } + ], + "sourceGroups": [ + { + "name": "Source Files", + "sourcePaths": [ + "^empty\\.c$" + ] + } + ], + "compileGroups": [ + { + "language": "C", + "sourcePaths": [ + "^empty\\.c$" + ], + "includes": null, + "defines": null, + "compileCommandFragments": null + } + ], + "backtrace": [ + { + "file": "^imported/CMakeLists\\.txt$", + "line": 23, + "command": "add_executable", + "hasParent": true + }, + { + "file": "^imported/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ], + "folder": null, + "nameOnDisk": "^link_imported_interface_exe(\\.exe)?$", + "artifacts": [ + { + "path": "^imported/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?link_imported_interface_exe(\\.exe)?$", + "_dllExtra": false + }, + { + "path": "^imported/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?link_imported_interface_exe\\.pdb$", + "_dllExtra": true + } + ], + "build": "^imported$", + "source": "^imported$", + "install": null, + "link": { + "language": "C", + "lto": null, + "commandFragments": null + }, + "archive": null, + "dependencies": [ + { + "id": "^ZERO_CHECK::@ba7eb709d0b48779c6c8$", + "backtrace": null + } + ] +} diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/link_imported_object_exe.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/link_imported_object_exe.json new file mode 100644 index 0000000..4aec524 --- /dev/null +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/link_imported_object_exe.json @@ -0,0 +1,90 @@ +{ + "name": "link_imported_object_exe", + "id": "^link_imported_object_exe::@ba7eb709d0b48779c6c8$", + "directorySource": "^imported$", + "projectName": "Imported", + "type": "EXECUTABLE", + "isGeneratorProvided": null, + "sources": [ + { + "path": "^empty\\.c$", + "isGenerated": null, + "sourceGroupName": "Source Files", + "compileGroupLanguage": "C", + "backtrace": [ + { + "file": "^imported/CMakeLists\\.txt$", + "line": 18, + "command": "add_executable", + "hasParent": true + }, + { + "file": "^imported/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ] + } + ], + "sourceGroups": [ + { + "name": "Source Files", + "sourcePaths": [ + "^empty\\.c$" + ] + } + ], + "compileGroups": [ + { + "language": "C", + "sourcePaths": [ + "^empty\\.c$" + ], + "includes": null, + "defines": null, + "compileCommandFragments": null + } + ], + "backtrace": [ + { + "file": "^imported/CMakeLists\\.txt$", + "line": 18, + "command": "add_executable", + "hasParent": true + }, + { + "file": "^imported/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ], + "folder": null, + "nameOnDisk": "^link_imported_object_exe(\\.exe)?$", + "artifacts": [ + { + "path": "^imported/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?link_imported_object_exe(\\.exe)?$", + "_dllExtra": false + }, + { + "path": "^imported/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?link_imported_object_exe\\.pdb$", + "_dllExtra": true + } + ], + "build": "^imported$", + "source": "^imported$", + "install": null, + "link": { + "language": "C", + "lto": null, + "commandFragments": null + }, + "archive": null, + "dependencies": [ + { + "id": "^ZERO_CHECK::@ba7eb709d0b48779c6c8$", + "backtrace": null + } + ] +} diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/link_imported_shared_exe.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/link_imported_shared_exe.json new file mode 100644 index 0000000..f5846ec --- /dev/null +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/link_imported_shared_exe.json @@ -0,0 +1,90 @@ +{ + "name": "link_imported_shared_exe", + "id": "^link_imported_shared_exe::@ba7eb709d0b48779c6c8$", + "directorySource": "^imported$", + "projectName": "Imported", + "type": "EXECUTABLE", + "isGeneratorProvided": null, + "sources": [ + { + "path": "^empty\\.c$", + "isGenerated": null, + "sourceGroupName": "Source Files", + "compileGroupLanguage": "C", + "backtrace": [ + { + "file": "^imported/CMakeLists\\.txt$", + "line": 9, + "command": "add_executable", + "hasParent": true + }, + { + "file": "^imported/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ] + } + ], + "sourceGroups": [ + { + "name": "Source Files", + "sourcePaths": [ + "^empty\\.c$" + ] + } + ], + "compileGroups": [ + { + "language": "C", + "sourcePaths": [ + "^empty\\.c$" + ], + "includes": null, + "defines": null, + "compileCommandFragments": null + } + ], + "backtrace": [ + { + "file": "^imported/CMakeLists\\.txt$", + "line": 9, + "command": "add_executable", + "hasParent": true + }, + { + "file": "^imported/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ], + "folder": null, + "nameOnDisk": "^link_imported_shared_exe(\\.exe)?$", + "artifacts": [ + { + "path": "^imported/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?link_imported_shared_exe(\\.exe)?$", + "_dllExtra": false + }, + { + "path": "^imported/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?link_imported_shared_exe\\.pdb$", + "_dllExtra": true + } + ], + "build": "^imported$", + "source": "^imported$", + "install": null, + "link": { + "language": "C", + "lto": null, + "commandFragments": null + }, + "archive": null, + "dependencies": [ + { + "id": "^ZERO_CHECK::@ba7eb709d0b48779c6c8$", + "backtrace": null + } + ] +} diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/link_imported_static_exe.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/link_imported_static_exe.json new file mode 100644 index 0000000..29a1695 --- /dev/null +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/link_imported_static_exe.json @@ -0,0 +1,90 @@ +{ + "name": "link_imported_static_exe", + "id": "^link_imported_static_exe::@ba7eb709d0b48779c6c8$", + "directorySource": "^imported$", + "projectName": "Imported", + "type": "EXECUTABLE", + "isGeneratorProvided": null, + "sources": [ + { + "path": "^empty\\.c$", + "isGenerated": null, + "sourceGroupName": "Source Files", + "compileGroupLanguage": "C", + "backtrace": [ + { + "file": "^imported/CMakeLists\\.txt$", + "line": 13, + "command": "add_executable", + "hasParent": true + }, + { + "file": "^imported/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ] + } + ], + "sourceGroups": [ + { + "name": "Source Files", + "sourcePaths": [ + "^empty\\.c$" + ] + } + ], + "compileGroups": [ + { + "language": "C", + "sourcePaths": [ + "^empty\\.c$" + ], + "includes": null, + "defines": null, + "compileCommandFragments": null + } + ], + "backtrace": [ + { + "file": "^imported/CMakeLists\\.txt$", + "line": 13, + "command": "add_executable", + "hasParent": true + }, + { + "file": "^imported/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ], + "folder": null, + "nameOnDisk": "^link_imported_static_exe(\\.exe)?$", + "artifacts": [ + { + "path": "^imported/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?link_imported_static_exe(\\.exe)?$", + "_dllExtra": false + }, + { + "path": "^imported/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?link_imported_static_exe\\.pdb$", + "_dllExtra": true + } + ], + "build": "^imported$", + "source": "^imported$", + "install": null, + "link": { + "language": "C", + "lto": null, + "commandFragments": null + }, + "archive": null, + "dependencies": [ + { + "id": "^ZERO_CHECK::@ba7eb709d0b48779c6c8$", + "backtrace": null + } + ] +} diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/zero_check_alias.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/zero_check_alias.json new file mode 100644 index 0000000..941c172 --- /dev/null +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/zero_check_alias.json @@ -0,0 +1,70 @@ +{ + "name": "ZERO_CHECK", + "id": "^ZERO_CHECK::@53632cba2752272bb008$", + "directorySource": "^alias$", + "projectName": "Alias", + "type": "UTILITY", + "isGeneratorProvided": true, + "sources": [ + { + "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/alias/CMakeFiles/ZERO_CHECK$", + "isGenerated": true, + "sourceGroupName": "", + "compileGroupLanguage": null, + "backtrace": [ + { + "file": "^alias/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ] + }, + { + "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/alias/CMakeFiles/ZERO_CHECK\\.rule$", + "isGenerated": true, + "sourceGroupName": "CMake Rules", + "compileGroupLanguage": null, + "backtrace": [ + { + "file": "^alias/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ] + } + ], + "sourceGroups": [ + { + "name": "", + "sourcePaths": [ + "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/alias/CMakeFiles/ZERO_CHECK$" + ] + }, + { + "name": "CMake Rules", + "sourcePaths": [ + "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/alias/CMakeFiles/ZERO_CHECK\\.rule$" + ] + } + ], + "compileGroups": null, + "backtrace": [ + { + "file": "^alias/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ], + "folder": null, + "nameOnDisk": null, + "artifacts": null, + "build": "^alias$", + "source": "^alias$", + "install": null, + "link": null, + "archive": null, + "dependencies": null +} diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/zero_check_custom.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/zero_check_custom.json new file mode 100644 index 0000000..98c6dd9 --- /dev/null +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/zero_check_custom.json @@ -0,0 +1,70 @@ +{ + "name": "ZERO_CHECK", + "id": "^ZERO_CHECK::@c11385ffed57b860da63$", + "directorySource": "^custom$", + "projectName": "Custom", + "type": "UTILITY", + "isGeneratorProvided": true, + "sources": [ + { + "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/custom/CMakeFiles/ZERO_CHECK$", + "isGenerated": true, + "sourceGroupName": "", + "compileGroupLanguage": null, + "backtrace": [ + { + "file": "^custom/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ] + }, + { + "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/custom/CMakeFiles/ZERO_CHECK\\.rule$", + "isGenerated": true, + "sourceGroupName": "CMake Rules", + "compileGroupLanguage": null, + "backtrace": [ + { + "file": "^custom/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ] + } + ], + "sourceGroups": [ + { + "name": "", + "sourcePaths": [ + "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/custom/CMakeFiles/ZERO_CHECK$" + ] + }, + { + "name": "CMake Rules", + "sourcePaths": [ + "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/custom/CMakeFiles/ZERO_CHECK\\.rule$" + ] + } + ], + "compileGroups": null, + "backtrace": [ + { + "file": "^custom/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ], + "folder": null, + "nameOnDisk": null, + "artifacts": null, + "build": "^custom$", + "source": "^custom$", + "install": null, + "link": null, + "archive": null, + "dependencies": null +} diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/zero_check_cxx.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/zero_check_cxx.json new file mode 100644 index 0000000..b72ff82 --- /dev/null +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/zero_check_cxx.json @@ -0,0 +1,70 @@ +{ + "name": "ZERO_CHECK", + "id": "^ZERO_CHECK::@a56b12a3f5c0529fb296$", + "directorySource": "^cxx$", + "projectName": "Cxx", + "type": "UTILITY", + "isGeneratorProvided": true, + "sources": [ + { + "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/cxx/CMakeFiles/ZERO_CHECK$", + "isGenerated": true, + "sourceGroupName": "", + "compileGroupLanguage": null, + "backtrace": [ + { + "file": "^cxx/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ] + }, + { + "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/cxx/CMakeFiles/ZERO_CHECK\\.rule$", + "isGenerated": true, + "sourceGroupName": "CMake Rules", + "compileGroupLanguage": null, + "backtrace": [ + { + "file": "^cxx/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ] + } + ], + "sourceGroups": [ + { + "name": "", + "sourcePaths": [ + "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/cxx/CMakeFiles/ZERO_CHECK$" + ] + }, + { + "name": "CMake Rules", + "sourcePaths": [ + "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/cxx/CMakeFiles/ZERO_CHECK\\.rule$" + ] + } + ], + "compileGroups": null, + "backtrace": [ + { + "file": "^cxx/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ], + "folder": null, + "nameOnDisk": null, + "artifacts": null, + "build": "^cxx$", + "source": "^cxx$", + "install": null, + "link": null, + "archive": null, + "dependencies": null +} diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/zero_check_external.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/zero_check_external.json new file mode 100644 index 0000000..9e73806 --- /dev/null +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/zero_check_external.json @@ -0,0 +1,70 @@ +{ + "name": "ZERO_CHECK", + "id": "^ZERO_CHECK::@[0-9a-f]+$", + "directorySource": "^.*/Tests/RunCMake/FileAPIExternalSource$", + "projectName": "External", + "type": "UTILITY", + "isGeneratorProvided": true, + "sources": [ + { + "path": "^.*/Tests/RunCMake/FileAPI/FileAPIExternalBuild/CMakeFiles/ZERO_CHECK$", + "isGenerated": true, + "sourceGroupName": "", + "compileGroupLanguage": null, + "backtrace": [ + { + "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ] + }, + { + "path": "^.*/Tests/RunCMake/FileAPI/FileAPIExternalBuild/CMakeFiles/ZERO_CHECK\\.rule$", + "isGenerated": true, + "sourceGroupName": "CMake Rules", + "compileGroupLanguage": null, + "backtrace": [ + { + "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ] + } + ], + "sourceGroups": [ + { + "name": "", + "sourcePaths": [ + "^.*/Tests/RunCMake/FileAPI/FileAPIExternalBuild/CMakeFiles/ZERO_CHECK$" + ] + }, + { + "name": "CMake Rules", + "sourcePaths": [ + "^.*/Tests/RunCMake/FileAPI/FileAPIExternalBuild/CMakeFiles/ZERO_CHECK\\.rule$" + ] + } + ], + "compileGroups": null, + "backtrace": [ + { + "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ], + "folder": null, + "nameOnDisk": null, + "artifacts": null, + "build": "^.*/Tests/RunCMake/FileAPI/FileAPIExternalBuild$", + "source": "^.*/Tests/RunCMake/FileAPIExternalSource$", + "install": null, + "link": null, + "archive": null, + "dependencies": null +} diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/zero_check_imported.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/zero_check_imported.json new file mode 100644 index 0000000..7534c84 --- /dev/null +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/zero_check_imported.json @@ -0,0 +1,70 @@ +{ + "name": "ZERO_CHECK", + "id": "^ZERO_CHECK::@ba7eb709d0b48779c6c8$", + "directorySource": "^imported$", + "projectName": "Imported", + "type": "UTILITY", + "isGeneratorProvided": true, + "sources": [ + { + "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/imported/CMakeFiles/ZERO_CHECK$", + "isGenerated": true, + "sourceGroupName": "", + "compileGroupLanguage": null, + "backtrace": [ + { + "file": "^imported/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ] + }, + { + "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/imported/CMakeFiles/ZERO_CHECK\\.rule$", + "isGenerated": true, + "sourceGroupName": "CMake Rules", + "compileGroupLanguage": null, + "backtrace": [ + { + "file": "^imported/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ] + } + ], + "sourceGroups": [ + { + "name": "", + "sourcePaths": [ + "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/imported/CMakeFiles/ZERO_CHECK$" + ] + }, + { + "name": "CMake Rules", + "sourcePaths": [ + "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/imported/CMakeFiles/ZERO_CHECK\\.rule$" + ] + } + ], + "compileGroups": null, + "backtrace": [ + { + "file": "^imported/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ], + "folder": null, + "nameOnDisk": null, + "artifacts": null, + "build": "^imported$", + "source": "^imported$", + "install": null, + "link": null, + "archive": null, + "dependencies": null +} diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/zero_check_object.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/zero_check_object.json new file mode 100644 index 0000000..bcd7616 --- /dev/null +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/zero_check_object.json @@ -0,0 +1,70 @@ +{ + "name": "ZERO_CHECK", + "id": "^ZERO_CHECK::@5ed5358f70faf8d8af7a$", + "directorySource": "^object$", + "projectName": "Object", + "type": "UTILITY", + "isGeneratorProvided": true, + "sources": [ + { + "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/object/CMakeFiles/ZERO_CHECK$", + "isGenerated": true, + "sourceGroupName": "", + "compileGroupLanguage": null, + "backtrace": [ + { + "file": "^object/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ] + }, + { + "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/object/CMakeFiles/ZERO_CHECK\\.rule$", + "isGenerated": true, + "sourceGroupName": "CMake Rules", + "compileGroupLanguage": null, + "backtrace": [ + { + "file": "^object/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ] + } + ], + "sourceGroups": [ + { + "name": "", + "sourcePaths": [ + "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/object/CMakeFiles/ZERO_CHECK$" + ] + }, + { + "name": "CMake Rules", + "sourcePaths": [ + "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/object/CMakeFiles/ZERO_CHECK\\.rule$" + ] + } + ], + "compileGroups": null, + "backtrace": [ + { + "file": "^object/CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ], + "folder": null, + "nameOnDisk": null, + "artifacts": null, + "build": "^object$", + "source": "^object$", + "install": null, + "link": null, + "archive": null, + "dependencies": null +} diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/zero_check_top.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/zero_check_top.json new file mode 100644 index 0000000..b3030bd --- /dev/null +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/zero_check_top.json @@ -0,0 +1,70 @@ +{ + "name": "ZERO_CHECK", + "id": "^ZERO_CHECK::@6890427a1f51a3e7e1df$", + "directorySource": "^\\.$", + "projectName": "codemodel-v2", + "type": "UTILITY", + "isGeneratorProvided": true, + "sources": [ + { + "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/CMakeFiles/ZERO_CHECK$", + "isGenerated": true, + "sourceGroupName": "", + "compileGroupLanguage": null, + "backtrace": [ + { + "file": "^CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ] + }, + { + "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/CMakeFiles/ZERO_CHECK\\.rule$", + "isGenerated": true, + "sourceGroupName": "CMake Rules", + "compileGroupLanguage": null, + "backtrace": [ + { + "file": "^CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ] + } + ], + "sourceGroups": [ + { + "name": "", + "sourcePaths": [ + "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/CMakeFiles/ZERO_CHECK$" + ] + }, + { + "name": "CMake Rules", + "sourcePaths": [ + "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/CMakeFiles/ZERO_CHECK\\.rule$" + ] + } + ], + "compileGroups": null, + "backtrace": [ + { + "file": "^CMakeLists\\.txt$", + "line": null, + "command": null, + "hasParent": false + } + ], + "folder": null, + "nameOnDisk": null, + "artifacts": null, + "build": "^\\.$", + "source": "^\\.$", + "install": null, + "link": null, + "archive": null, + "dependencies": null +} diff --git a/Tests/RunCMake/File_Archive/7zip.cmake b/Tests/RunCMake/File_Archive/7zip.cmake new file mode 100644 index 0000000..7b0b9b7 --- /dev/null +++ b/Tests/RunCMake/File_Archive/7zip.cmake @@ -0,0 +1,7 @@ +set(OUTPUT_NAME "test.7z") + +set(COMPRESSION_FORMAT 7zip) + +include(${CMAKE_CURRENT_LIST_DIR}/roundtrip.cmake) + +check_magic("377abcaf271c" LIMIT 6 HEX) diff --git a/Tests/RunCMake/File_Archive/CMakeLists.txt b/Tests/RunCMake/File_Archive/CMakeLists.txt new file mode 100644 index 0000000..2897109 --- /dev/null +++ b/Tests/RunCMake/File_Archive/CMakeLists.txt @@ -0,0 +1,3 @@ +cmake_minimum_required(VERSION 3.0) +project(${RunCMake_TEST} NONE) +include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/File_Archive/RunCMakeTest.cmake b/Tests/RunCMake/File_Archive/RunCMakeTest.cmake new file mode 100644 index 0000000..871cb6d --- /dev/null +++ b/Tests/RunCMake/File_Archive/RunCMakeTest.cmake @@ -0,0 +1,17 @@ +include(RunCMake) + +run_cmake(7zip) +run_cmake(gnutar) +run_cmake(gnutar-gz) +run_cmake(pax) +run_cmake(pax-xz) +run_cmake(pax-zstd) +run_cmake(paxr) +run_cmake(paxr-bz2) +run_cmake(zip) + +# Extracting only selected files or directories +run_cmake(zip-filtered) + +run_cmake(unsupported-format) +run_cmake(zip-with-bad-type) diff --git a/Tests/RunCMake/File_Archive/gnutar-gz.cmake b/Tests/RunCMake/File_Archive/gnutar-gz.cmake new file mode 100644 index 0000000..f4e3975 --- /dev/null +++ b/Tests/RunCMake/File_Archive/gnutar-gz.cmake @@ -0,0 +1,8 @@ +set(OUTPUT_NAME "test.tar.gz") + +set(COMPRESSION_FORMAT gnutar) +set(COMPRESSION_TYPE GZip) + +include(${CMAKE_CURRENT_LIST_DIR}/roundtrip.cmake) + +check_magic("1f8b" LIMIT 2 HEX) diff --git a/Tests/RunCMake/File_Archive/gnutar.cmake b/Tests/RunCMake/File_Archive/gnutar.cmake new file mode 100644 index 0000000..e5cbd35 --- /dev/null +++ b/Tests/RunCMake/File_Archive/gnutar.cmake @@ -0,0 +1,7 @@ +set(OUTPUT_NAME "test.tar") + +set(COMPRESSION_FORMAT gnutar) + +include(${CMAKE_CURRENT_LIST_DIR}/roundtrip.cmake) + +check_magic("7573746172202000" OFFSET 257 LIMIT 8 HEX) diff --git a/Tests/RunCMake/File_Archive/pax-xz.cmake b/Tests/RunCMake/File_Archive/pax-xz.cmake new file mode 100644 index 0000000..47fb0fd --- /dev/null +++ b/Tests/RunCMake/File_Archive/pax-xz.cmake @@ -0,0 +1,8 @@ +set(OUTPUT_NAME "test.tar.xz") + +set(COMPRESSION_FORMAT pax) +set(COMPRESSION_TYPE XZ) + +include(${CMAKE_CURRENT_LIST_DIR}/roundtrip.cmake) + +check_magic("fd377a585a00" LIMIT 6 HEX) diff --git a/Tests/RunCMake/File_Archive/pax-zstd.cmake b/Tests/RunCMake/File_Archive/pax-zstd.cmake new file mode 100644 index 0000000..59e0443 --- /dev/null +++ b/Tests/RunCMake/File_Archive/pax-zstd.cmake @@ -0,0 +1,8 @@ +set(OUTPUT_NAME "test.tar.zstd") + +set(COMPRESSION_FORMAT pax) +set(COMPRESSION_TYPE Zstd) + +include(${CMAKE_CURRENT_LIST_DIR}/roundtrip.cmake) + +check_magic("28b52ffd0058" LIMIT 6 HEX) diff --git a/Tests/RunCMake/File_Archive/pax.cmake b/Tests/RunCMake/File_Archive/pax.cmake new file mode 100644 index 0000000..e50c74f --- /dev/null +++ b/Tests/RunCMake/File_Archive/pax.cmake @@ -0,0 +1,7 @@ +set(OUTPUT_NAME "test.tar") + +set(COMPRESSION_FORMAT pax) + +include(${CMAKE_CURRENT_LIST_DIR}/roundtrip.cmake) + +check_magic("7573746172003030" OFFSET 257 LIMIT 8 HEX) diff --git a/Tests/RunCMake/File_Archive/paxr-bz2.cmake b/Tests/RunCMake/File_Archive/paxr-bz2.cmake new file mode 100644 index 0000000..469a131 --- /dev/null +++ b/Tests/RunCMake/File_Archive/paxr-bz2.cmake @@ -0,0 +1,8 @@ +set(OUTPUT_NAME "test.tar.bz2") + +set(COMPRESSION_FORMAT paxr) +set(COMPRESSION_TYPE BZip2) + +include(${CMAKE_CURRENT_LIST_DIR}/roundtrip.cmake) + +check_magic("425a68" LIMIT 3 HEX) diff --git a/Tests/RunCMake/File_Archive/paxr.cmake b/Tests/RunCMake/File_Archive/paxr.cmake new file mode 100644 index 0000000..e3a4d5c --- /dev/null +++ b/Tests/RunCMake/File_Archive/paxr.cmake @@ -0,0 +1,7 @@ +set(OUTPUT_NAME "test.tar") + +set(COMPRESSION_FORMAT paxr) + +include(${CMAKE_CURRENT_LIST_DIR}/roundtrip.cmake) + +check_magic("7573746172003030" OFFSET 257 LIMIT 8 HEX) diff --git a/Tests/RunCMake/File_Archive/roundtrip.cmake b/Tests/RunCMake/File_Archive/roundtrip.cmake new file mode 100644 index 0000000..9050400 --- /dev/null +++ b/Tests/RunCMake/File_Archive/roundtrip.cmake @@ -0,0 +1,92 @@ +foreach(parameter OUTPUT_NAME COMPRESSION_FORMAT) + if(NOT DEFINED ${parameter}) + message(FATAL_ERROR "missing required parameter ${parameter}") + endif() +endforeach() + +set(COMPRESS_DIR compress_dir) +set(FULL_COMPRESS_DIR ${CMAKE_CURRENT_BINARY_DIR}/${COMPRESS_DIR}) + +set(DECOMPRESS_DIR decompress_dir) +set(FULL_DECOMPRESS_DIR ${CMAKE_CURRENT_BINARY_DIR}/${DECOMPRESS_DIR}) + +set(FULL_OUTPUT_NAME ${CMAKE_CURRENT_BINARY_DIR}/${OUTPUT_NAME}) + +set(CHECK_FILES + "f1.txt" + "d1/f1.txt" + "d 2/f1.txt" + "d + 3/f1.txt" + "d_4/f1.txt" + "d-4/f1.txt" + "My Special Directory/f1.txt" +) + +foreach(file ${CHECK_FILES}) + configure_file(${CMAKE_CURRENT_LIST_FILE} ${FULL_COMPRESS_DIR}/${file} COPYONLY) +endforeach() + +if(UNIX) + execute_process(COMMAND ln -sf f1.txt ${FULL_COMPRESS_DIR}/d1/f2.txt) + list(APPEND CHECK_FILES "d1/f2.txt") +endif() + +file(REMOVE ${FULL_OUTPUT_NAME}) +file(REMOVE_RECURSE ${FULL_DECOMPRESS_DIR}) +file(MAKE_DIRECTORY ${FULL_DECOMPRESS_DIR}) + +file(ARCHIVE_CREATE + OUTPUT ${FULL_OUTPUT_NAME} + FORMAT "${COMPRESSION_FORMAT}" + TYPE "${COMPRESSION_TYPE}" + VERBOSE + DIRECTORY ${COMPRESS_DIR}) + +file(ARCHIVE_EXTRACT + INPUT ${FULL_OUTPUT_NAME} + ${DECOMPRESSION_OPTIONS} + DESTINATION ${FULL_DECOMPRESS_DIR} + VERBOSE) + +if(CUSTOM_CHECK_FILES) + set(CHECK_FILES ${CUSTOM_CHECK_FILES}) +endif() + +foreach(file ${CHECK_FILES}) + set(input ${FULL_COMPRESS_DIR}/${file}) + set(output ${FULL_DECOMPRESS_DIR}/${COMPRESS_DIR}/${file}) + + if(NOT EXISTS ${input}) + message(SEND_ERROR "Cannot find input file ${output}") + endif() + + if(NOT EXISTS ${output}) + message(SEND_ERROR "Cannot find output file ${output}") + endif() + + file(MD5 ${input} input_md5) + file(MD5 ${output} output_md5) + + if(NOT input_md5 STREQUAL output_md5) + message(SEND_ERROR "Files \"${input}\" and \"${output}\" are different") + endif() +endforeach() + +foreach(file ${NOT_EXISTING_FILES_CHECK}) + set(output ${FULL_DECOMPRESS_DIR}/${COMPRESS_DIR}/${file}) + + if(EXISTS ${output}) + message(SEND_ERROR "File ${output} exists but it shouldn't") + endif() +endforeach() + +function(check_magic EXPECTED) + file(READ ${FULL_OUTPUT_NAME} ACTUAL + ${ARGN} + ) + + if(NOT ACTUAL STREQUAL EXPECTED) + message(FATAL_ERROR + "Actual [${ACTUAL}] does not match expected [${EXPECTED}]") + endif() +endfunction() diff --git a/Tests/RunCMake/File_Archive/unsupported-format-result.txt b/Tests/RunCMake/File_Archive/unsupported-format-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/File_Archive/unsupported-format-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/File_Archive/unsupported-format-stderr.txt b/Tests/RunCMake/File_Archive/unsupported-format-stderr.txt new file mode 100644 index 0000000..4328022 --- /dev/null +++ b/Tests/RunCMake/File_Archive/unsupported-format-stderr.txt @@ -0,0 +1,5 @@ +CMake Error at roundtrip.cmake:38 \(file\): + file archive format rar not supported +Call Stack \(most recent call first\): + unsupported-format.cmake:5 \(include\) + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/File_Archive/unsupported-format.cmake b/Tests/RunCMake/File_Archive/unsupported-format.cmake new file mode 100644 index 0000000..61edc1b --- /dev/null +++ b/Tests/RunCMake/File_Archive/unsupported-format.cmake @@ -0,0 +1,5 @@ +set(OUTPUT_NAME "test.rar") + +set(COMPRESSION_FORMAT rar) + +include(${CMAKE_CURRENT_LIST_DIR}/roundtrip.cmake) diff --git a/Tests/RunCMake/File_Archive/zip-filtered.cmake b/Tests/RunCMake/File_Archive/zip-filtered.cmake new file mode 100644 index 0000000..2d259bc --- /dev/null +++ b/Tests/RunCMake/File_Archive/zip-filtered.cmake @@ -0,0 +1,26 @@ +set(OUTPUT_NAME "test.zip") + +set(COMPRESSION_FORMAT zip) + +set(DECOMPRESSION_OPTIONS + FILES + compress_dir/f1.txt # Decompress only file + compress_dir/d1 # and whole directory +) + +set(CUSTOM_CHECK_FILES + "f1.txt" + "d1/f1.txt" +) + +# This files shouldn't exists +set(NOT_EXISTING_FILES_CHECK + "d 2/f1.txt" + "d + 3/f1.txt" + "d_4/f1.txt" + "d-4/f1.txt" +) + +include(${CMAKE_CURRENT_LIST_DIR}/roundtrip.cmake) + +check_magic("504b0304" LIMIT 4 HEX) diff --git a/Tests/RunCMake/File_Archive/zip-with-bad-type-result.txt b/Tests/RunCMake/File_Archive/zip-with-bad-type-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/File_Archive/zip-with-bad-type-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/File_Archive/zip-with-bad-type-stderr.txt b/Tests/RunCMake/File_Archive/zip-with-bad-type-stderr.txt new file mode 100644 index 0000000..fe12feb --- /dev/null +++ b/Tests/RunCMake/File_Archive/zip-with-bad-type-stderr.txt @@ -0,0 +1,5 @@ +CMake Error at roundtrip.cmake:38 \(file\): + file archive format zip does not support TYPE arguments +Call Stack \(most recent call first\): + zip-with-bad-type.cmake:6 \(include\) + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/File_Archive/zip-with-bad-type.cmake b/Tests/RunCMake/File_Archive/zip-with-bad-type.cmake new file mode 100644 index 0000000..ebb97a3 --- /dev/null +++ b/Tests/RunCMake/File_Archive/zip-with-bad-type.cmake @@ -0,0 +1,6 @@ +set(OUTPUT_NAME "test.zip") + +set(COMPRESSION_FORMAT zip) +set(COMPRESSION_TYPE BZip2) + +include(${CMAKE_CURRENT_LIST_DIR}/roundtrip.cmake) diff --git a/Tests/RunCMake/File_Archive/zip.cmake b/Tests/RunCMake/File_Archive/zip.cmake new file mode 100644 index 0000000..1b93058 --- /dev/null +++ b/Tests/RunCMake/File_Archive/zip.cmake @@ -0,0 +1,7 @@ +set(OUTPUT_NAME "test.zip") + +set(COMPRESSION_FORMAT zip) + +include(${CMAKE_CURRENT_LIST_DIR}/roundtrip.cmake) + +check_magic("504b0304" LIMIT 4 HEX) diff --git a/Tests/RunCMake/File_Configure/BadArg-result.txt b/Tests/RunCMake/File_Configure/BadArg-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/File_Configure/BadArg-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/File_Configure/BadArg-stderr.txt b/Tests/RunCMake/File_Configure/BadArg-stderr.txt new file mode 100644 index 0000000..5423a28 --- /dev/null +++ b/Tests/RunCMake/File_Configure/BadArg-stderr.txt @@ -0,0 +1,4 @@ +CMake Error at BadArg.cmake:[0-9]+ \(file\): + file Incorrect arguments to CONFIGURE subcommand. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/File_Configure/BadArg.cmake b/Tests/RunCMake/File_Configure/BadArg.cmake new file mode 100644 index 0000000..7c7fcda --- /dev/null +++ b/Tests/RunCMake/File_Configure/BadArg.cmake @@ -0,0 +1 @@ +file(CONFIGURE OUTPUT) diff --git a/Tests/RunCMake/File_Configure/BadArgGeneratorExpressionContent-result.txt b/Tests/RunCMake/File_Configure/BadArgGeneratorExpressionContent-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/File_Configure/BadArgGeneratorExpressionContent-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/File_Configure/BadArgGeneratorExpressionContent-stderr.txt b/Tests/RunCMake/File_Configure/BadArgGeneratorExpressionContent-stderr.txt new file mode 100644 index 0000000..acda654 --- /dev/null +++ b/Tests/RunCMake/File_Configure/BadArgGeneratorExpressionContent-stderr.txt @@ -0,0 +1,5 @@ +CMake Error at BadArgGeneratorExpressionContent.cmake:[0-9]+ \(file\): + file CONFIGURE called with CONTENT containing a "<". This character is not + allowed. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/File_Configure/BadArgGeneratorExpressionContent.cmake b/Tests/RunCMake/File_Configure/BadArgGeneratorExpressionContent.cmake new file mode 100644 index 0000000..75fe9e5 --- /dev/null +++ b/Tests/RunCMake/File_Configure/BadArgGeneratorExpressionContent.cmake @@ -0,0 +1,4 @@ +file(CONFIGURE + OUTPUT "file.txt" + CONTENT "foo-$<CONFIG>" +) diff --git a/Tests/RunCMake/File_Configure/BadArgGeneratorExpressionOutput-result.txt b/Tests/RunCMake/File_Configure/BadArgGeneratorExpressionOutput-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/File_Configure/BadArgGeneratorExpressionOutput-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/File_Configure/BadArgGeneratorExpressionOutput-stderr.txt b/Tests/RunCMake/File_Configure/BadArgGeneratorExpressionOutput-stderr.txt new file mode 100644 index 0000000..329d956 --- /dev/null +++ b/Tests/RunCMake/File_Configure/BadArgGeneratorExpressionOutput-stderr.txt @@ -0,0 +1,5 @@ +CMake Error at BadArgGeneratorExpressionOutput.cmake:[0-9]+ \(file\): + file CONFIGURE called with OUTPUT containing a "<". This character is not + allowed. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/File_Configure/BadArgGeneratorExpressionOutput.cmake b/Tests/RunCMake/File_Configure/BadArgGeneratorExpressionOutput.cmake new file mode 100644 index 0000000..31a79a7 --- /dev/null +++ b/Tests/RunCMake/File_Configure/BadArgGeneratorExpressionOutput.cmake @@ -0,0 +1,4 @@ +file(CONFIGURE + OUTPUT "file-$<CONFIG>.txt" + CONTENT "foo" +) diff --git a/Tests/RunCMake/File_Configure/CMakeLists.txt b/Tests/RunCMake/File_Configure/CMakeLists.txt new file mode 100644 index 0000000..b7117bd --- /dev/null +++ b/Tests/RunCMake/File_Configure/CMakeLists.txt @@ -0,0 +1,3 @@ +cmake_minimum_required(VERSION 3.17) +project(${RunCMake_TEST} NONE) +include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/File_Configure/DirOutput-stderr.txt b/Tests/RunCMake/File_Configure/DirOutput-stderr.txt new file mode 100644 index 0000000..d051f7c --- /dev/null +++ b/Tests/RunCMake/File_Configure/DirOutput-stderr.txt @@ -0,0 +1 @@ +^DirOutput test file$ diff --git a/Tests/RunCMake/File_Configure/DirOutput.cmake b/Tests/RunCMake/File_Configure/DirOutput.cmake new file mode 100644 index 0000000..aa0fadf --- /dev/null +++ b/Tests/RunCMake/File_Configure/DirOutput.cmake @@ -0,0 +1,4 @@ +file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/DirOutput) +configure_file(DirOutput.txt DirOutput) +file(READ ${CMAKE_CURRENT_BINARY_DIR}/DirOutput/DirOutput.txt out) +message("${out}") diff --git a/Tests/RunCMake/File_Configure/DirOutput.txt b/Tests/RunCMake/File_Configure/DirOutput.txt new file mode 100644 index 0000000..16388a6 --- /dev/null +++ b/Tests/RunCMake/File_Configure/DirOutput.txt @@ -0,0 +1 @@ +DirOutput test file diff --git a/Tests/RunCMake/File_Configure/NewLineStyle-NoArg-result.txt b/Tests/RunCMake/File_Configure/NewLineStyle-NoArg-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/File_Configure/NewLineStyle-NoArg-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/File_Configure/NewLineStyle-NoArg-stderr.txt b/Tests/RunCMake/File_Configure/NewLineStyle-NoArg-stderr.txt new file mode 100644 index 0000000..5a8ed2c --- /dev/null +++ b/Tests/RunCMake/File_Configure/NewLineStyle-NoArg-stderr.txt @@ -0,0 +1,5 @@ +CMake Error at NewLineStyle-NoArg.cmake:[0-9]+ \(file\): + file CONFIGURE NEWLINE_STYLE must set a style: LF, CRLF, UNIX, DOS, or + WIN32 +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/File_Configure/NewLineStyle-NoArg.cmake b/Tests/RunCMake/File_Configure/NewLineStyle-NoArg.cmake new file mode 100644 index 0000000..d6738b4 --- /dev/null +++ b/Tests/RunCMake/File_Configure/NewLineStyle-NoArg.cmake @@ -0,0 +1,6 @@ +set(file_name ${CMAKE_CURRENT_BINARY_DIR}/NewLineStyle.txt) +file(CONFIGURE + OUTPUT ${file_name} + CONTENT "Data\n" + NEWLINE_STYLE +) diff --git a/Tests/RunCMake/File_Configure/NewLineStyle-ValidArg.cmake b/Tests/RunCMake/File_Configure/NewLineStyle-ValidArg.cmake new file mode 100644 index 0000000..e384873 --- /dev/null +++ b/Tests/RunCMake/File_Configure/NewLineStyle-ValidArg.cmake @@ -0,0 +1,20 @@ +set(file_name ${CMAKE_CURRENT_BINARY_DIR}/NewLineStyle.txt) + +function(test_eol style in out) + file(CONFIGURE + OUTPUT ${file_name} + CONTENT "@in@" + NEWLINE_STYLE ${style} + ) + file(READ ${file_name} new HEX) + if(NOT "${new}" STREQUAL "${out}") + message(FATAL_ERROR "No ${style} line endings") + endif() +endfunction() + +test_eol(DOS "a" "610d0a") +test_eol(WIN32 "b" "620d0a") +test_eol(CRLF "c" "630d0a") + +test_eol(UNIX "d" "640a") +test_eol(LF "e" "650a") diff --git a/Tests/RunCMake/File_Configure/NewLineStyle-WrongArg-result.txt b/Tests/RunCMake/File_Configure/NewLineStyle-WrongArg-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/File_Configure/NewLineStyle-WrongArg-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/File_Configure/NewLineStyle-WrongArg-stderr.txt b/Tests/RunCMake/File_Configure/NewLineStyle-WrongArg-stderr.txt new file mode 100644 index 0000000..c1bb42c --- /dev/null +++ b/Tests/RunCMake/File_Configure/NewLineStyle-WrongArg-stderr.txt @@ -0,0 +1,5 @@ +CMake Error at NewLineStyle-WrongArg.cmake:[0-9]+ \(file\): + file CONFIGURE NEWLINE_STYLE sets an unknown style, only LF, CRLF, UNIX, + DOS, and WIN32 are supported +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/File_Configure/NewLineStyle-WrongArg.cmake b/Tests/RunCMake/File_Configure/NewLineStyle-WrongArg.cmake new file mode 100644 index 0000000..7d38167 --- /dev/null +++ b/Tests/RunCMake/File_Configure/NewLineStyle-WrongArg.cmake @@ -0,0 +1,6 @@ +set(file_name ${CMAKE_CURRENT_BINARY_DIR}/NewLineStyle.txt) +file(CONFIGURE + OUTPUT ${file_name} + CONTENT "Data\n" + NEWLINE_STYLE FOO +) diff --git a/Tests/RunCMake/File_Configure/RunCMakeTest.cmake b/Tests/RunCMake/File_Configure/RunCMakeTest.cmake new file mode 100644 index 0000000..d09d648 --- /dev/null +++ b/Tests/RunCMake/File_Configure/RunCMakeTest.cmake @@ -0,0 +1,9 @@ +include(RunCMake) + +run_cmake(BadArg) +run_cmake(BadArgGeneratorExpressionContent) +run_cmake(BadArgGeneratorExpressionOutput) +run_cmake(DirOutput) +run_cmake(NewLineStyle-NoArg) +run_cmake(NewLineStyle-ValidArg) +run_cmake(NewLineStyle-WrongArg) diff --git a/Tests/RunCMake/File_Generate/CMP0070-OLD-stderr.txt b/Tests/RunCMake/File_Generate/CMP0070-OLD-stderr.txt new file mode 100644 index 0000000..bb578e5 --- /dev/null +++ b/Tests/RunCMake/File_Generate/CMP0070-OLD-stderr.txt @@ -0,0 +1,10 @@ +^CMake Deprecation Warning at CMP0070-OLD.cmake:[0-9]+ \(cmake_policy\): + The OLD behavior for policy CMP0070 will be removed from a future version + of CMake. + + The cmake-policies\(7\) manual explains that the OLD behaviors of all + policies are deprecated and that a policy should be set to OLD only under + specific short-term circumstances. Projects should be ported to the NEW + behavior and not rely on setting a policy to OLD. +Call Stack \(most recent call first\): + CMakeLists.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/FindSWIG/CMakeLists.txt b/Tests/RunCMake/FindSWIG/CMakeLists.txt new file mode 100644 index 0000000..d1b0d2c --- /dev/null +++ b/Tests/RunCMake/FindSWIG/CMakeLists.txt @@ -0,0 +1,3 @@ +cmake_minimum_required(VERSION 3.10) +project(${RunCMake_TEST} C) +include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/FindSWIG/RunCMakeTest.cmake b/Tests/RunCMake/FindSWIG/RunCMakeTest.cmake new file mode 100644 index 0000000..5f5f7f5 --- /dev/null +++ b/Tests/RunCMake/FindSWIG/RunCMakeTest.cmake @@ -0,0 +1,4 @@ +include(RunCMake) + +run_cmake(components) +run_cmake(missing-components) diff --git a/Tests/RunCMake/FindSWIG/components-stdout.txt b/Tests/RunCMake/FindSWIG/components-stdout.txt new file mode 100644 index 0000000..3977b08 --- /dev/null +++ b/Tests/RunCMake/FindSWIG/components-stdout.txt @@ -0,0 +1,6 @@ +-- Found SWIG: [^ ]+ \(found version "[0-9.]+"\) found components: java python missing components: PERL +-- SWIG_VERSION='[0-9.]+' +-- SWIG_java_FOUND=TRUE +-- SWIG_python_FOUND=TRUE +-- SWIG_PERL_FOUND= +-- Configuring done diff --git a/Tests/RunCMake/FindSWIG/components.cmake b/Tests/RunCMake/FindSWIG/components.cmake new file mode 100644 index 0000000..b79a81e --- /dev/null +++ b/Tests/RunCMake/FindSWIG/components.cmake @@ -0,0 +1,9 @@ +# Note that 'perl' will not be found because it is not lowercase. +find_package(SWIG REQUIRED + COMPONENTS java + OPTIONAL_COMPONENTS python PERL) + +message(STATUS "SWIG_VERSION='${SWIG_VERSION}'") +foreach(_lang java python PERL) + message(STATUS "SWIG_${_lang}_FOUND=${SWIG_${_lang}_FOUND}") +endforeach() diff --git a/Tests/RunCMake/FindSWIG/missing-components-result.txt b/Tests/RunCMake/FindSWIG/missing-components-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/FindSWIG/missing-components-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/FindSWIG/missing-components-stderr.txt b/Tests/RunCMake/FindSWIG/missing-components-stderr.txt new file mode 100644 index 0000000..c937532 --- /dev/null +++ b/Tests/RunCMake/FindSWIG/missing-components-stderr.txt @@ -0,0 +1 @@ +Could NOT find SWIG \(missing: invalid\) diff --git a/Tests/RunCMake/FindSWIG/missing-components.cmake b/Tests/RunCMake/FindSWIG/missing-components.cmake new file mode 100644 index 0000000..1d05ae4 --- /dev/null +++ b/Tests/RunCMake/FindSWIG/missing-components.cmake @@ -0,0 +1,3 @@ +find_package(SWIG REQUIRED + COMPONENTS invalid + OPTIONAL_COMPONENTS alsoinvalid) diff --git a/Tests/RunCMake/Framework/FrameworkMultiConfigPostfix-build-final-check.cmake b/Tests/RunCMake/Framework/FrameworkMultiConfigPostfix-build-final-check.cmake new file mode 100644 index 0000000..76fe6b8 --- /dev/null +++ b/Tests/RunCMake/Framework/FrameworkMultiConfigPostfix-build-final-check.cmake @@ -0,0 +1,45 @@ +include("${RunCMake_TEST_BINARY_DIR}/FrameworkMultiConfigPostfixInfo.cmake") + +get_filename_component(framework_location "${framework_dir}" DIRECTORY) +set(non_existent_debug_framework_dir "${framework_location}/${target_file_name}_debug.framework") +set(framework_resources "${framework_dir}/Resources") +set(plist_file "${framework_resources}/Info.plist") + +set(symlink_release_path "${framework_dir}/${target_file_name}") +set(framework_release_path "${framework_dir}/Versions/A/${target_file_name}") + +# When using a multi config generator (like Ninja Multi-Config and Xcode), +# the postfix will be applied to the debug framework library name and the symlink name. +# For single config generators, the name stays the same as the the release framework. +if(is_multi_config) + set(symlink_debug_path "${framework_dir}/${target_file_name}_debug") + set(framework_debug_path "${framework_dir}/Versions/A/${target_file_name}_debug") +else() + set(symlink_debug_path "${framework_dir}/${target_file_name}") + set(framework_debug_path "${framework_dir}/Versions/A/${target_file_name}") +endif() + +if(NOT IS_DIRECTORY ${framework_dir}) + message(SEND_ERROR "Framework dir not found at ${framework_dir}") +endif() + +if(IS_DIRECTORY ${non_existent_debug_framework_dir}) + message(SEND_ERROR + "A framework dir with a debug suffix should not exist at ${non_existent_debug_framework_dir}") +endif() + +if(NOT IS_SYMLINK "${symlink_release_path}") + message(SEND_ERROR "Release framework symlink not found at ${symlink_release_path}") +endif() + +if(NOT IS_SYMLINK "${symlink_debug_path}") + message(SEND_ERROR "Debug framework symlink not found at ${symlink_debug_path}") +endif() + +if(NOT EXISTS "${framework_release_path}") + message(SEND_ERROR "Release framework not found at ${framework_release_path}") +endif() + +if(NOT EXISTS "${framework_debug_path}") + message(SEND_ERROR "Debug framework not found at ${framework_debug_path}") +endif() diff --git a/Tests/RunCMake/Framework/FrameworkMultiConfigPostfix.cmake b/Tests/RunCMake/Framework/FrameworkMultiConfigPostfix.cmake new file mode 100644 index 0000000..51e627d --- /dev/null +++ b/Tests/RunCMake/Framework/FrameworkMultiConfigPostfix.cmake @@ -0,0 +1,25 @@ +enable_language(C) + +set(CMAKE_FRAMEWORK_MULTI_CONFIG_POSTFIX_DEBUG "_debug") + +set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/lib) +set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_DEBUG ${CMAKE_CURRENT_BINARY_DIR}/lib) +set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE ${CMAKE_CURRENT_BINARY_DIR}/lib) +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin) +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_CURRENT_BINARY_DIR}/bin) +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_CURRENT_BINARY_DIR}/bin) +set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/lib) +set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG ${CMAKE_CURRENT_BINARY_DIR}/lib) +set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE ${CMAKE_CURRENT_BINARY_DIR}/lib) + +set(target_name "mylib") +add_library(${target_name} SHARED foo.c) +set_property(TARGET ${target_name} PROPERTY FRAMEWORK ON) +get_property(is_multi_config GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) + +string(APPEND content + "set(is_multi_config \"${is_multi_config}\")\n" + "set(framework_dir \"$<TARGET_BUNDLE_DIR:${target_name}>\")\n" + "set(target_file_name ${target_name})\n") +file(GENERATE OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/FrameworkMultiConfigPostfixInfo.cmake + CONTENT "${content}") diff --git a/Tests/RunCMake/Framework/RunCMakeTest.cmake b/Tests/RunCMake/Framework/RunCMakeTest.cmake index 965fbf4..6ee61a3 100644 --- a/Tests/RunCMake/Framework/RunCMakeTest.cmake +++ b/Tests/RunCMake/Framework/RunCMakeTest.cmake @@ -45,3 +45,39 @@ framework_type_test(ios SHARED YES) framework_type_test(ios STATIC YES) framework_type_test(osx SHARED YES) framework_type_test(osx STATIC YES) + +function(framework_multi_config_postfix_test) + set(configure_name "FrameworkMultiConfigPostfix") + set(build_name "${configure_name}-build-intermediate") + set(build_name_final "${configure_name}-build-final") + + if(RunCMake_GENERATOR MATCHES "Ninja Multi-Config") + set(RunCMake_TEST_OPTIONS + "-DCMAKE_CONFIGURATION_TYPES=Debug\\;Release;-DCMAKE_CROSS_CONFIGS=all") + elseif(RunCMake_GENERATOR MATCHES "Xcode") + set(RunCMake_TEST_OPTIONS + "-DCMAKE_CONFIGURATION_TYPES=Debug\\;Release") + else() + set(RunCMake_TEST_OPTIONS "-DCMAKE_BUILD_TYPE=Debug") + endif() + + set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/${configure_name}) + set(RunCMake_TEST_NO_CLEAN 1) + + file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}") + file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}") + run_cmake(${configure_name}) + unset(RunCMake_TEST_OPTIONS) + + if(RunCMake_GENERATOR MATCHES "Ninja Multi-Config") + run_cmake_command(${build_name_final} ${CMAKE_COMMAND} --build . --target all:all) + elseif(RunCMake_GENERATOR MATCHES "Xcode") + run_cmake_command(${build_name} ${CMAKE_COMMAND} --build . --config Release) + run_cmake_command(${build_name} ${CMAKE_COMMAND} --build . --config Debug) + run_cmake_command(${build_name_final} ${CMAKE_COMMAND} --build . --config Debug) + else() + run_cmake_command(${build_name_final} ${CMAKE_COMMAND} --build .) + endif() +endfunction() + +framework_multi_config_postfix_test() diff --git a/Tests/RunCMake/GeneratorExpression/LINK_LANGUAGE-add_custom_command-result.txt b/Tests/RunCMake/GeneratorExpression/LINK_LANGUAGE-add_custom_command-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/LINK_LANGUAGE-add_custom_command-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/GeneratorExpression/LINK_LANGUAGE-add_custom_command-stderr.txt b/Tests/RunCMake/GeneratorExpression/LINK_LANGUAGE-add_custom_command-stderr.txt new file mode 100644 index 0000000..0b0d458 --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/LINK_LANGUAGE-add_custom_command-stderr.txt @@ -0,0 +1,9 @@ +CMake Error at LINK_LANGUAGE-add_custom_command.cmake:2 \(add_custom_command\): + Error evaluating generator expression: + + \$<LINK_LANGUAGE> + + \$<LINK_LANGUAGE:...> may only be used with binary targets to specify link + libraries, link directories, link options and link depends. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/GeneratorExpression/LINK_LANGUAGE-add_custom_command.cmake b/Tests/RunCMake/GeneratorExpression/LINK_LANGUAGE-add_custom_command.cmake new file mode 100644 index 0000000..a378c1c --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/LINK_LANGUAGE-add_custom_command.cmake @@ -0,0 +1,4 @@ +add_custom_target(drive) +add_custom_command(TARGET drive PRE_BUILD + COMMAND ${CMAKE_COMMAND} -E echo $<LINK_LANGUAGE> +) diff --git a/Tests/RunCMake/GeneratorExpression/LINK_LANGUAGE-add_custom_target-result.txt b/Tests/RunCMake/GeneratorExpression/LINK_LANGUAGE-add_custom_target-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/LINK_LANGUAGE-add_custom_target-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/GeneratorExpression/LINK_LANGUAGE-add_custom_target-stderr.txt b/Tests/RunCMake/GeneratorExpression/LINK_LANGUAGE-add_custom_target-stderr.txt new file mode 100644 index 0000000..92da634 --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/LINK_LANGUAGE-add_custom_target-stderr.txt @@ -0,0 +1,9 @@ +CMake Error at LINK_LANGUAGE-add_custom_target.cmake:1 \(add_custom_target\): + Error evaluating generator expression: + + \$<LINK_LANGUAGE> + + \$<LINK_LANGUAGE:...> may only be used with binary targets to specify link + libraries, link directories, link options and link depends. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/GeneratorExpression/LINK_LANGUAGE-add_custom_target.cmake b/Tests/RunCMake/GeneratorExpression/LINK_LANGUAGE-add_custom_target.cmake new file mode 100644 index 0000000..60b6c75 --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/LINK_LANGUAGE-add_custom_target.cmake @@ -0,0 +1,3 @@ +add_custom_target(drive + COMMAND ${CMAKE_COMMAND} -E echo $<LINK_LANGUAGE> +) diff --git a/Tests/RunCMake/GeneratorExpression/LINK_LANGUAGE-add_executable-result.txt b/Tests/RunCMake/GeneratorExpression/LINK_LANGUAGE-add_executable-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/LINK_LANGUAGE-add_executable-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/GeneratorExpression/LINK_LANGUAGE-add_executable-stderr.txt b/Tests/RunCMake/GeneratorExpression/LINK_LANGUAGE-add_executable-stderr.txt new file mode 100644 index 0000000..3bdc8e4 --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/LINK_LANGUAGE-add_executable-stderr.txt @@ -0,0 +1,9 @@ +CMake Error at LINK_LANGUAGE-add_executable.cmake:1 \(add_executable\): + Error evaluating generator expression: + + \$<LINK_LANGUAGE> + + \$<LINK_LANGUAGE:...> may only be used with binary targets to specify link + libraries, link directories, link options and link depends. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/GeneratorExpression/LINK_LANGUAGE-add_executable.cmake b/Tests/RunCMake/GeneratorExpression/LINK_LANGUAGE-add_executable.cmake new file mode 100644 index 0000000..2176b39 --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/LINK_LANGUAGE-add_executable.cmake @@ -0,0 +1 @@ +add_executable(empty empty.$<LINK_LANGUAGE>) diff --git a/Tests/RunCMake/GeneratorExpression/LINK_LANGUAGE-add_library-result.txt b/Tests/RunCMake/GeneratorExpression/LINK_LANGUAGE-add_library-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/LINK_LANGUAGE-add_library-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/GeneratorExpression/LINK_LANGUAGE-add_library-stderr.txt b/Tests/RunCMake/GeneratorExpression/LINK_LANGUAGE-add_library-stderr.txt new file mode 100644 index 0000000..1bacdeb --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/LINK_LANGUAGE-add_library-stderr.txt @@ -0,0 +1,9 @@ +CMake Error at LINK_LANGUAGE-add_library.cmake:1 \(add_library\): + Error evaluating generator expression: + + \$<LINK_LANGUAGE> + + \$<LINK_LANGUAGE:...> may only be used with binary targets to specify link + libraries, link directories, link options and link depends. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/GeneratorExpression/LINK_LANGUAGE-add_library.cmake b/Tests/RunCMake/GeneratorExpression/LINK_LANGUAGE-add_library.cmake new file mode 100644 index 0000000..253f82a --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/LINK_LANGUAGE-add_library.cmake @@ -0,0 +1 @@ +add_library(empty empty.$<LINK_LANGUAGE>) diff --git a/Tests/RunCMake/GeneratorExpression/LINK_LANGUAGE-add_test-result.txt b/Tests/RunCMake/GeneratorExpression/LINK_LANGUAGE-add_test-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/LINK_LANGUAGE-add_test-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/GeneratorExpression/LINK_LANGUAGE-add_test-stderr.txt b/Tests/RunCMake/GeneratorExpression/LINK_LANGUAGE-add_test-stderr.txt new file mode 100644 index 0000000..f22efde --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/LINK_LANGUAGE-add_test-stderr.txt @@ -0,0 +1,9 @@ +CMake Error at LINK_LANGUAGE-add_test.cmake:5 \(add_test\): + Error evaluating generator expression: + + \$<LINK_LANGUAGE> + + \$<LINK_LANGUAGE:...> may only be used with binary targets to specify link + libraries, link directories, link options and link depends. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/GeneratorExpression/LINK_LANGUAGE-add_test.cmake b/Tests/RunCMake/GeneratorExpression/LINK_LANGUAGE-add_test.cmake new file mode 100644 index 0000000..4fd547d --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/LINK_LANGUAGE-add_test.cmake @@ -0,0 +1,5 @@ + +include(CTest) +enable_testing() + +add_test(NAME dummy COMMAND ${CMAKE_COMMAND} -E echo $<LINK_LANGUAGE>) diff --git a/Tests/RunCMake/GeneratorExpression/LINK_LANGUAGE-file_generate-result.txt b/Tests/RunCMake/GeneratorExpression/LINK_LANGUAGE-file_generate-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/LINK_LANGUAGE-file_generate-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/GeneratorExpression/LINK_LANGUAGE-file_generate-stderr.txt b/Tests/RunCMake/GeneratorExpression/LINK_LANGUAGE-file_generate-stderr.txt new file mode 100644 index 0000000..21d26de --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/LINK_LANGUAGE-file_generate-stderr.txt @@ -0,0 +1,9 @@ +CMake Error at LINK_LANGUAGE-file_generate.cmake:3 \(file\): + Error evaluating generator expression: + + \$<LINK_LANGUAGE> + + \$<LINK_LANGUAGE:...> may only be used with binary targets to specify link + libraries, link directories, link options and link depends. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/GeneratorExpression/LINK_LANGUAGE-file_generate.cmake b/Tests/RunCMake/GeneratorExpression/LINK_LANGUAGE-file_generate.cmake new file mode 100644 index 0000000..519b883 --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/LINK_LANGUAGE-file_generate.cmake @@ -0,0 +1,6 @@ +enable_language(CXX C) + +file(GENERATE + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/output.txt + CONTENT "LANG_IS_$<LINK_LANGUAGE>\n" +) diff --git a/Tests/RunCMake/GeneratorExpression/LINK_LANGUAGE-install-result.txt b/Tests/RunCMake/GeneratorExpression/LINK_LANGUAGE-install-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/LINK_LANGUAGE-install-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/GeneratorExpression/LINK_LANGUAGE-install-stderr.txt b/Tests/RunCMake/GeneratorExpression/LINK_LANGUAGE-install-stderr.txt new file mode 100644 index 0000000..73afc33 --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/LINK_LANGUAGE-install-stderr.txt @@ -0,0 +1,10 @@ +CMake Error: + Error evaluating generator expression: + + \$<LINK_LANGUAGE> + + \$<LINK_LANGUAGE:...> may only be used with binary targets to specify link + libraries, link directories, link options and link depends. + + +CMake Generate step failed. Build files cannot be regenerated correctly. diff --git a/Tests/RunCMake/GeneratorExpression/LINK_LANGUAGE-install.cmake b/Tests/RunCMake/GeneratorExpression/LINK_LANGUAGE-install.cmake new file mode 100644 index 0000000..533c0b4 --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/LINK_LANGUAGE-install.cmake @@ -0,0 +1,5 @@ + +install(FILES + empty.$<LINK_LANGUAGE> + DESTINATION src +) diff --git a/Tests/RunCMake/GeneratorExpression/LINK_LANGUAGE-target_sources-result.txt b/Tests/RunCMake/GeneratorExpression/LINK_LANGUAGE-target_sources-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/LINK_LANGUAGE-target_sources-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/GeneratorExpression/LINK_LANGUAGE-target_sources-stderr.txt b/Tests/RunCMake/GeneratorExpression/LINK_LANGUAGE-target_sources-stderr.txt new file mode 100644 index 0000000..d8121cc --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/LINK_LANGUAGE-target_sources-stderr.txt @@ -0,0 +1,9 @@ +CMake Error at LINK_LANGUAGE-target_sources.cmake:2 \(target_sources\): + Error evaluating generator expression: + + \$<LINK_LANGUAGE> + + \$<LINK_LANGUAGE:...> may only be used with binary targets to specify link + libraries, link directories, link options and link depends. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/GeneratorExpression/LINK_LANGUAGE-target_sources.cmake b/Tests/RunCMake/GeneratorExpression/LINK_LANGUAGE-target_sources.cmake new file mode 100644 index 0000000..c134c01 --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/LINK_LANGUAGE-target_sources.cmake @@ -0,0 +1,2 @@ +add_library(empty) +target_sources(empty PRIVATE empty.$<LINK_LANGUAGE>) diff --git a/Tests/RunCMake/GeneratorExpression/LINK_LANGUAGE-unknown-lang.cmake b/Tests/RunCMake/GeneratorExpression/LINK_LANGUAGE-unknown-lang.cmake new file mode 100644 index 0000000..0ba472d --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/LINK_LANGUAGE-unknown-lang.cmake @@ -0,0 +1,4 @@ + +enable_language(C) +add_executable(empty empty.c) +target_link_options(empty PRIVATE $<$<LINK_LANGUAGE:CXX>:$<TARGET_EXISTS:too,many,parameters>>) diff --git a/Tests/RunCMake/GeneratorExpression/LINK_LANGUAGE-wrong-usage1-result.txt b/Tests/RunCMake/GeneratorExpression/LINK_LANGUAGE-wrong-usage1-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/LINK_LANGUAGE-wrong-usage1-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/GeneratorExpression/LINK_LANGUAGE-wrong-usage1-stderr.txt b/Tests/RunCMake/GeneratorExpression/LINK_LANGUAGE-wrong-usage1-stderr.txt new file mode 100644 index 0000000..1e3a83b --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/LINK_LANGUAGE-wrong-usage1-stderr.txt @@ -0,0 +1,9 @@ +CMake Error at LINK_LANGUAGE-wrong-usage1.cmake:4 \(target_compile_definitions\): + Error evaluating generator expression: + + \$<LINK_LANGUAGE:C> + + \$<LINK_LANGUAGE:...> may only be used with binary targets to specify link + libraries, link directories, link options and link depends. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/GeneratorExpression/LINK_LANGUAGE-wrong-usage1.cmake b/Tests/RunCMake/GeneratorExpression/LINK_LANGUAGE-wrong-usage1.cmake new file mode 100644 index 0000000..90b7ce0 --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/LINK_LANGUAGE-wrong-usage1.cmake @@ -0,0 +1,4 @@ + +enable_language(C) +add_executable(empty empty.c) +target_compile_definitions(empty PRIVATE $<$<LINK_LANGUAGE:C>:DEF>) diff --git a/Tests/RunCMake/GeneratorExpression/LINK_LANGUAGE-wrong-usage2-result.txt b/Tests/RunCMake/GeneratorExpression/LINK_LANGUAGE-wrong-usage2-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/LINK_LANGUAGE-wrong-usage2-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/GeneratorExpression/LINK_LANGUAGE-wrong-usage2-stderr.txt b/Tests/RunCMake/GeneratorExpression/LINK_LANGUAGE-wrong-usage2-stderr.txt new file mode 100644 index 0000000..7fe4310 --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/LINK_LANGUAGE-wrong-usage2-stderr.txt @@ -0,0 +1,9 @@ +CMake Error at LINK_LANGUAGE-wrong-usage2.cmake:4 \(target_compile_options\): + Error evaluating generator expression: + + \$<LINK_LANGUAGE:C> + + \$<LINK_LANGUAGE:...> may only be used with binary targets to specify link + libraries, link directories, link options and link depends. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/GeneratorExpression/LINK_LANGUAGE-wrong-usage2.cmake b/Tests/RunCMake/GeneratorExpression/LINK_LANGUAGE-wrong-usage2.cmake new file mode 100644 index 0000000..e761897 --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/LINK_LANGUAGE-wrong-usage2.cmake @@ -0,0 +1,4 @@ + +enable_language(C) +add_executable(empty empty.c) +target_compile_options(empty PRIVATE $<$<LINK_LANGUAGE:C>:-OPT>) diff --git a/Tests/RunCMake/GeneratorExpression/LINK_LANGUAGE-wrong-usage3-result.txt b/Tests/RunCMake/GeneratorExpression/LINK_LANGUAGE-wrong-usage3-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/LINK_LANGUAGE-wrong-usage3-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/GeneratorExpression/LINK_LANGUAGE-wrong-usage3-stderr.txt b/Tests/RunCMake/GeneratorExpression/LINK_LANGUAGE-wrong-usage3-stderr.txt new file mode 100644 index 0000000..cb20e99 --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/LINK_LANGUAGE-wrong-usage3-stderr.txt @@ -0,0 +1,9 @@ +CMake Error at LINK_LANGUAGE-wrong-usage3.cmake:4 \(target_include_directories\): + Error evaluating generator expression: + + \$<LINK_LANGUAGE:C> + + \$<LINK_LANGUAGE:...> may only be used with binary targets to specify link + libraries, link directories, link options and link depends. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/GeneratorExpression/LINK_LANGUAGE-wrong-usage3.cmake b/Tests/RunCMake/GeneratorExpression/LINK_LANGUAGE-wrong-usage3.cmake new file mode 100644 index 0000000..96a72a1 --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/LINK_LANGUAGE-wrong-usage3.cmake @@ -0,0 +1,4 @@ + +enable_language(C) +add_executable(empty empty.c) +target_include_directories(empty PRIVATE $<$<LINK_LANGUAGE:C>:/DIR>) diff --git a/Tests/RunCMake/GeneratorExpression/LINK_LANGUAGE-wrong-usage4-result.txt b/Tests/RunCMake/GeneratorExpression/LINK_LANGUAGE-wrong-usage4-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/LINK_LANGUAGE-wrong-usage4-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/GeneratorExpression/LINK_LANGUAGE-wrong-usage4-stderr.txt b/Tests/RunCMake/GeneratorExpression/LINK_LANGUAGE-wrong-usage4-stderr.txt new file mode 100644 index 0000000..ee36912 --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/LINK_LANGUAGE-wrong-usage4-stderr.txt @@ -0,0 +1,8 @@ +CMake Error at LINK_LANGUAGE-wrong-usage4.cmake:7 \(target_link_libraries\): + Error evaluating generator expression: + + \$<LINK_LANGUAGE> + + \$<LINK_LANGUAGE> is not supported in link libraries expression. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/GeneratorExpression/LINK_LANGUAGE-wrong-usage4.cmake b/Tests/RunCMake/GeneratorExpression/LINK_LANGUAGE-wrong-usage4.cmake new file mode 100644 index 0000000..3ecaabb --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/LINK_LANGUAGE-wrong-usage4.cmake @@ -0,0 +1,7 @@ + +enable_language(C) + +add_library(libC empty.c) + +add_executable(empty empty.c) +target_link_libraries(empty PRIVATE lib$<LINK_LANGUAGE>) diff --git a/Tests/RunCMake/GeneratorExpression/LINK_LANG_AND_ID-add_custom_command-result.txt b/Tests/RunCMake/GeneratorExpression/LINK_LANG_AND_ID-add_custom_command-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/LINK_LANG_AND_ID-add_custom_command-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/GeneratorExpression/LINK_LANG_AND_ID-add_custom_command-stderr.txt b/Tests/RunCMake/GeneratorExpression/LINK_LANG_AND_ID-add_custom_command-stderr.txt new file mode 100644 index 0000000..2ff62bc --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/LINK_LANG_AND_ID-add_custom_command-stderr.txt @@ -0,0 +1,9 @@ +CMake Error at LINK_LANG_AND_ID-add_custom_command.cmake:2 \(add_custom_command\): + Error evaluating generator expression: + + \$<LINK_LANG_AND_ID:LANG,ID> + + \$<LINK_LANG_AND_ID:lang,id> may only be used with binary targets to specify + link libraries, link directories, link options, and link depends. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/GeneratorExpression/LINK_LANG_AND_ID-add_custom_command.cmake b/Tests/RunCMake/GeneratorExpression/LINK_LANG_AND_ID-add_custom_command.cmake new file mode 100644 index 0000000..9df9232 --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/LINK_LANG_AND_ID-add_custom_command.cmake @@ -0,0 +1,4 @@ +add_custom_target(drive) +add_custom_command(TARGET drive PRE_BUILD + COMMAND ${CMAKE_COMMAND} -E echo $<LINK_LANG_AND_ID:LANG,ID> +) diff --git a/Tests/RunCMake/GeneratorExpression/LINK_LANG_AND_ID-add_custom_target-result.txt b/Tests/RunCMake/GeneratorExpression/LINK_LANG_AND_ID-add_custom_target-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/LINK_LANG_AND_ID-add_custom_target-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/GeneratorExpression/LINK_LANG_AND_ID-add_custom_target-stderr.txt b/Tests/RunCMake/GeneratorExpression/LINK_LANG_AND_ID-add_custom_target-stderr.txt new file mode 100644 index 0000000..0749c44 --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/LINK_LANG_AND_ID-add_custom_target-stderr.txt @@ -0,0 +1,9 @@ +CMake Error at LINK_LANG_AND_ID-add_custom_target.cmake:2 \(add_custom_target\): + Error evaluating generator expression: + + \$<LINK_LANG_AND_ID:LANG,ID> + + \$<LINK_LANG_AND_ID:lang,id> may only be used with binary targets to specify + link libraries, link directories, link options, and link depends. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/GeneratorExpression/LINK_LANG_AND_ID-add_custom_target.cmake b/Tests/RunCMake/GeneratorExpression/LINK_LANG_AND_ID-add_custom_target.cmake new file mode 100644 index 0000000..e5f76bc --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/LINK_LANG_AND_ID-add_custom_target.cmake @@ -0,0 +1,4 @@ + +add_custom_target(drive + COMMAND ${CMAKE_COMMAND} -E echo $<LINK_LANG_AND_ID:LANG,ID> +) diff --git a/Tests/RunCMake/GeneratorExpression/LINK_LANG_AND_ID-add_executable-result.txt b/Tests/RunCMake/GeneratorExpression/LINK_LANG_AND_ID-add_executable-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/LINK_LANG_AND_ID-add_executable-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/GeneratorExpression/LINK_LANG_AND_ID-add_executable-stderr.txt b/Tests/RunCMake/GeneratorExpression/LINK_LANG_AND_ID-add_executable-stderr.txt new file mode 100644 index 0000000..595312a --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/LINK_LANG_AND_ID-add_executable-stderr.txt @@ -0,0 +1,9 @@ +CMake Error at LINK_LANG_AND_ID-add_executable.cmake:1 \(add_executable\): + Error evaluating generator expression: + + \$<LINK_LANG_AND_ID:C,MSVC> + + \$<LINK_LANG_AND_ID:lang,id> may only be used with binary targets to specify + link libraries, link directories, link options, and link depends. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/GeneratorExpression/LINK_LANG_AND_ID-add_executable.cmake b/Tests/RunCMake/GeneratorExpression/LINK_LANG_AND_ID-add_executable.cmake new file mode 100644 index 0000000..4d6c674 --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/LINK_LANG_AND_ID-add_executable.cmake @@ -0,0 +1,5 @@ +add_executable(empty main.c + $<$<LINK_LANG_AND_ID:C,MSVC>:empty.c> + $<$<LINK_LANG_AND_ID:C,GNU>:empty2.c> + $<$<LINK_LANG_AND_ID:C,Clang>:empty3.c> + ) diff --git a/Tests/RunCMake/GeneratorExpression/LINK_LANG_AND_ID-add_library-result.txt b/Tests/RunCMake/GeneratorExpression/LINK_LANG_AND_ID-add_library-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/LINK_LANG_AND_ID-add_library-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/GeneratorExpression/LINK_LANG_AND_ID-add_library-stderr.txt b/Tests/RunCMake/GeneratorExpression/LINK_LANG_AND_ID-add_library-stderr.txt new file mode 100644 index 0000000..be46e28 --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/LINK_LANG_AND_ID-add_library-stderr.txt @@ -0,0 +1,9 @@ +CMake Error at LINK_LANG_AND_ID-add_library.cmake:2 \(add_library\): + Error evaluating generator expression: + + \$<LINK_LANG_AND_ID:C,MSVC> + + \$<LINK_LANG_AND_ID:lang,id> may only be used with binary targets to specify + link libraries, link directories, link options, and link depends. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/GeneratorExpression/LINK_LANG_AND_ID-add_library.cmake b/Tests/RunCMake/GeneratorExpression/LINK_LANG_AND_ID-add_library.cmake new file mode 100644 index 0000000..a8199cf --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/LINK_LANG_AND_ID-add_library.cmake @@ -0,0 +1,2 @@ + +add_library(empty empty.$<LINK_LANG_AND_ID:C,MSVC>) diff --git a/Tests/RunCMake/GeneratorExpression/LINK_LANG_AND_ID-add_test-result.txt b/Tests/RunCMake/GeneratorExpression/LINK_LANG_AND_ID-add_test-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/LINK_LANG_AND_ID-add_test-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/GeneratorExpression/LINK_LANG_AND_ID-add_test-stderr.txt b/Tests/RunCMake/GeneratorExpression/LINK_LANG_AND_ID-add_test-stderr.txt new file mode 100644 index 0000000..2a29492 --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/LINK_LANG_AND_ID-add_test-stderr.txt @@ -0,0 +1,9 @@ +CMake Error at LINK_LANG_AND_ID-add_test.cmake:5 \(add_test\): + Error evaluating generator expression: + + \$<LINK_LANG_AND_ID:CXX,GNU> + + \$<LINK_LANG_AND_ID:lang,id> may only be used with binary targets to specify + link libraries, link directories, link options, and link depends. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/GeneratorExpression/LINK_LANG_AND_ID-add_test.cmake b/Tests/RunCMake/GeneratorExpression/LINK_LANG_AND_ID-add_test.cmake new file mode 100644 index 0000000..fd700d7 --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/LINK_LANG_AND_ID-add_test.cmake @@ -0,0 +1,5 @@ + +include(CTest) +enable_testing() + +add_test(NAME dummy COMMAND ${CMAKE_COMMAND} -E echo $<LINK_LANG_AND_ID:CXX,GNU>) diff --git a/Tests/RunCMake/GeneratorExpression/LINK_LANG_AND_ID-file_generate-result.txt b/Tests/RunCMake/GeneratorExpression/LINK_LANG_AND_ID-file_generate-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/LINK_LANG_AND_ID-file_generate-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/GeneratorExpression/LINK_LANG_AND_ID-file_generate-stderr.txt b/Tests/RunCMake/GeneratorExpression/LINK_LANG_AND_ID-file_generate-stderr.txt new file mode 100644 index 0000000..e57b55c --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/LINK_LANG_AND_ID-file_generate-stderr.txt @@ -0,0 +1,9 @@ +CMake Error at LINK_LANG_AND_ID-file_generate.cmake:3 \(file\): + Error evaluating generator expression: + + \$<LINK_LANG_AND_ID:C,GNU> + + \$<LINK_LANG_AND_ID:lang,id> may only be used with binary targets to specify + link libraries, link directories, link options, and link depends. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/GeneratorExpression/LINK_LANG_AND_ID-file_generate.cmake b/Tests/RunCMake/GeneratorExpression/LINK_LANG_AND_ID-file_generate.cmake new file mode 100644 index 0000000..67c1bda --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/LINK_LANG_AND_ID-file_generate.cmake @@ -0,0 +1,6 @@ +enable_language(CXX C) + +file(GENERATE + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/output.txt + CONTENT "LANG_IS_$<$<LINK_LANG_AND_ID:C,GNU>:C>\n" +) diff --git a/Tests/RunCMake/GeneratorExpression/LINK_LANG_AND_ID-install-result.txt b/Tests/RunCMake/GeneratorExpression/LINK_LANG_AND_ID-install-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/LINK_LANG_AND_ID-install-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/GeneratorExpression/LINK_LANG_AND_ID-install-stderr.txt b/Tests/RunCMake/GeneratorExpression/LINK_LANG_AND_ID-install-stderr.txt new file mode 100644 index 0000000..965f974 --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/LINK_LANG_AND_ID-install-stderr.txt @@ -0,0 +1,10 @@ +CMake Error: + Error evaluating generator expression: + + \$<LINK_LANG_AND_ID:C,MSVC> + + \$<LINK_LANG_AND_ID:lang,id> may only be used with binary targets to specify + link libraries, link directories, link options, and link depends. + + +CMake Generate step failed. Build files cannot be regenerated correctly. diff --git a/Tests/RunCMake/GeneratorExpression/LINK_LANG_AND_ID-install.cmake b/Tests/RunCMake/GeneratorExpression/LINK_LANG_AND_ID-install.cmake new file mode 100644 index 0000000..b8f9323 --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/LINK_LANG_AND_ID-install.cmake @@ -0,0 +1,5 @@ + +install(FILES + empty.$<LINK_LANG_AND_ID:C,MSVC> + DESTINATION src +) diff --git a/Tests/RunCMake/GeneratorExpression/LINK_LANG_AND_ID-target_sources-result.txt b/Tests/RunCMake/GeneratorExpression/LINK_LANG_AND_ID-target_sources-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/LINK_LANG_AND_ID-target_sources-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/GeneratorExpression/LINK_LANG_AND_ID-target_sources-stderr.txt b/Tests/RunCMake/GeneratorExpression/LINK_LANG_AND_ID-target_sources-stderr.txt new file mode 100644 index 0000000..e86602a --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/LINK_LANG_AND_ID-target_sources-stderr.txt @@ -0,0 +1,8 @@ +CMake Error at LINK_LANG_AND_ID-target_sources.cmake:2 \(target_sources\): + Error evaluating generator expression: + + \$<LINK_LANG_AND_ID> + + \$<LINK_LANG_AND_ID> expression requires at least two parameters. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/GeneratorExpression/LINK_LANG_AND_ID-target_sources.cmake b/Tests/RunCMake/GeneratorExpression/LINK_LANG_AND_ID-target_sources.cmake new file mode 100644 index 0000000..da5faf4 --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/LINK_LANG_AND_ID-target_sources.cmake @@ -0,0 +1,2 @@ +add_library(empty) +target_sources(empty PRIVATE empty.$<LINK_LANG_AND_ID>) diff --git a/Tests/RunCMake/GeneratorExpression/LINK_LANG_AND_ID-unknown-lang.cmake b/Tests/RunCMake/GeneratorExpression/LINK_LANG_AND_ID-unknown-lang.cmake new file mode 100644 index 0000000..99dd337 --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/LINK_LANG_AND_ID-unknown-lang.cmake @@ -0,0 +1,4 @@ + +enable_language(C) +add_executable(empty empty.c) +target_link_options(empty PRIVATE $<$<LINK_LANG_AND_ID:CXX,GNU>:$<TARGET_EXISTS:too,many,parameters>>) diff --git a/Tests/RunCMake/GeneratorExpression/LINK_LANG_AND_ID-wrong-usage1-result.txt b/Tests/RunCMake/GeneratorExpression/LINK_LANG_AND_ID-wrong-usage1-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/LINK_LANG_AND_ID-wrong-usage1-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/GeneratorExpression/LINK_LANG_AND_ID-wrong-usage1-stderr.txt b/Tests/RunCMake/GeneratorExpression/LINK_LANG_AND_ID-wrong-usage1-stderr.txt new file mode 100644 index 0000000..95611c3 --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/LINK_LANG_AND_ID-wrong-usage1-stderr.txt @@ -0,0 +1,9 @@ +CMake Error at LINK_LANG_AND_ID-wrong-usage1.cmake:4 \(target_compile_definitions\): + Error evaluating generator expression: + + \$<LINK_LANG_AND_ID:C,GNU> + + \$<LINK_LANG_AND_ID:lang,id> may only be used with binary targets to specify + link libraries, link directories, link options, and link depends. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/GeneratorExpression/LINK_LANG_AND_ID-wrong-usage1.cmake b/Tests/RunCMake/GeneratorExpression/LINK_LANG_AND_ID-wrong-usage1.cmake new file mode 100644 index 0000000..e58e3b44 --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/LINK_LANG_AND_ID-wrong-usage1.cmake @@ -0,0 +1,4 @@ + +enable_language(C) +add_executable(empty empty.c) +target_compile_definitions(empty PRIVATE $<$<LINK_LANG_AND_ID:C,GNU>:DEF>) diff --git a/Tests/RunCMake/GeneratorExpression/LINK_LANG_AND_ID-wrong-usage2-result.txt b/Tests/RunCMake/GeneratorExpression/LINK_LANG_AND_ID-wrong-usage2-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/LINK_LANG_AND_ID-wrong-usage2-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/GeneratorExpression/LINK_LANG_AND_ID-wrong-usage2-stderr.txt b/Tests/RunCMake/GeneratorExpression/LINK_LANG_AND_ID-wrong-usage2-stderr.txt new file mode 100644 index 0000000..53bdcb2 --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/LINK_LANG_AND_ID-wrong-usage2-stderr.txt @@ -0,0 +1,9 @@ +CMake Error at LINK_LANG_AND_ID-wrong-usage2.cmake:4 \(target_compile_options\): + Error evaluating generator expression: + + \$<LINK_LANG_AND_ID:C,GNU> + + \$<LINK_LANG_AND_ID:lang,id> may only be used with binary targets to specify + link libraries, link directories, link options, and link depends. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/GeneratorExpression/LINK_LANG_AND_ID-wrong-usage2.cmake b/Tests/RunCMake/GeneratorExpression/LINK_LANG_AND_ID-wrong-usage2.cmake new file mode 100644 index 0000000..998daa9 --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/LINK_LANG_AND_ID-wrong-usage2.cmake @@ -0,0 +1,4 @@ + +enable_language(C) +add_executable(empty empty.c) +target_compile_options(empty PRIVATE $<$<LINK_LANG_AND_ID:C,GNU>:-OPT>) diff --git a/Tests/RunCMake/GeneratorExpression/LINK_LANG_AND_ID-wrong-usage3-result.txt b/Tests/RunCMake/GeneratorExpression/LINK_LANG_AND_ID-wrong-usage3-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/LINK_LANG_AND_ID-wrong-usage3-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/GeneratorExpression/LINK_LANG_AND_ID-wrong-usage3-stderr.txt b/Tests/RunCMake/GeneratorExpression/LINK_LANG_AND_ID-wrong-usage3-stderr.txt new file mode 100644 index 0000000..a34a2ea --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/LINK_LANG_AND_ID-wrong-usage3-stderr.txt @@ -0,0 +1,9 @@ +CMake Error at LINK_LANG_AND_ID-wrong-usage3.cmake:4 \(target_include_directories\): + Error evaluating generator expression: + + \$<LINK_LANG_AND_ID:C,GNU> + + \$<LINK_LANG_AND_ID:lang,id> may only be used with binary targets to specify + link libraries, link directories, link options, and link depends. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/GeneratorExpression/LINK_LANG_AND_ID-wrong-usage3.cmake b/Tests/RunCMake/GeneratorExpression/LINK_LANG_AND_ID-wrong-usage3.cmake new file mode 100644 index 0000000..0543056 --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/LINK_LANG_AND_ID-wrong-usage3.cmake @@ -0,0 +1,4 @@ + +enable_language(C) +add_executable(empty empty.c) +target_include_directories(empty PRIVATE $<$<LINK_LANG_AND_ID:C,GNU>:/DIR>) diff --git a/Tests/RunCMake/GeneratorExpression/RunCMakeTest.cmake b/Tests/RunCMake/GeneratorExpression/RunCMakeTest.cmake index 68a0172..6550f84 100644 --- a/Tests/RunCMake/GeneratorExpression/RunCMakeTest.cmake +++ b/Tests/RunCMake/GeneratorExpression/RunCMakeTest.cmake @@ -39,6 +39,31 @@ run_cmake(COMPILE_LANG_AND_ID-add_executable) run_cmake(COMPILE_LANG_AND_ID-add_library) run_cmake(COMPILE_LANG_AND_ID-add_test) run_cmake(COMPILE_LANG_AND_ID-unknown-lang) +run_cmake(LINK_LANGUAGE-add_custom_target) +run_cmake(LINK_LANGUAGE-add_custom_command) +run_cmake(LINK_LANGUAGE-install) +run_cmake(LINK_LANGUAGE-target_sources) +run_cmake(LINK_LANGUAGE-add_executable) +run_cmake(LINK_LANGUAGE-add_library) +run_cmake(LINK_LANGUAGE-add_test) +run_cmake(LINK_LANGUAGE-unknown-lang) +run_cmake(LINK_LANGUAGE-wrong-usage1) +run_cmake(LINK_LANGUAGE-wrong-usage2) +run_cmake(LINK_LANGUAGE-wrong-usage3) +run_cmake(LINK_LANGUAGE-wrong-usage4) +run_cmake(LINK_LANGUAGE-file_generate) +run_cmake(LINK_LANG_AND_ID-add_custom_target) +run_cmake(LINK_LANG_AND_ID-add_custom_command) +run_cmake(LINK_LANG_AND_ID-install) +run_cmake(LINK_LANG_AND_ID-target_sources) +run_cmake(LINK_LANG_AND_ID-add_executable) +run_cmake(LINK_LANG_AND_ID-add_library) +run_cmake(LINK_LANG_AND_ID-add_test) +run_cmake(LINK_LANG_AND_ID-unknown-lang) +run_cmake(LINK_LANG_AND_ID-wrong-usage1) +run_cmake(LINK_LANG_AND_ID-wrong-usage2) +run_cmake(LINK_LANG_AND_ID-wrong-usage3) +run_cmake(LINK_LANG_AND_ID-file_generate) run_cmake(TARGET_FILE-recursion) run_cmake(OUTPUT_NAME-recursion) run_cmake(TARGET_FILE_PREFIX) diff --git a/Tests/RunCMake/GoogleTest/GoogleTest-discovery-timeout-result.txt b/Tests/RunCMake/GoogleTest/GoogleTest-discovery-timeout-build-result.txt index d197c91..d197c91 100644 --- a/Tests/RunCMake/GoogleTest/GoogleTest-discovery-timeout-result.txt +++ b/Tests/RunCMake/GoogleTest/GoogleTest-discovery-timeout-build-result.txt diff --git a/Tests/RunCMake/GoogleTest/GoogleTest-discovery-timeout-stdout.txt b/Tests/RunCMake/GoogleTest/GoogleTest-discovery-timeout-build-stdout.txt index 3a6572c..3a6572c 100644 --- a/Tests/RunCMake/GoogleTest/GoogleTest-discovery-timeout-stdout.txt +++ b/Tests/RunCMake/GoogleTest/GoogleTest-discovery-timeout-build-stdout.txt diff --git a/Tests/RunCMake/GoogleTest/GoogleTest-discovery-timeout-test-result.txt b/Tests/RunCMake/GoogleTest/GoogleTest-discovery-timeout-test-result.txt new file mode 100644 index 0000000..d197c91 --- /dev/null +++ b/Tests/RunCMake/GoogleTest/GoogleTest-discovery-timeout-test-result.txt @@ -0,0 +1 @@ +[^0] diff --git a/Tests/RunCMake/GoogleTest/GoogleTest-discovery-timeout-test-stderr.txt b/Tests/RunCMake/GoogleTest/GoogleTest-discovery-timeout-test-stderr.txt new file mode 100644 index 0000000..f6be939 --- /dev/null +++ b/Tests/RunCMake/GoogleTest/GoogleTest-discovery-timeout-test-stderr.txt @@ -0,0 +1,2 @@ +Unable to find executable: discovery_timeout_test_NOT_BUILT +Errors while running CTest diff --git a/Tests/RunCMake/GoogleTest/GoogleTest-discovery-timeout-test-stdout.txt b/Tests/RunCMake/GoogleTest/GoogleTest-discovery-timeout-test-stdout.txt new file mode 100644 index 0000000..d4c4e7b --- /dev/null +++ b/Tests/RunCMake/GoogleTest/GoogleTest-discovery-timeout-test-stdout.txt @@ -0,0 +1,18 @@ +Test project .*GoogleTest-build +[ \t]*Start [0-9]+: discovery_timeout_test_NOT_BUILT +Could not find executable discovery_timeout_test_NOT_BUILT +Looked in the following places: +discovery_timeout_test_NOT_BUILT +discovery_timeout_test_NOT_BUILT(\.exe)? +Debug/discovery_timeout_test_NOT_BUILT +Debug/discovery_timeout_test_NOT_BUILT(\.exe)? +Debug/discovery_timeout_test_NOT_BUILT +Debug/discovery_timeout_test_NOT_BUILT(\.exe)? +[^\n]+discovery_timeout_test_NOT_BUILT +\.+\*\*\*Not Run +[0-9.]+ sec ++ +0% tests passed, 1 tests failed out of 1 ++ +Total Test time \(real\) = +[0-9.]+ sec ++ +The following tests FAILED: +[^\n]+discovery_timeout_test_NOT_BUILT \(Not Run\) diff --git a/Tests/RunCMake/GoogleTest/GoogleTestXML-result-check.cmake b/Tests/RunCMake/GoogleTest/GoogleTestXML-result-check.cmake new file mode 100644 index 0000000..3bfdac3 --- /dev/null +++ b/Tests/RunCMake/GoogleTest/GoogleTestXML-result-check.cmake @@ -0,0 +1,4 @@ +set(RESULT_FILE "${RunCMake_TEST_BINARY_DIR}/GoogleTestXML.Foo.xml") +if(NOT EXISTS ${RESULT_FILE}) + set(RunCMake_TEST_FAILED "Result XML file ${RESULT_FILE} was not created") +endif() diff --git a/Tests/RunCMake/GoogleTest/GoogleTestXML.cmake b/Tests/RunCMake/GoogleTest/GoogleTestXML.cmake new file mode 100644 index 0000000..c86de63 --- /dev/null +++ b/Tests/RunCMake/GoogleTest/GoogleTestXML.cmake @@ -0,0 +1,11 @@ +project(test_include_dirs) +include(CTest) +include(GoogleTest) + +enable_testing() + +add_executable(xml_output xml_output.cpp) +gtest_discover_tests( + xml_output + XML_OUTPUT_DIR ${CMAKE_BINARY_DIR} +) diff --git a/Tests/RunCMake/GoogleTest/RunCMakeTest.cmake b/Tests/RunCMake/GoogleTest/RunCMakeTest.cmake index 0fa4e2a..8070512 100644 --- a/Tests/RunCMake/GoogleTest/RunCMakeTest.cmake +++ b/Tests/RunCMake/GoogleTest/RunCMakeTest.cmake @@ -27,7 +27,7 @@ function(run_GoogleTest) ) set(RunCMake_TEST_OUTPUT_MERGE 1) - run_cmake_command(GoogleTest-discovery-timeout + run_cmake_command(GoogleTest-discovery-timeout-build ${CMAKE_COMMAND} --build . --config Debug @@ -69,6 +69,41 @@ function(run_GoogleTest) -R property_timeout\\.case_with_discovery --no-label-summary ) + + run_cmake_command(GoogleTest-discovery-timeout-test + ${CMAKE_CTEST_COMMAND} + -C Debug + -R discovery_timeout_test + --no-label-summary + ) +endfunction() + +function(run_GoogleTestXML) + # Use a single build tree for a few tests without cleaning. + set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/GoogleTestXML-build) + set(RunCMake_TEST_NO_CLEAN 1) + if(NOT RunCMake_GENERATOR_IS_MULTI_CONFIG) + set(RunCMake_TEST_OPTIONS -DCMAKE_BUILD_TYPE=Debug) + endif() + file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}") + file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}") + + run_cmake(GoogleTestXML) + + run_cmake_command(GoogleTestXML-discovery + ${CMAKE_COMMAND} + --build . + --config Debug + --target xml_output + ) + + run_cmake_command(GoogleTestXML-result + ${CMAKE_CTEST_COMMAND} + -C Debug + -R GoogleTestXML + --no-label-summary + ) endfunction() run_GoogleTest() +run_GoogleTestXML() diff --git a/Tests/RunCMake/GoogleTest/xml_output.cpp b/Tests/RunCMake/GoogleTest/xml_output.cpp new file mode 100644 index 0000000..e130231 --- /dev/null +++ b/Tests/RunCMake/GoogleTest/xml_output.cpp @@ -0,0 +1,26 @@ +#include <fstream> +#include <iostream> +#include <string> + +int main(int argc, char** argv) +{ + // Note: GoogleTestXML.cmake doesn't actually depend on Google Test as such; + // it only mimicks the output file creation using the path passed to this + // test without any content + for (int i = 0; i < argc; i++) { + std::string param(argv[i]); + if (param.find("--gtest_list_tests") != std::string::npos) { + // This actually defines the name of the file passed in the 2nd run + std::cout << "GoogleTestXML." << std::endl; + std::cout << " Foo" << std::endl; + } else if (param.find("--gtest_output=xml:") != std::string::npos) { + std::string::size_type split = param.find(":"); + std::string filepath = param.substr(split + 1); + // The full file path is passed + std::ofstream ostrm(filepath.c_str(), std::ios::binary); + ostrm << "--gtest_output=xml: mockup file\n"; + } + } + + return 0; +} diff --git a/Tests/RunCMake/Languages/LINKER_LANGUAGE-genex-result.txt b/Tests/RunCMake/Languages/LINKER_LANGUAGE-genex-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/Languages/LINKER_LANGUAGE-genex-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/Languages/LINK_LANGUAGE-genex-stderr.txt b/Tests/RunCMake/Languages/LINKER_LANGUAGE-genex-stderr.txt index 03c002e..7abf76a 100644 --- a/Tests/RunCMake/Languages/LINK_LANGUAGE-genex-stderr.txt +++ b/Tests/RunCMake/Languages/LINKER_LANGUAGE-genex-stderr.txt @@ -1,4 +1,4 @@ -CMake Error at LINK_LANGUAGE-genex.cmake:[0-9]+ \(target_link_libraries\): +CMake Error at LINKER_LANGUAGE-genex.cmake:[0-9]+ \(target_link_libraries\): Error evaluating generator expression: \$<TARGET_PROPERTY:LINKER_LANGUAGE> diff --git a/Tests/RunCMake/Languages/LINK_LANGUAGE-genex.cmake b/Tests/RunCMake/Languages/LINKER_LANGUAGE-genex.cmake index 64f394c..64f394c 100644 --- a/Tests/RunCMake/Languages/LINK_LANGUAGE-genex.cmake +++ b/Tests/RunCMake/Languages/LINKER_LANGUAGE-genex.cmake diff --git a/Tests/RunCMake/Languages/RunCMakeTest.cmake b/Tests/RunCMake/Languages/RunCMakeTest.cmake index 2a534b3..48216e9 100644 --- a/Tests/RunCMake/Languages/RunCMakeTest.cmake +++ b/Tests/RunCMake/Languages/RunCMakeTest.cmake @@ -1,7 +1,7 @@ include(RunCMake) run_cmake(NoLangSHARED) -run_cmake(LINK_LANGUAGE-genex) +run_cmake(LINKER_LANGUAGE-genex) run_cmake(link-libraries-TARGET_FILE-genex) run_cmake(link-libraries-TARGET_FILE-genex-ok) diff --git a/Tests/RunCMake/Syntax/CommandEOF-stderr.txt b/Tests/RunCMake/Syntax/CommandEOF-stderr.txt index 31cbc08..b9f8fd1 100644 --- a/Tests/RunCMake/Syntax/CommandEOF-stderr.txt +++ b/Tests/RunCMake/Syntax/CommandEOF-stderr.txt @@ -1,4 +1,4 @@ -^CMake Error in CommandEOF.cmake: +^CMake Error at CommandEOF.cmake:1: Unexpected end of file. Parse error. Function missing opening "\(". diff --git a/Tests/RunCMake/VS10Project/CSharpSourceGroup/foo.cs b/Tests/RunCMake/VS10Project/CSharpSourceGroup/foo.cs new file mode 100644 index 0000000..3695dc9 --- /dev/null +++ b/Tests/RunCMake/VS10Project/CSharpSourceGroup/foo.cs @@ -0,0 +1,3 @@ +void foo() +{ +} diff --git a/Tests/RunCMake/VS10Project/CSharpSourceGroup/images/empty.bmp b/Tests/RunCMake/VS10Project/CSharpSourceGroup/images/empty.bmp new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/VS10Project/CSharpSourceGroup/images/empty.bmp diff --git a/Tests/RunCMake/VS10Project/CSharpSourceGroup/nested/baz.cs b/Tests/RunCMake/VS10Project/CSharpSourceGroup/nested/baz.cs new file mode 100644 index 0000000..d5d334a --- /dev/null +++ b/Tests/RunCMake/VS10Project/CSharpSourceGroup/nested/baz.cs @@ -0,0 +1,3 @@ +void baz() +{ +} diff --git a/Tests/RunCMake/VS10Project/RunCMakeTest.cmake b/Tests/RunCMake/VS10Project/RunCMakeTest.cmake index 8a04f78..3ca7cc0 100644 --- a/Tests/RunCMake/VS10Project/RunCMakeTest.cmake +++ b/Tests/RunCMake/VS10Project/RunCMakeTest.cmake @@ -3,12 +3,12 @@ cmake_policy(SET CMP0057 NEW) include(RunCMake) cmake_policy(SET CMP0054 NEW) +run_cmake(VsCsharpSourceGroup) run_cmake(VsCSharpCompilerOpts) run_cmake(ExplicitCMakeLists) run_cmake(RuntimeLibrary) run_cmake(SourceGroupCMakeLists) run_cmake(SourceGroupTreeCMakeLists) - run_cmake(VsConfigurationType) run_cmake(VsTargetsFileReferences) run_cmake(VsCustomProps) @@ -30,6 +30,7 @@ run_cmake(VsDpiAware) run_cmake(VsDpiAwareBadParam) run_cmake(VsPrecompileHeaders) run_cmake(VsPrecompileHeadersReuseFromCompilePDBName) +run_cmake(VsDeployEnabled) run_cmake(VsWinRTByDefault) diff --git a/Tests/RunCMake/VS10Project/VsCsharpSourceGroup-check.cmake b/Tests/RunCMake/VS10Project/VsCsharpSourceGroup-check.cmake new file mode 100644 index 0000000..3b5c70f --- /dev/null +++ b/Tests/RunCMake/VS10Project/VsCsharpSourceGroup-check.cmake @@ -0,0 +1,22 @@ +set(csProjFile "${RunCMake_TEST_BINARY_DIR}/VsCsharpSourceGroup.csproj") +if(NOT EXISTS "${csProjFile}") + set(RunCMake_TEST_FAILED "Project file ${csProjFile} does not exist.") + return() +endif() + +file(STRINGS "${csProjFile}" lines) + +include(${RunCMake_TEST_SOURCE_DIR}/VsCsharpSourceGroupHelpers.cmake) + +set(SOURCE_GROUPS_TO_FIND + "CSharpSourceGroup" + "CSharpSourceGroup/nested" + "Images" +) + +foreach(GROUP_NAME IN LISTS ${SOURCE_GROUPS_TO_FIND}) + find_source_group("${lines}" ${GROUP_NAME}) + if(NOT ${SOURCE_GROUP_FOUND}) + return() + endif() +endforeach() diff --git a/Tests/RunCMake/VS10Project/VsCsharpSourceGroup.cmake b/Tests/RunCMake/VS10Project/VsCsharpSourceGroup.cmake new file mode 100644 index 0000000..024993c --- /dev/null +++ b/Tests/RunCMake/VS10Project/VsCsharpSourceGroup.cmake @@ -0,0 +1,16 @@ +enable_language(CSharp) +set(CMAKE_CONFIGURATION_TYPES Debug) + +set(SRC_FILES + ${CMAKE_CURRENT_SOURCE_DIR}/CSharpSourceGroup/foo.cs + ${CMAKE_CURRENT_SOURCE_DIR}/CSharpSourceGroup/nested/baz.cs +) + +set(IMAGE_FILES + ${CMAKE_CURRENT_SOURCE_DIR}/CSharpSourceGroup/Images/empty.bmp +) + +add_library(VsCsharpSourceGroup SHARED ${SRC_FILES} ${IMAGE_FILES}) +source_group("CSharpSourceGroup" FILES ${CMAKE_CURRENT_SOURCE_DIR}/CSharpSourceGroup/foo.cs) +source_group("CSharpSourceGroup/nested" FILES ${CMAKE_CURRENT_SOURCE_DIR}/CSharpSourceGroup/nested/baz.cs) +source_group("Images" FILES ${IMAGE_FILES}) diff --git a/Tests/RunCMake/VS10Project/VsCsharpSourceGroupHelpers.cmake b/Tests/RunCMake/VS10Project/VsCsharpSourceGroupHelpers.cmake new file mode 100644 index 0000000..bfa9a67 --- /dev/null +++ b/Tests/RunCMake/VS10Project/VsCsharpSourceGroupHelpers.cmake @@ -0,0 +1,15 @@ +function(find_source_group LINES NAME) + set(foundSourceGroupLink 0) + foreach(line IN LISTS LINES) + if(line MATCHES "<Link>${NAME}</Link>") + set(foundSourceGroupLink 1) + endif() + endforeach() + + if(NOT foundSourceGroupLink) + set(RunCMake_TEST_FAILED "Source group link for ${NAME} not found." PARENT_SCOPE) + set(SOURCE_GROUP_FOUND 0 PARENT_SCOPE) + return() + endif() + set(SOURCE_GROUP_FOUND 1 PARENT_SCOPE) +endfunction() diff --git a/Tests/RunCMake/VS10Project/VsDeployEnabled-check.cmake b/Tests/RunCMake/VS10Project/VsDeployEnabled-check.cmake new file mode 100644 index 0000000..0ff8678 --- /dev/null +++ b/Tests/RunCMake/VS10Project/VsDeployEnabled-check.cmake @@ -0,0 +1,58 @@ +set(vcProjectFile "${RunCMake_TEST_BINARY_DIR}/foo.vcxproj") +if(NOT EXISTS "${vcProjectFile}") + set(RunCMake_TEST_FAILED "Project file ${vcProjectFile} does not exist.") + return() +endif() +# +# Test solution file for deployment. +# + +set(vcSlnFile "${RunCMake_TEST_BINARY_DIR}/VsDeployEnabled.sln") +if(NOT EXISTS "${vcSlnFile}") + set(RunCMake_TEST_FAILED "Solution file ${vcSlnFile} does not exist.") + return() +endif() + + + +set(FooProjGUID "") +set(FoundFooProj FALSE) +set(InFooProj FALSE) +set(FoundReleaseDeploy FALSE) +set(DeployConfigs Debug MinSizeRel RelWithDebInfo ) + +file(STRINGS "${vcSlnFile}" lines) +foreach(line IN LISTS lines) +#message(STATUS "${line}") + if( (NOT InFooProj ) AND (line MATCHES "^[ \\t]*Project\\(\"{[A-F0-9-]+}\"\\) = \"foo\", \"foo.vcxproj\", \"({[A-F0-9-]+})\"[ \\t]*$")) + # First, identify the GUID for the foo project, and record it. + set(FoundFooProj TRUE) + set(InFooProj TRUE) + set(FooProjGUID ${CMAKE_MATCH_1}) + elseif(InFooProj AND line MATCHES "EndProject") + set(InFooProj FALSE) + elseif((NOT InFooProj) AND line MATCHES "${FooProjGUID}\\.Release.*\\.Deploy\\.0") + # If foo's Release configuration is set to deploy, this is the error. + set(FoundReleaseDeploy TRUE) + endif() + if( line MATCHES "{[A-F0-9-]+}\\.([^\\|]+).*\\.Deploy\\.0" ) + # Check that the other configurations ARE set to deploy. + list( REMOVE_ITEM DeployConfigs ${CMAKE_MATCH_1}) + endif() +endforeach() + +if(FoundReleaseDeploy) + set(RunCMake_TEST_FAILED "Release deployment enabled.") + return() +endif() + +if(NOT FoundFooProj) + set(RunCMake_TEST_FAILED "Failed to find foo project in the solution.") + return() +endif() + +list(LENGTH DeployConfigs length) +if( length GREATER 0 ) + set(RunCMake_TEST_FAILED "Failed to find Deploy lines for non-Release configurations. (${length})") + return() +endif() diff --git a/Tests/RunCMake/VS10Project/VsDeployEnabled.cmake b/Tests/RunCMake/VS10Project/VsDeployEnabled.cmake new file mode 100644 index 0000000..02b42b2 --- /dev/null +++ b/Tests/RunCMake/VS10Project/VsDeployEnabled.cmake @@ -0,0 +1,12 @@ +enable_language(CXX) + +set(DEPLOY_DIR + "temp\\foodir" +) + +add_library(foo SHARED foo.cpp) + +set_target_properties(foo + PROPERTIES + VS_SOLUTION_DEPLOY $<NOT:$<CONFIG:Release>> +) diff --git a/Tests/RunCMake/add_link_options/GENEX_LINK_LANG.cmake b/Tests/RunCMake/add_link_options/GENEX_LINK_LANG.cmake new file mode 100644 index 0000000..cc4ce4c --- /dev/null +++ b/Tests/RunCMake/add_link_options/GENEX_LINK_LANG.cmake @@ -0,0 +1,16 @@ + +enable_language(C) + +set(obj "${CMAKE_C_OUTPUT_EXTENSION}") +if(BORLAND) + set(pre -) +endif() + +add_link_options ($<$<LINK_LANGUAGE:C>:${pre}BADFLAG_LANG_C${obj}> + $<$<LINK_LANGUAGE:CXX>:${pre}BADFLAG_LANG_CXX${obj}>) + +add_library(LinkOptions_shared SHARED LinkOptionsLib.c) + +add_library(LinkOptions_mod MODULE LinkOptionsLib.c) + +add_executable(LinkOptions_exe LinkOptionsExe.c) diff --git a/Tests/RunCMake/add_link_options/LINKER_expansion-validation.cmake b/Tests/RunCMake/add_link_options/LINKER_expansion-validation.cmake index bebd6c7..ece3ba0 100644 --- a/Tests/RunCMake/add_link_options/LINKER_expansion-validation.cmake +++ b/Tests/RunCMake/add_link_options/LINKER_expansion-validation.cmake @@ -11,5 +11,8 @@ endif() file(READ "${RunCMake_TEST_BINARY_DIR}/LINKER.txt" linker_flag) if (NOT actual_stdout MATCHES "${linker_flag}") - set (RunCMake_TEST_FAILED "LINKER: was not expanded correctly.") + if (RunCMake_TEST_FAILED) + string (APPEND RunCMake_TEST_FAILED "\n") + endif() + string (APPEND RunCMake_TEST_FAILED "LINKER: was not expanded correctly.") endif() diff --git a/Tests/RunCMake/add_link_options/LINK_OPTIONS-exe-check.cmake b/Tests/RunCMake/add_link_options/LINK_OPTIONS-exe-check.cmake index 4a22d7e..127a2f5 100644 --- a/Tests/RunCMake/add_link_options/LINK_OPTIONS-exe-check.cmake +++ b/Tests/RunCMake/add_link_options/LINK_OPTIONS-exe-check.cmake @@ -3,5 +3,8 @@ if (NOT actual_stdout MATCHES "BADFLAG_EXECUTABLE_RELEASE") set (RunCMake_TEST_FAILED "Not found expected 'BADFLAG_EXECUTABLE_RELEASE'.") endif() if (actual_stdout MATCHES "BADFLAG_(SHARED|MODULE)_RELEASE") - set (RunCMake_TEST_FAILED "Found unexpected 'BADFLAG_(SHARED|MODULE)_RELEASE'.") + if (RunCMake_TEST_FAILED) + string (APPEND RunCMake_TEST_FAILED "\n") + endif() + string (APPEND RunCMake_TEST_FAILED "Found unexpected 'BADFLAG_(SHARED|MODULE)_RELEASE'.") endif() diff --git a/Tests/RunCMake/add_link_options/LINK_OPTIONS-mod-check.cmake b/Tests/RunCMake/add_link_options/LINK_OPTIONS-mod-check.cmake index d695761..874e0ad 100644 --- a/Tests/RunCMake/add_link_options/LINK_OPTIONS-mod-check.cmake +++ b/Tests/RunCMake/add_link_options/LINK_OPTIONS-mod-check.cmake @@ -3,5 +3,8 @@ if (NOT actual_stdout MATCHES "BADFLAG_MODULE_RELEASE") set (RunCMake_TEST_FAILED "Not found expected 'BADFLAG_MODULE_RELEASE'.") endif() if (actual_stdout MATCHES "BADFLAG_(SHARED|EXECUTABLE)_RELEASE") - set (RunCMake_TEST_FAILED "Found unexpected 'BADFLAG_(SHARED|EXECUTABLE)_RELEASE'.") + if (RunCMake_TEST_FAILED) + string (APPEND RunCMake_TEST_FAILED "\n") + endif() + string (APPEND RunCMake_TEST_FAILED "Found unexpected 'BADFLAG_(SHARED|EXECUTABLE)_RELEASE'.") endif() diff --git a/Tests/RunCMake/add_link_options/LINK_OPTIONS-shared-check.cmake b/Tests/RunCMake/add_link_options/LINK_OPTIONS-shared-check.cmake index eaac8e3..ecba17e 100644 --- a/Tests/RunCMake/add_link_options/LINK_OPTIONS-shared-check.cmake +++ b/Tests/RunCMake/add_link_options/LINK_OPTIONS-shared-check.cmake @@ -3,5 +3,8 @@ if (NOT actual_stdout MATCHES "BADFLAG_SHARED_RELEASE") set (RunCMake_TEST_FAILED "Not found expected 'BADFLAG_SHARED_RELEASE'.") endif() if (actual_stdout MATCHES "BADFLAG_(MODULE|EXECUTABLE)_RELEASE") - set (RunCMake_TEST_FAILED "Found unexpected 'BADFLAG_(MODULE|EXECUTABLE)_RELEASE'.") + if (RunCMake_TEST_FAILED) + string (APPEND RunCMake_TEST_FAILED "\n") + endif() + string (APPEND RunCMake_TEST_FAILED "Found unexpected 'BADFLAG_(MODULE|EXECUTABLE)_RELEASE'.") endif() diff --git a/Tests/RunCMake/add_link_options/LinkOptionsLib.cxx b/Tests/RunCMake/add_link_options/LinkOptionsLib.cxx new file mode 100644 index 0000000..9bbd24c --- /dev/null +++ b/Tests/RunCMake/add_link_options/LinkOptionsLib.cxx @@ -0,0 +1,7 @@ +#if defined(_WIN32) +__declspec(dllexport) +#endif + int flags_lib(void) +{ + return 0; +} diff --git a/Tests/RunCMake/add_link_options/RunCMakeTest.cmake b/Tests/RunCMake/add_link_options/RunCMakeTest.cmake index 4f5df72..465ff85 100644 --- a/Tests/RunCMake/add_link_options/RunCMakeTest.cmake +++ b/Tests/RunCMake/add_link_options/RunCMakeTest.cmake @@ -23,6 +23,21 @@ if (NOT CMAKE_C_COMPILER_ID STREQUAL "Intel") run_cmake_target(LINK_OPTIONS mod LinkOptions_mod --config Release) run_cmake_target(LINK_OPTIONS exe LinkOptions_exe --config Release) + + run_cmake(genex_LINK_LANGUAGE) + + run_cmake_target(genex_LINK_LANGUAGE shared_c LinkOptions_shared_c --config Release) + run_cmake_target(genex_LINK_LANGUAGE shared_cxx LinkOptions_shared_cxx --config Release) + run_cmake_target(genex_LINK_LANGUAGE mod LinkOptions_mod --config Release) + run_cmake_target(genex_LINK_LANGUAGE exe LinkOptions_exe --config Release) + + run_cmake(genex_LINK_LANG_AND_ID) + + run_cmake_target(genex_LINK_LANG_AND_ID shared_c LinkOptions_shared_c --config Release) + run_cmake_target(genex_LINK_LANG_AND_ID shared_cxx LinkOptions_shared_cxx --config Release) + run_cmake_target(genex_LINK_LANG_AND_ID mod LinkOptions_mod --config Release) + run_cmake_target(genex_LINK_LANG_AND_ID exe LinkOptions_exe --config Release) + unset(RunCMake_TEST_OPTIONS) unset(RunCMake_TEST_OUTPUT_MERGE) endif() diff --git a/Tests/RunCMake/add_link_options/genex_LINK_LANGUAGE-exe-check.cmake b/Tests/RunCMake/add_link_options/genex_LINK_LANGUAGE-exe-check.cmake new file mode 100644 index 0000000..71f641d --- /dev/null +++ b/Tests/RunCMake/add_link_options/genex_LINK_LANGUAGE-exe-check.cmake @@ -0,0 +1,2 @@ + +include ("${CMAKE_CURRENT_LIST_DIR}/genex_LINK_LANGUAGE-validation.cmake") diff --git a/Tests/RunCMake/add_link_options/genex_LINK_LANGUAGE-exe-result.txt b/Tests/RunCMake/add_link_options/genex_LINK_LANGUAGE-exe-result.txt new file mode 100644 index 0000000..8d98f9d --- /dev/null +++ b/Tests/RunCMake/add_link_options/genex_LINK_LANGUAGE-exe-result.txt @@ -0,0 +1 @@ +.* diff --git a/Tests/RunCMake/add_link_options/genex_LINK_LANGUAGE-mod-check.cmake b/Tests/RunCMake/add_link_options/genex_LINK_LANGUAGE-mod-check.cmake new file mode 100644 index 0000000..71f641d --- /dev/null +++ b/Tests/RunCMake/add_link_options/genex_LINK_LANGUAGE-mod-check.cmake @@ -0,0 +1,2 @@ + +include ("${CMAKE_CURRENT_LIST_DIR}/genex_LINK_LANGUAGE-validation.cmake") diff --git a/Tests/RunCMake/add_link_options/genex_LINK_LANGUAGE-mod-result.txt b/Tests/RunCMake/add_link_options/genex_LINK_LANGUAGE-mod-result.txt new file mode 100644 index 0000000..8d98f9d --- /dev/null +++ b/Tests/RunCMake/add_link_options/genex_LINK_LANGUAGE-mod-result.txt @@ -0,0 +1 @@ +.* diff --git a/Tests/RunCMake/add_link_options/genex_LINK_LANGUAGE-shared_c-check.cmake b/Tests/RunCMake/add_link_options/genex_LINK_LANGUAGE-shared_c-check.cmake new file mode 100644 index 0000000..ba0120c --- /dev/null +++ b/Tests/RunCMake/add_link_options/genex_LINK_LANGUAGE-shared_c-check.cmake @@ -0,0 +1,5 @@ + +set (VALID_LANG C) +set (INVALID_LANG CXX) + +include ("${CMAKE_CURRENT_LIST_DIR}/genex_LINK_LANGUAGE-validation.cmake") diff --git a/Tests/RunCMake/add_link_options/genex_LINK_LANGUAGE-shared_c-result.txt b/Tests/RunCMake/add_link_options/genex_LINK_LANGUAGE-shared_c-result.txt new file mode 100644 index 0000000..8d98f9d --- /dev/null +++ b/Tests/RunCMake/add_link_options/genex_LINK_LANGUAGE-shared_c-result.txt @@ -0,0 +1 @@ +.* diff --git a/Tests/RunCMake/add_link_options/genex_LINK_LANGUAGE-shared_cxx-check.cmake b/Tests/RunCMake/add_link_options/genex_LINK_LANGUAGE-shared_cxx-check.cmake new file mode 100644 index 0000000..aa39810 --- /dev/null +++ b/Tests/RunCMake/add_link_options/genex_LINK_LANGUAGE-shared_cxx-check.cmake @@ -0,0 +1,5 @@ + +set (VALID_LANG CXX) +set (INVALID_LANG C) + +include ("${CMAKE_CURRENT_LIST_DIR}/genex_LINK_LANGUAGE-validation.cmake") diff --git a/Tests/RunCMake/add_link_options/genex_LINK_LANGUAGE-shared_cxx-result.txt b/Tests/RunCMake/add_link_options/genex_LINK_LANGUAGE-shared_cxx-result.txt new file mode 100644 index 0000000..8d98f9d --- /dev/null +++ b/Tests/RunCMake/add_link_options/genex_LINK_LANGUAGE-shared_cxx-result.txt @@ -0,0 +1 @@ +.* diff --git a/Tests/RunCMake/add_link_options/genex_LINK_LANGUAGE-validation.cmake b/Tests/RunCMake/add_link_options/genex_LINK_LANGUAGE-validation.cmake new file mode 100644 index 0000000..f0237ab --- /dev/null +++ b/Tests/RunCMake/add_link_options/genex_LINK_LANGUAGE-validation.cmake @@ -0,0 +1,17 @@ + +if (NOT DEFINED VALID_LANG) + set (VALID_LANG C) +endif() +if (NOT DEFINED INVALID_LANG) + set (INVALID_LANG CXX) +endif() + +if (NOT actual_stdout MATCHES "BADFLAG_${VALID_LANG}_LANG") + set (RunCMake_TEST_FAILED "Not found expected 'BADFLAG_${VALID_LANG}_LANG'.") +endif() +if (actual_stdout MATCHES "BADFLAG_${INVALID_LANG}_LANG") + if (RunCMake_TEST_FAILED) + string (APPEND RunCMake_TEST_FAILED "\n") + endif() + string (APPEND RunCMake_TEST_FAILED "Found unexpected 'BADFLAG_${INVALID_LANG}_LANG'.") +endif() diff --git a/Tests/RunCMake/add_link_options/genex_LINK_LANGUAGE.cmake b/Tests/RunCMake/add_link_options/genex_LINK_LANGUAGE.cmake new file mode 100644 index 0000000..d74d448 --- /dev/null +++ b/Tests/RunCMake/add_link_options/genex_LINK_LANGUAGE.cmake @@ -0,0 +1,17 @@ + +enable_language(C) +enable_language(CXX) + +if(BORLAND) + set(pre -) +endif() + +add_link_options ($<$<LINK_LANGUAGE:C>:${pre}BADFLAG_$<LINK_LANGUAGE>_LANG${CMAKE_C_OUTPUT_EXTENSION}> + $<$<LINK_LANGUAGE:CXX>:${pre}BADFLAG_$<LINK_LANGUAGE>_LANG${CMAKE_CXX_OUTPUT_EXTENSION}>) + +add_library(LinkOptions_shared_c SHARED LinkOptionsLib.c) +add_library(LinkOptions_shared_cxx SHARED LinkOptionsLib.cxx) + +add_library(LinkOptions_mod MODULE LinkOptionsLib.c) + +add_executable(LinkOptions_exe LinkOptionsExe.c) diff --git a/Tests/RunCMake/add_link_options/genex_LINK_LANG_AND_ID-exe-check.cmake b/Tests/RunCMake/add_link_options/genex_LINK_LANG_AND_ID-exe-check.cmake new file mode 100644 index 0000000..6bddee1 --- /dev/null +++ b/Tests/RunCMake/add_link_options/genex_LINK_LANG_AND_ID-exe-check.cmake @@ -0,0 +1,2 @@ + +include ("${CMAKE_CURRENT_LIST_DIR}/genex_LINK_LANG_AND_ID-validation.cmake") diff --git a/Tests/RunCMake/add_link_options/genex_LINK_LANG_AND_ID-exe-result.txt b/Tests/RunCMake/add_link_options/genex_LINK_LANG_AND_ID-exe-result.txt new file mode 100644 index 0000000..8d98f9d --- /dev/null +++ b/Tests/RunCMake/add_link_options/genex_LINK_LANG_AND_ID-exe-result.txt @@ -0,0 +1 @@ +.* diff --git a/Tests/RunCMake/add_link_options/genex_LINK_LANG_AND_ID-mod-check.cmake b/Tests/RunCMake/add_link_options/genex_LINK_LANG_AND_ID-mod-check.cmake new file mode 100644 index 0000000..6bddee1 --- /dev/null +++ b/Tests/RunCMake/add_link_options/genex_LINK_LANG_AND_ID-mod-check.cmake @@ -0,0 +1,2 @@ + +include ("${CMAKE_CURRENT_LIST_DIR}/genex_LINK_LANG_AND_ID-validation.cmake") diff --git a/Tests/RunCMake/add_link_options/genex_LINK_LANG_AND_ID-mod-result.txt b/Tests/RunCMake/add_link_options/genex_LINK_LANG_AND_ID-mod-result.txt new file mode 100644 index 0000000..8d98f9d --- /dev/null +++ b/Tests/RunCMake/add_link_options/genex_LINK_LANG_AND_ID-mod-result.txt @@ -0,0 +1 @@ +.* diff --git a/Tests/RunCMake/add_link_options/genex_LINK_LANG_AND_ID-shared_c-check.cmake b/Tests/RunCMake/add_link_options/genex_LINK_LANG_AND_ID-shared_c-check.cmake new file mode 100644 index 0000000..cf498d9 --- /dev/null +++ b/Tests/RunCMake/add_link_options/genex_LINK_LANG_AND_ID-shared_c-check.cmake @@ -0,0 +1,5 @@ + +set (VALID_LANG C) +set (INVALID_LANG CXX) + +include ("${CMAKE_CURRENT_LIST_DIR}/genex_LINK_LANG_AND_ID-validation.cmake") diff --git a/Tests/RunCMake/add_link_options/genex_LINK_LANG_AND_ID-shared_c-result.txt b/Tests/RunCMake/add_link_options/genex_LINK_LANG_AND_ID-shared_c-result.txt new file mode 100644 index 0000000..8d98f9d --- /dev/null +++ b/Tests/RunCMake/add_link_options/genex_LINK_LANG_AND_ID-shared_c-result.txt @@ -0,0 +1 @@ +.* diff --git a/Tests/RunCMake/add_link_options/genex_LINK_LANG_AND_ID-shared_cxx-check.cmake b/Tests/RunCMake/add_link_options/genex_LINK_LANG_AND_ID-shared_cxx-check.cmake new file mode 100644 index 0000000..ed4f851 --- /dev/null +++ b/Tests/RunCMake/add_link_options/genex_LINK_LANG_AND_ID-shared_cxx-check.cmake @@ -0,0 +1,5 @@ + +set (VALID_LANG CXX) +set (INVALID_LANG C) + +include ("${CMAKE_CURRENT_LIST_DIR}/genex_LINK_LANG_AND_ID-validation.cmake") diff --git a/Tests/RunCMake/add_link_options/genex_LINK_LANG_AND_ID-shared_cxx-result.txt b/Tests/RunCMake/add_link_options/genex_LINK_LANG_AND_ID-shared_cxx-result.txt new file mode 100644 index 0000000..8d98f9d --- /dev/null +++ b/Tests/RunCMake/add_link_options/genex_LINK_LANG_AND_ID-shared_cxx-result.txt @@ -0,0 +1 @@ +.* diff --git a/Tests/RunCMake/add_link_options/genex_LINK_LANG_AND_ID-validation.cmake b/Tests/RunCMake/add_link_options/genex_LINK_LANG_AND_ID-validation.cmake new file mode 100644 index 0000000..a5dc27f --- /dev/null +++ b/Tests/RunCMake/add_link_options/genex_LINK_LANG_AND_ID-validation.cmake @@ -0,0 +1,23 @@ + +if (NOT VALID_LANG) + set (VALID_LANG C) +endif() +if (NOT INVALID_LANG) + set (INVALID_LANG CXX) +endif() + +if (NOT actual_stdout MATCHES "BADFLAG_${VALID_LANG}_LANG_ID") + set (RunCMake_TEST_FAILED "Not found expected 'BADFLAG_${VALID_LANG}_LANG_ID'.\n") +endif() +if (actual_stdout MATCHES "BADFLAG_${INVALID_LANG}_LANG_ID") + if (RunCMake_TEST_FAILED) + string (APPEND RunCMake_TEST_FAILED "\n") + endif() + string (APPEND RunCMake_TEST_FAILED "Found unexpected 'BADFLAG_${INVALID_LANG}_LANG_ID '.") +endif() +if (actual_stdout MATCHES "BADFLAG_(${VALID_LANG}|${INVALID_LANG})_BADID") + if (RunCMake_TEST_FAILED) + string (APPEND RunCMake_TEST_FAILED "\n") + endif() + string (APPEND RunCMake_TEST_FAILED "Found unexpected 'BADFLAG_(${VALID_LANG}|${INVALID_LANG})_BADID'.") +endif() diff --git a/Tests/RunCMake/add_link_options/genex_LINK_LANG_AND_ID.cmake b/Tests/RunCMake/add_link_options/genex_LINK_LANG_AND_ID.cmake new file mode 100644 index 0000000..c807050 --- /dev/null +++ b/Tests/RunCMake/add_link_options/genex_LINK_LANG_AND_ID.cmake @@ -0,0 +1,19 @@ + +enable_language(C) +enable_language(CXX) + +if(BORLAND) + set(pre -) +endif() + +add_link_options ($<$<LINK_LANG_AND_ID:C,${CMAKE_C_COMPILER_ID}>:${pre}BADFLAG_C_LANG_ID${CMAKE_C_OUTPUT_EXTENSION}> + $<$<LINK_LANG_AND_ID:CXX,${CMAKE_CXX_COMPILER_ID}>:${pre}BADFLAG_CXX_LANG_ID${CMAKE_CXX_OUTPUT_EXTENSION}> + $<$<LINK_LANG_AND_ID:C,BADID>:${pre}BADFLAG_C_BADID${CMAKE_C_OUTPUT_EXTENSION}> + $<$<LINK_LANG_AND_ID:CXX,BADID>:${pre}BADFLAG_CXX_BADID${CMAKE_CXX_OUTPUT_EXTENSION}>) + +add_library(LinkOptions_shared_c SHARED LinkOptionsLib.c) +add_library(LinkOptions_shared_cxx SHARED LinkOptionsLib.cxx) + +add_library(LinkOptions_mod MODULE LinkOptionsLib.c) + +add_executable(LinkOptions_exe LinkOptionsExe.c) diff --git a/Tests/RunCMake/cmake_command/CMakeLists.txt b/Tests/RunCMake/cmake_command/CMakeLists.txt new file mode 100644 index 0000000..2632ffa --- /dev/null +++ b/Tests/RunCMake/cmake_command/CMakeLists.txt @@ -0,0 +1,3 @@ +cmake_minimum_required(VERSION 3.16) +project(${RunCMake_TEST} NONE) +include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/cmake_command/RunCMakeTest.cmake b/Tests/RunCMake/cmake_command/RunCMakeTest.cmake new file mode 100644 index 0000000..2b6e7a2 --- /dev/null +++ b/Tests/RunCMake/cmake_command/RunCMakeTest.cmake @@ -0,0 +1,13 @@ +include(RunCMake) + +run_cmake(cmake_command_no_parameters) +run_cmake(cmake_command_unknown_meta_operation) +run_cmake(cmake_command_invoke_message) +run_cmake(cmake_command_invoke_message_fatal_error) +run_cmake(cmake_command_invoke_no_parameters) +run_cmake(cmake_command_invoke_unknown_function) +run_cmake(cmake_command_eval_message) +run_cmake(cmake_command_eval_message_fatal_error) +run_cmake(cmake_command_eval_no_code) +run_cmake(cmake_command_eval_no_parameters) +run_cmake(cmake_command_eval_variable_outside_message) diff --git a/Tests/RunCMake/cmake_command/cmake_command_eval_message-stderr.txt b/Tests/RunCMake/cmake_command/cmake_command_eval_message-stderr.txt new file mode 100644 index 0000000..cfc8694 --- /dev/null +++ b/Tests/RunCMake/cmake_command/cmake_command_eval_message-stderr.txt @@ -0,0 +1 @@ +WORKS! diff --git a/Tests/RunCMake/cmake_command/cmake_command_eval_message.cmake b/Tests/RunCMake/cmake_command/cmake_command_eval_message.cmake new file mode 100644 index 0000000..9ef5e25 --- /dev/null +++ b/Tests/RunCMake/cmake_command/cmake_command_eval_message.cmake @@ -0,0 +1 @@ +cmake_command(EVAL CODE message(WORKS!)) diff --git a/Tests/RunCMake/cmake_command/cmake_command_eval_message_fatal_error-result.txt b/Tests/RunCMake/cmake_command/cmake_command_eval_message_fatal_error-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/cmake_command/cmake_command_eval_message_fatal_error-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/cmake_command/cmake_command_eval_message_fatal_error-stderr.txt b/Tests/RunCMake/cmake_command/cmake_command_eval_message_fatal_error-stderr.txt new file mode 100644 index 0000000..6a8a124 --- /dev/null +++ b/Tests/RunCMake/cmake_command/cmake_command_eval_message_fatal_error-stderr.txt @@ -0,0 +1,5 @@ +CMake Error at cmake_command_eval_message_fatal_error.cmake:1:EVAL:2 \(message\): + error! +Call Stack \(most recent call first\): + cmake_command_eval_message_fatal_error.cmake:1 \(cmake_command\) + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/cmake_command/cmake_command_eval_message_fatal_error.cmake b/Tests/RunCMake/cmake_command/cmake_command_eval_message_fatal_error.cmake new file mode 100644 index 0000000..22913de --- /dev/null +++ b/Tests/RunCMake/cmake_command/cmake_command_eval_message_fatal_error.cmake @@ -0,0 +1,5 @@ +cmake_command(EVAL CODE +" + message(FATAL_ERROR error!) +" +) diff --git a/Tests/RunCMake/cmake_command/cmake_command_eval_no_code-result.txt b/Tests/RunCMake/cmake_command/cmake_command_eval_no_code-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/cmake_command/cmake_command_eval_no_code-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/cmake_command/cmake_command_eval_no_code-stderr.txt b/Tests/RunCMake/cmake_command/cmake_command_eval_no_code-stderr.txt new file mode 100644 index 0000000..ee53312 --- /dev/null +++ b/Tests/RunCMake/cmake_command/cmake_command_eval_no_code-stderr.txt @@ -0,0 +1,2 @@ +CMake Error at cmake_command_eval_no_code.cmake:1 \(cmake_command\): + cmake_command called without CODE argument diff --git a/Tests/RunCMake/cmake_command/cmake_command_eval_no_code.cmake b/Tests/RunCMake/cmake_command/cmake_command_eval_no_code.cmake new file mode 100644 index 0000000..22e1667 --- /dev/null +++ b/Tests/RunCMake/cmake_command/cmake_command_eval_no_code.cmake @@ -0,0 +1 @@ +cmake_command(EVAL message "too many parameters") diff --git a/Tests/RunCMake/cmake_command/cmake_command_eval_no_parameters-result.txt b/Tests/RunCMake/cmake_command/cmake_command_eval_no_parameters-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/cmake_command/cmake_command_eval_no_parameters-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/cmake_command/cmake_command_eval_no_parameters-stderr.txt b/Tests/RunCMake/cmake_command/cmake_command_eval_no_parameters-stderr.txt new file mode 100644 index 0000000..e9fc317 --- /dev/null +++ b/Tests/RunCMake/cmake_command/cmake_command_eval_no_parameters-stderr.txt @@ -0,0 +1,2 @@ +CMake Error at cmake_command_eval_no_parameters.cmake:1 \(cmake_command\): + cmake_command called with incorrect number of arguments diff --git a/Tests/RunCMake/cmake_command/cmake_command_eval_no_parameters.cmake b/Tests/RunCMake/cmake_command/cmake_command_eval_no_parameters.cmake new file mode 100644 index 0000000..a5ba2c7 --- /dev/null +++ b/Tests/RunCMake/cmake_command/cmake_command_eval_no_parameters.cmake @@ -0,0 +1 @@ +cmake_command(EVAL) diff --git a/Tests/RunCMake/cmake_command/cmake_command_eval_variable_outside_message-stderr.txt b/Tests/RunCMake/cmake_command/cmake_command_eval_variable_outside_message-stderr.txt new file mode 100644 index 0000000..cfc8694 --- /dev/null +++ b/Tests/RunCMake/cmake_command/cmake_command_eval_variable_outside_message-stderr.txt @@ -0,0 +1 @@ +WORKS! diff --git a/Tests/RunCMake/cmake_command/cmake_command_eval_variable_outside_message.cmake b/Tests/RunCMake/cmake_command/cmake_command_eval_variable_outside_message.cmake new file mode 100644 index 0000000..b7a06a5 --- /dev/null +++ b/Tests/RunCMake/cmake_command/cmake_command_eval_variable_outside_message.cmake @@ -0,0 +1,2 @@ +cmake_command(EVAL CODE "set(phrase \"WORKS!\")") +message(${phrase}) diff --git a/Tests/RunCMake/cmake_command/cmake_command_invoke_message-stderr.txt b/Tests/RunCMake/cmake_command/cmake_command_invoke_message-stderr.txt new file mode 100644 index 0000000..cfc8694 --- /dev/null +++ b/Tests/RunCMake/cmake_command/cmake_command_invoke_message-stderr.txt @@ -0,0 +1 @@ +WORKS! diff --git a/Tests/RunCMake/cmake_command/cmake_command_invoke_message.cmake b/Tests/RunCMake/cmake_command/cmake_command_invoke_message.cmake new file mode 100644 index 0000000..336d78a --- /dev/null +++ b/Tests/RunCMake/cmake_command/cmake_command_invoke_message.cmake @@ -0,0 +1 @@ +cmake_command(INVOKE message WORKS!) diff --git a/Tests/RunCMake/cmake_command/cmake_command_invoke_message_fatal_error-result.txt b/Tests/RunCMake/cmake_command/cmake_command_invoke_message_fatal_error-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/cmake_command/cmake_command_invoke_message_fatal_error-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/cmake_command/cmake_command_invoke_message_fatal_error-stderr.txt b/Tests/RunCMake/cmake_command/cmake_command_invoke_message_fatal_error-stderr.txt new file mode 100644 index 0000000..2c9dab5 --- /dev/null +++ b/Tests/RunCMake/cmake_command/cmake_command_invoke_message_fatal_error-stderr.txt @@ -0,0 +1,5 @@ +CMake Error at cmake_command_invoke_message_fatal_error.cmake:1 \(message\): + error! +Call Stack \(most recent call first\): + cmake_command_invoke_message_fatal_error.cmake:1 \(cmake_command\) + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/cmake_command/cmake_command_invoke_message_fatal_error.cmake b/Tests/RunCMake/cmake_command/cmake_command_invoke_message_fatal_error.cmake new file mode 100644 index 0000000..6b42764 --- /dev/null +++ b/Tests/RunCMake/cmake_command/cmake_command_invoke_message_fatal_error.cmake @@ -0,0 +1 @@ +cmake_command(INVOKE message FATAL_ERROR error!) diff --git a/Tests/RunCMake/cmake_command/cmake_command_invoke_no_parameters-result.txt b/Tests/RunCMake/cmake_command/cmake_command_invoke_no_parameters-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/cmake_command/cmake_command_invoke_no_parameters-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/cmake_command/cmake_command_invoke_no_parameters-stderr.txt b/Tests/RunCMake/cmake_command/cmake_command_invoke_no_parameters-stderr.txt new file mode 100644 index 0000000..7741b41 --- /dev/null +++ b/Tests/RunCMake/cmake_command/cmake_command_invoke_no_parameters-stderr.txt @@ -0,0 +1,2 @@ +CMake Error at cmake_command_invoke_no_parameters.cmake:1 \(cmake_command\): + cmake_command called with incorrect number of arguments diff --git a/Tests/RunCMake/cmake_command/cmake_command_invoke_no_parameters.cmake b/Tests/RunCMake/cmake_command/cmake_command_invoke_no_parameters.cmake new file mode 100644 index 0000000..b9c5e14 --- /dev/null +++ b/Tests/RunCMake/cmake_command/cmake_command_invoke_no_parameters.cmake @@ -0,0 +1 @@ +cmake_command(INVOKE) diff --git a/Tests/RunCMake/cmake_command/cmake_command_invoke_unknown_function-result.txt b/Tests/RunCMake/cmake_command/cmake_command_invoke_unknown_function-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/cmake_command/cmake_command_invoke_unknown_function-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/cmake_command/cmake_command_invoke_unknown_function-stderr.txt b/Tests/RunCMake/cmake_command/cmake_command_invoke_unknown_function-stderr.txt new file mode 100644 index 0000000..50a81a3 --- /dev/null +++ b/Tests/RunCMake/cmake_command/cmake_command_invoke_unknown_function-stderr.txt @@ -0,0 +1,2 @@ +CMake Error at cmake_command_invoke_unknown_function.cmake:1 \(unknown\): + Unknown CMake command "unknown". diff --git a/Tests/RunCMake/cmake_command/cmake_command_invoke_unknown_function.cmake b/Tests/RunCMake/cmake_command/cmake_command_invoke_unknown_function.cmake new file mode 100644 index 0000000..f19a04b --- /dev/null +++ b/Tests/RunCMake/cmake_command/cmake_command_invoke_unknown_function.cmake @@ -0,0 +1 @@ +cmake_command(INVOKE unknown) diff --git a/Tests/RunCMake/cmake_command/cmake_command_no_parameters-result.txt b/Tests/RunCMake/cmake_command/cmake_command_no_parameters-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/cmake_command/cmake_command_no_parameters-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/cmake_command/cmake_command_no_parameters-stderr.txt b/Tests/RunCMake/cmake_command/cmake_command_no_parameters-stderr.txt new file mode 100644 index 0000000..772b604 --- /dev/null +++ b/Tests/RunCMake/cmake_command/cmake_command_no_parameters-stderr.txt @@ -0,0 +1,2 @@ +CMake Error at cmake_command_no_parameters.cmake:1 \(cmake_command\): + cmake_command called with incorrect number of arguments diff --git a/Tests/RunCMake/cmake_command/cmake_command_no_parameters.cmake b/Tests/RunCMake/cmake_command/cmake_command_no_parameters.cmake new file mode 100644 index 0000000..b9c5e14 --- /dev/null +++ b/Tests/RunCMake/cmake_command/cmake_command_no_parameters.cmake @@ -0,0 +1 @@ +cmake_command(INVOKE) diff --git a/Tests/RunCMake/cmake_command/cmake_command_unknown_meta_operation-result.txt b/Tests/RunCMake/cmake_command/cmake_command_unknown_meta_operation-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/cmake_command/cmake_command_unknown_meta_operation-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/cmake_command/cmake_command_unknown_meta_operation-stderr.txt b/Tests/RunCMake/cmake_command/cmake_command_unknown_meta_operation-stderr.txt new file mode 100644 index 0000000..7b9b915 --- /dev/null +++ b/Tests/RunCMake/cmake_command/cmake_command_unknown_meta_operation-stderr.txt @@ -0,0 +1,2 @@ +CMake Error at cmake_command_unknown_meta_operation.cmake:1 \(cmake_command\): + cmake_command called with unknown meta-operation diff --git a/Tests/RunCMake/cmake_command/cmake_command_unknown_meta_operation.cmake b/Tests/RunCMake/cmake_command/cmake_command_unknown_meta_operation.cmake new file mode 100644 index 0000000..f7c77e5 --- /dev/null +++ b/Tests/RunCMake/cmake_command/cmake_command_unknown_meta_operation.cmake @@ -0,0 +1 @@ +cmake_command(UNKNOWN) diff --git a/Tests/RunCMake/configure_file/RerunCMake.cmake b/Tests/RunCMake/configure_file/RerunCMake.cmake index 890cc1f..98387d0 100644 --- a/Tests/RunCMake/configure_file/RerunCMake.cmake +++ b/Tests/RunCMake/configure_file/RerunCMake.cmake @@ -1,8 +1,4 @@ message("Running CMake on RerunCMake") # write to stderr if cmake reruns -configure_file( - "${CMAKE_CURRENT_BINARY_DIR}/ConfigureFileInput.txt.in" - "${CMAKE_CURRENT_BINARY_DIR}/ConfigureFileOutput.txt" - @ONLY - ) +add_subdirectory(RerunCMake) # make sure CMakeCache.txt is newer than ConfigureFileOutput.txt execute_process(COMMAND ${CMAKE_COMMAND} -E sleep 1) diff --git a/Tests/RunCMake/configure_file/RerunCMake/CMakeLists.txt b/Tests/RunCMake/configure_file/RerunCMake/CMakeLists.txt new file mode 100644 index 0000000..c9681c7 --- /dev/null +++ b/Tests/RunCMake/configure_file/RerunCMake/CMakeLists.txt @@ -0,0 +1,5 @@ +configure_file( + "${CMAKE_CURRENT_BINARY_DIR}/ConfigureFileInput.txt.in" + "${CMAKE_CURRENT_BINARY_DIR}/ConfigureFileOutput.txt" + @ONLY + ) diff --git a/Tests/RunCMake/configure_file/RunCMakeTest.cmake b/Tests/RunCMake/configure_file/RunCMakeTest.cmake index de14468..32a0770 100644 --- a/Tests/RunCMake/configure_file/RunCMakeTest.cmake +++ b/Tests/RunCMake/configure_file/RunCMakeTest.cmake @@ -22,7 +22,7 @@ if(RunCMake_GENERATOR MATCHES "Make") set(RunCMake_TEST_NO_CLEAN 1) file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}") file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}") - set(in_conf "${RunCMake_TEST_BINARY_DIR}/ConfigureFileInput.txt.in") + set(in_conf "${RunCMake_TEST_BINARY_DIR}/RerunCMake/ConfigureFileInput.txt.in") file(WRITE "${in_conf}" "1") message(STATUS "RerunCMake: first configuration...") @@ -42,7 +42,7 @@ if(RunCMake_GENERATOR MATCHES "Make") run_cmake_command(RerunCMake-nowork ${CMAKE_COMMAND} --build .) message(STATUS "RerunCMake: remove configure_file output...") - file(REMOVE "${RunCMake_TEST_BINARY_DIR}/ConfigureFileOutput.txt") + file(REMOVE "${RunCMake_TEST_BINARY_DIR}/RerunCMake/ConfigureFileOutput.txt") run_cmake_command(RerunCMake-rerun ${CMAKE_COMMAND} --build .) run_cmake_command(RerunCMake-nowork ${CMAKE_COMMAND} --build .) diff --git a/Tests/RunCMake/execute_process/EchoVariable-stderr.txt b/Tests/RunCMake/execute_process/EchoVariable-stderr.txt new file mode 100644 index 0000000..d927553 --- /dev/null +++ b/Tests/RunCMake/execute_process/EchoVariable-stderr.txt @@ -0,0 +1,3 @@ +CMake Error at [^ +]*EchoVariableOutput.cmake:2 \(message\): + Text to stderr diff --git a/Tests/RunCMake/execute_process/EchoVariable-stdout.txt b/Tests/RunCMake/execute_process/EchoVariable-stdout.txt new file mode 100644 index 0000000..7c868bd --- /dev/null +++ b/Tests/RunCMake/execute_process/EchoVariable-stdout.txt @@ -0,0 +1 @@ +-- Text to stdout diff --git a/Tests/RunCMake/execute_process/EchoVariable.cmake b/Tests/RunCMake/execute_process/EchoVariable.cmake new file mode 100644 index 0000000..99999c7 --- /dev/null +++ b/Tests/RunCMake/execute_process/EchoVariable.cmake @@ -0,0 +1,23 @@ +execute_process( + COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_LIST_DIR}/EchoVariableOutput.cmake + OUTPUT_VARIABLE stdout + ERROR_QUIET + ECHO_OUTPUT_VARIABLE +) + +file(READ ${CMAKE_CURRENT_LIST_DIR}/EchoVariable-stdout.txt expected_stdout) +if (NOT stdout MATCHES "${expected_stdout}") + message(FATAL_ERROR "stdout differs from the expected stdout") +endif() + +execute_process( + COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_LIST_DIR}/EchoVariableOutput.cmake + ERROR_VARIABLE stderr + OUTPUT_QUIET + ECHO_ERROR_VARIABLE +) + +file(READ ${CMAKE_CURRENT_LIST_DIR}/EchoVariable-stderr.txt expected_stderr) +if (NOT stderr MATCHES "${expected_stderr}") + message(FATAL_ERROR "stderr differs from the expected stderr") +endif() diff --git a/Tests/RunCMake/execute_process/EchoVariableOutput.cmake b/Tests/RunCMake/execute_process/EchoVariableOutput.cmake new file mode 100644 index 0000000..e636567 --- /dev/null +++ b/Tests/RunCMake/execute_process/EchoVariableOutput.cmake @@ -0,0 +1,2 @@ +message(STATUS "Text to stdout") +message(FATAL_ERROR "Text to stderr") diff --git a/Tests/RunCMake/execute_process/RunCMakeTest.cmake b/Tests/RunCMake/execute_process/RunCMakeTest.cmake index b203aab..89ad6b2 100644 --- a/Tests/RunCMake/execute_process/RunCMakeTest.cmake +++ b/Tests/RunCMake/execute_process/RunCMakeTest.cmake @@ -24,3 +24,5 @@ run_cmake_command(EchoCommand2 ${CMAKE_COMMAND} -P run_cmake_command(EchoCommand3 ${CMAKE_COMMAND} -DCHECK_ERROR_OUTPUT_LOCATION=TRUE -P ${RunCMake_SOURCE_DIR}/EchoCommand.cmake) + +run_cmake_command(EchoVariable ${CMAKE_COMMAND} -P ${RunCMake_SOURCE_DIR}/EchoVariable.cmake) diff --git a/Tests/RunCMake/find_file/Required-result.txt b/Tests/RunCMake/find_file/Required-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/find_file/Required-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/find_file/Required-stderr.txt b/Tests/RunCMake/find_file/Required-stderr.txt new file mode 100644 index 0000000..f9c337c --- /dev/null +++ b/Tests/RunCMake/find_file/Required-stderr.txt @@ -0,0 +1,4 @@ +CMake Error at Required.cmake:9 \(find_file\): + Could not find FILE_doNotExists using the following files: doNotExists.h +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/find_file/Required-stdout.txt b/Tests/RunCMake/find_file/Required-stdout.txt new file mode 100644 index 0000000..87a8e86 --- /dev/null +++ b/Tests/RunCMake/find_file/Required-stdout.txt @@ -0,0 +1 @@ +-- FILE_exists='[^']*/Tests/RunCMake/find_file/include/PrefixInPATH.h' diff --git a/Tests/RunCMake/find_file/Required.cmake b/Tests/RunCMake/find_file/Required.cmake new file mode 100644 index 0000000..9cf0927 --- /dev/null +++ b/Tests/RunCMake/find_file/Required.cmake @@ -0,0 +1,12 @@ +find_file(FILE_exists + NAMES PrefixInPATH.h + PATHS ${CMAKE_CURRENT_SOURCE_DIR}/include + NO_DEFAULT_PATH + REQUIRED + ) +message(STATUS "FILE_exists='${FILE_exists}'") + +find_file(FILE_doNotExists + NAMES doNotExists.h + REQUIRED + ) diff --git a/Tests/RunCMake/find_file/RunCMakeTest.cmake b/Tests/RunCMake/find_file/RunCMakeTest.cmake index 9f56a57..93dfb78 100644 --- a/Tests/RunCMake/find_file/RunCMakeTest.cmake +++ b/Tests/RunCMake/find_file/RunCMakeTest.cmake @@ -3,3 +3,4 @@ include(RunCMake) run_cmake(FromPATHEnv) run_cmake(FromPrefixPath) run_cmake(PrefixInPATH) +run_cmake(Required) diff --git a/Tests/RunCMake/find_library/Required-result.txt b/Tests/RunCMake/find_library/Required-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/find_library/Required-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/find_library/Required-stderr.txt b/Tests/RunCMake/find_library/Required-stderr.txt new file mode 100644 index 0000000..545d164 --- /dev/null +++ b/Tests/RunCMake/find_library/Required-stderr.txt @@ -0,0 +1,4 @@ +CMake Error at Required.cmake:11 \(find_library\): + Could not find LIB_doNotExists using the following names: doNotExists +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/find_library/Required-stdout.txt b/Tests/RunCMake/find_library/Required-stdout.txt new file mode 100644 index 0000000..b88ab79 --- /dev/null +++ b/Tests/RunCMake/find_library/Required-stdout.txt @@ -0,0 +1 @@ +-- LIB_exists='[^']*/Tests/RunCMake/find_library/lib/libPrefixInPATH.a' diff --git a/Tests/RunCMake/find_library/Required.cmake b/Tests/RunCMake/find_library/Required.cmake new file mode 100644 index 0000000..78c9f87 --- /dev/null +++ b/Tests/RunCMake/find_library/Required.cmake @@ -0,0 +1,14 @@ +list(APPEND CMAKE_FIND_LIBRARY_PREFIXES lib) +list(APPEND CMAKE_FIND_LIBRARY_SUFFIXES .a) +find_library(LIB_exists + NAMES PrefixInPATH + PATHS ${CMAKE_CURRENT_SOURCE_DIR}/lib + NO_DEFAULT_PATH + REQUIRED + ) +message(STATUS "LIB_exists='${LIB_exists}'") + +find_library(LIB_doNotExists + NAMES doNotExists + REQUIRED + ) diff --git a/Tests/RunCMake/find_library/RunCMakeTest.cmake b/Tests/RunCMake/find_library/RunCMakeTest.cmake index 643a5b9..b6aadce 100644 --- a/Tests/RunCMake/find_library/RunCMakeTest.cmake +++ b/Tests/RunCMake/find_library/RunCMakeTest.cmake @@ -7,3 +7,4 @@ if(CMAKE_HOST_UNIX) run_cmake(LibArchLink) endif() run_cmake(PrefixInPATH) +run_cmake(Required) diff --git a/Tests/RunCMake/find_path/Required-result.txt b/Tests/RunCMake/find_path/Required-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/find_path/Required-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/find_path/Required-stderr.txt b/Tests/RunCMake/find_path/Required-stderr.txt new file mode 100644 index 0000000..db65c2f --- /dev/null +++ b/Tests/RunCMake/find_path/Required-stderr.txt @@ -0,0 +1,4 @@ +CMake Error at Required.cmake:9 \(find_path\): + Could not find PATH_doNotExists using the following files: doNotExists.h +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/find_path/Required-stdout.txt b/Tests/RunCMake/find_path/Required-stdout.txt new file mode 100644 index 0000000..225fcab --- /dev/null +++ b/Tests/RunCMake/find_path/Required-stdout.txt @@ -0,0 +1 @@ +-- PATH_exists='[^']*/Tests/RunCMake/find_path/include' diff --git a/Tests/RunCMake/find_path/Required.cmake b/Tests/RunCMake/find_path/Required.cmake new file mode 100644 index 0000000..172dc11 --- /dev/null +++ b/Tests/RunCMake/find_path/Required.cmake @@ -0,0 +1,12 @@ +find_path(PATH_exists + NAMES PrefixInPATH.h + PATHS ${CMAKE_CURRENT_SOURCE_DIR}/include + NO_DEFAULT_PATH + REQUIRED + ) +message(STATUS "PATH_exists='${PATH_exists}'") + +find_path(PATH_doNotExists + NAMES doNotExists.h + REQUIRED + ) diff --git a/Tests/RunCMake/find_path/RunCMakeTest.cmake b/Tests/RunCMake/find_path/RunCMakeTest.cmake index ed55f51..5c919bb 100644 --- a/Tests/RunCMake/find_path/RunCMakeTest.cmake +++ b/Tests/RunCMake/find_path/RunCMakeTest.cmake @@ -3,6 +3,7 @@ include(RunCMake) run_cmake(EmptyOldStyle) run_cmake(FromPATHEnv) run_cmake(PrefixInPATH) +run_cmake(Required) if(APPLE) run_cmake(FrameworksWithSubdirs) diff --git a/Tests/RunCMake/find_program/Required-result.txt b/Tests/RunCMake/find_program/Required-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/find_program/Required-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/find_program/Required-stderr.txt b/Tests/RunCMake/find_program/Required-stderr.txt new file mode 100644 index 0000000..214a8d4 --- /dev/null +++ b/Tests/RunCMake/find_program/Required-stderr.txt @@ -0,0 +1,4 @@ +CMake Error at Required.cmake:9 \(find_program\): + Could not find PROG_AandB using the following names: testAandB +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/find_program/Required-stdout.txt b/Tests/RunCMake/find_program/Required-stdout.txt new file mode 100644 index 0000000..3c8f1b5 --- /dev/null +++ b/Tests/RunCMake/find_program/Required-stdout.txt @@ -0,0 +1 @@ +-- PROG_A='[^']*/Tests/RunCMake/find_program/A/testA' diff --git a/Tests/RunCMake/find_program/Required.cmake b/Tests/RunCMake/find_program/Required.cmake new file mode 100644 index 0000000..a75aa53 --- /dev/null +++ b/Tests/RunCMake/find_program/Required.cmake @@ -0,0 +1,12 @@ +find_program(PROG_A + NAMES testA + PATHS ${CMAKE_CURRENT_SOURCE_DIR}/A + NO_DEFAULT_PATH + REQUIRED + ) +message(STATUS "PROG_A='${PROG_A}'") + +find_program(PROG_AandB + NAMES testAandB + REQUIRED + ) diff --git a/Tests/RunCMake/find_program/RunCMakeTest.cmake b/Tests/RunCMake/find_program/RunCMakeTest.cmake index 6903f05..0ff9a97 100644 --- a/Tests/RunCMake/find_program/RunCMakeTest.cmake +++ b/Tests/RunCMake/find_program/RunCMakeTest.cmake @@ -4,6 +4,7 @@ run_cmake(EnvAndHints) run_cmake(DirsPerName) run_cmake(NamesPerDir) run_cmake(RelAndAbsPath) +run_cmake(Required) if(CMAKE_SYSTEM_NAME MATCHES "^(Windows|CYGWIN)$") run_cmake(WindowsCom) diff --git a/Tests/RunCMake/string/Hex.cmake b/Tests/RunCMake/string/Hex.cmake new file mode 100644 index 0000000..1c5aaa1 --- /dev/null +++ b/Tests/RunCMake/string/Hex.cmake @@ -0,0 +1,20 @@ +function(assert_strequal input actual expected) + if(NOT expected STREQUAL actual) + message(SEND_ERROR "Output did not match expected\nInput string:\n ${input}\nExpected:\n ${expected}\nActual:\n ${actual}") + endif() +endfunction() + +set(_input1 "The quick brown fox jumps over the lazy dog.") +string(HEX "${_input1}" _result1) +assert_strequal("${_input1}" "${_result1}" "54686520717569636b2062726f776e20666f78206a756d7073206f76657220746865206c617a7920646f672e") + +set(_input2 "Hello world!") +string(HEX "${_input2}" _result2) +assert_strequal("${_input2}" "${_result2}" "48656c6c6f20776f726c6421") + +set(_input3 "Ash nazg durbatulûk\nAsh nazg gimbatul\nAsh nazg thrakatulûk\nAgh burzum-ishi krimpatul") +string(HEX "${_input3}" _result3) +assert_strequal("${_input3}" "${_result3}" "417368206e617a6720647572626174756cc3bb6b0a417368206e617a672067696d626174756c0a417368206e617a6720746872616b6174756cc3bb6b0a416768206275727a756d2d69736869206b72696d706174756c") + +string(HEX "" _result_empty) +assert_strequal("" "${_result_empty}" "") diff --git a/Tests/RunCMake/string/HexNotEnoughArgs-result.txt b/Tests/RunCMake/string/HexNotEnoughArgs-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/string/HexNotEnoughArgs-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/string/HexNotEnoughArgs-stderr.txt b/Tests/RunCMake/string/HexNotEnoughArgs-stderr.txt new file mode 100644 index 0000000..444f79d --- /dev/null +++ b/Tests/RunCMake/string/HexNotEnoughArgs-stderr.txt @@ -0,0 +1,4 @@ +^CMake Error at HexNotEnoughArgs\.cmake:[0-9]+ \(string\): + string Incorrect number of arguments +Call Stack \(most recent call first\): + CMakeLists\.txt:3 \(include\)$ diff --git a/Tests/RunCMake/string/HexNotEnoughArgs.cmake b/Tests/RunCMake/string/HexNotEnoughArgs.cmake new file mode 100644 index 0000000..7002af0 --- /dev/null +++ b/Tests/RunCMake/string/HexNotEnoughArgs.cmake @@ -0,0 +1 @@ +string(HEX "Hello world!") diff --git a/Tests/RunCMake/string/HexTooManyArgs-result.txt b/Tests/RunCMake/string/HexTooManyArgs-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/string/HexTooManyArgs-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/string/HexTooManyArgs-stderr.txt b/Tests/RunCMake/string/HexTooManyArgs-stderr.txt new file mode 100644 index 0000000..91b40ed --- /dev/null +++ b/Tests/RunCMake/string/HexTooManyArgs-stderr.txt @@ -0,0 +1,4 @@ +^CMake Error at HexTooManyArgs\.cmake:[0-9]+ \(string\): + string Incorrect number of arguments +Call Stack \(most recent call first\): + CMakeLists\.txt:3 \(include\)$ diff --git a/Tests/RunCMake/string/HexTooManyArgs.cmake b/Tests/RunCMake/string/HexTooManyArgs.cmake new file mode 100644 index 0000000..8986cf8 --- /dev/null +++ b/Tests/RunCMake/string/HexTooManyArgs.cmake @@ -0,0 +1 @@ +string(HEX "Hello world!" _output bad) diff --git a/Tests/RunCMake/string/RunCMakeTest.cmake b/Tests/RunCMake/string/RunCMakeTest.cmake index c432b4e..bb7cb17 100644 --- a/Tests/RunCMake/string/RunCMakeTest.cmake +++ b/Tests/RunCMake/string/RunCMakeTest.cmake @@ -37,3 +37,7 @@ run_cmake(UTF-32LE) run_cmake(Repeat) run_cmake(RepeatNoArgs) run_cmake(RepeatNegativeCount) + +run_cmake(Hex) +run_cmake(HexTooManyArgs) +run_cmake(HexNotEnoughArgs) diff --git a/Tests/RunCMake/target_link_directories/CMP0099.cmake b/Tests/RunCMake/target_link_directories/CMP0099.cmake index a2be279..aff1e33 100644 --- a/Tests/RunCMake/target_link_directories/CMP0099.cmake +++ b/Tests/RunCMake/target_link_directories/CMP0099.cmake @@ -5,7 +5,7 @@ set(CMAKE_VERBOSE_MAKEFILE TRUE) set(CMAKE_C_USE_RESPONSE_FILE_FOR_LIBRARIES FALSE) add_library(LinkDirs_interface INTERFACE) -target_link_directories (LinkDirs_interface INTERFACE "/DIR_INTERFACE"}) +target_link_directories (LinkDirs_interface INTERFACE "/DIR_INTERFACE") add_library(LinkDirs_static STATIC lib.c) target_link_libraries (LinkDirs_static PRIVATE LinkDirs_interface) diff --git a/Tests/RunCMake/target_link_directories/RunCMakeTest.cmake b/Tests/RunCMake/target_link_directories/RunCMakeTest.cmake index a74ee25..699e871 100644 --- a/Tests/RunCMake/target_link_directories/RunCMakeTest.cmake +++ b/Tests/RunCMake/target_link_directories/RunCMakeTest.cmake @@ -21,10 +21,21 @@ if(RunCMake_GENERATOR MATCHES "(Ninja|Makefiles)" AND set(VERBOSE -- -v) endif() + run_cmake(genex_LINK_LANGUAGE) + run_cmake_target(genex_LINK_LANGUAGE interface LinkDirs_exe_interface --config Release ${VERBOSE}) + run_cmake_target(genex_LINK_LANGUAGE basic LinkDirs_exe_c --config Release ${VERBOSE}) + run_cmake_target(genex_LINK_LANGUAGE LINKER_LANGUAGE LinkDirs_exe_cxx --config Release ${VERBOSE}) + + run_cmake(genex_LINK_LANG_AND_ID) + + run_cmake_target(genex_LINK_LANG_AND_ID interface LinkDirs_exe_interface --config Release ${VERBOSE}) + run_cmake_target(genex_LINK_LANG_AND_ID basic LinkDirs_exe_c --config Release ${VERBOSE}) + run_cmake_target(genex_LINK_LANG_AND_ID LINKER_LANGUAGE LinkDirs_exe_cxx --config Release ${VERBOSE}) + + run_cmake(CMP0099-NEW) run_cmake_target(CMP0099-NEW basic LinkDirs_exe ${VERBOSE}) - run_cmake(CMP0099-OLD) run_cmake_target(CMP0099-OLD basic LinkDirs_exe ${VERBOSE}) diff --git a/Tests/RunCMake/target_link_directories/genex_LINK_LANGUAGE-LINKER_LANGUAGE-check.cmake b/Tests/RunCMake/target_link_directories/genex_LINK_LANGUAGE-LINKER_LANGUAGE-check.cmake new file mode 100644 index 0000000..aa39810 --- /dev/null +++ b/Tests/RunCMake/target_link_directories/genex_LINK_LANGUAGE-LINKER_LANGUAGE-check.cmake @@ -0,0 +1,5 @@ + +set (VALID_LANG CXX) +set (INVALID_LANG C) + +include ("${CMAKE_CURRENT_LIST_DIR}/genex_LINK_LANGUAGE-validation.cmake") diff --git a/Tests/RunCMake/target_link_directories/genex_LINK_LANGUAGE-LINKER_LANGUAGE-result.txt b/Tests/RunCMake/target_link_directories/genex_LINK_LANGUAGE-LINKER_LANGUAGE-result.txt new file mode 100644 index 0000000..8d98f9d --- /dev/null +++ b/Tests/RunCMake/target_link_directories/genex_LINK_LANGUAGE-LINKER_LANGUAGE-result.txt @@ -0,0 +1 @@ +.* diff --git a/Tests/RunCMake/target_link_directories/genex_LINK_LANGUAGE-basic-check.cmake b/Tests/RunCMake/target_link_directories/genex_LINK_LANGUAGE-basic-check.cmake new file mode 100644 index 0000000..71f641d --- /dev/null +++ b/Tests/RunCMake/target_link_directories/genex_LINK_LANGUAGE-basic-check.cmake @@ -0,0 +1,2 @@ + +include ("${CMAKE_CURRENT_LIST_DIR}/genex_LINK_LANGUAGE-validation.cmake") diff --git a/Tests/RunCMake/target_link_directories/genex_LINK_LANGUAGE-basic-result.txt b/Tests/RunCMake/target_link_directories/genex_LINK_LANGUAGE-basic-result.txt new file mode 100644 index 0000000..8d98f9d --- /dev/null +++ b/Tests/RunCMake/target_link_directories/genex_LINK_LANGUAGE-basic-result.txt @@ -0,0 +1 @@ +.* diff --git a/Tests/RunCMake/target_link_directories/genex_LINK_LANGUAGE-interface-check.cmake b/Tests/RunCMake/target_link_directories/genex_LINK_LANGUAGE-interface-check.cmake new file mode 100644 index 0000000..8313de6 --- /dev/null +++ b/Tests/RunCMake/target_link_directories/genex_LINK_LANGUAGE-interface-check.cmake @@ -0,0 +1,4 @@ + +set (TYPE INTERFACE) + +include ("${CMAKE_CURRENT_LIST_DIR}/genex_LINK_LANGUAGE-validation.cmake") diff --git a/Tests/RunCMake/target_link_directories/genex_LINK_LANGUAGE-interface-result.txt b/Tests/RunCMake/target_link_directories/genex_LINK_LANGUAGE-interface-result.txt new file mode 100644 index 0000000..8d98f9d --- /dev/null +++ b/Tests/RunCMake/target_link_directories/genex_LINK_LANGUAGE-interface-result.txt @@ -0,0 +1 @@ +.* diff --git a/Tests/RunCMake/target_link_directories/genex_LINK_LANGUAGE-validation.cmake b/Tests/RunCMake/target_link_directories/genex_LINK_LANGUAGE-validation.cmake new file mode 100644 index 0000000..298564e --- /dev/null +++ b/Tests/RunCMake/target_link_directories/genex_LINK_LANGUAGE-validation.cmake @@ -0,0 +1,20 @@ + +if (NOT VALID_LANG) + set (VALID_LANG C) +endif() +if (NOT INVALID_LANG) + set (INVALID_LANG CXX) +endif() +if (NOT TYPE) + set (TYPE EXE) +endif() + +if (NOT actual_stdout MATCHES "DIR_${VALID_LANG}_${TYPE}") + set (RunCMake_TEST_FAILED "Not found expected 'DIR_${VALID_LANG}_${TYPE}'.") +endif() +if (actual_stdout MATCHES "DIR_${INVALID_LANG}_${TYPE}") + if (RunCMake_TEST_FAILED) + string (APPEND RunCMake_TEST_FAILED "\n") + endif() + string (APPEND RunCMake_TEST_FAILED "Found unexpected 'DIR_${INVALID_LANG}_${TYPE}'.") +endif() diff --git a/Tests/RunCMake/target_link_directories/genex_LINK_LANGUAGE.cmake b/Tests/RunCMake/target_link_directories/genex_LINK_LANGUAGE.cmake new file mode 100644 index 0000000..1f266b1 --- /dev/null +++ b/Tests/RunCMake/target_link_directories/genex_LINK_LANGUAGE.cmake @@ -0,0 +1,23 @@ + +enable_language(C) +enable_language(CXX) + +set(CMAKE_VERBOSE_MAKEFILE TRUE) +set(CMAKE_C_USE_RESPONSE_FILE_FOR_LIBRARIES FALSE) +set(CMAKE_CXX_USE_RESPONSE_FILE_FOR_LIBRARIES FALSE) + +add_library(LinkDirs_interface INTERFACE) +target_link_directories (LinkDirs_interface INTERFACE "$<$<LINK_LANGUAGE:C>:/DIR_C_INTERFACE>" + "$<$<LINK_LANGUAGE:CXX>:/DIR_CXX_INTERFACE>") + +add_executable(LinkDirs_exe_interface exe.c) +target_link_libraries (LinkDirs_exe_interface PRIVATE LinkDirs_interface) + +add_executable(LinkDirs_exe_c exe.c) +target_link_directories (LinkDirs_exe_c PRIVATE "$<$<LINK_LANGUAGE:C>:/DIR_C_EXE>" + "$<$<LINK_LANGUAGE:CXX>:/DIR_CXX_EXE>") + +add_executable(LinkDirs_exe_cxx exe.c) +target_link_directories (LinkDirs_exe_cxx PRIVATE "$<$<LINK_LANGUAGE:C>:/DIR_C_EXE>" + "$<$<LINK_LANGUAGE:CXX>:/DIR_CXX_EXE>") +set_property (TARGET LinkDirs_exe_cxx PROPERTY LINKER_LANGUAGE CXX) diff --git a/Tests/RunCMake/target_link_directories/genex_LINK_LANG_AND_ID-LINKER_LANGUAGE-check.cmake b/Tests/RunCMake/target_link_directories/genex_LINK_LANG_AND_ID-LINKER_LANGUAGE-check.cmake new file mode 100644 index 0000000..ed4f851 --- /dev/null +++ b/Tests/RunCMake/target_link_directories/genex_LINK_LANG_AND_ID-LINKER_LANGUAGE-check.cmake @@ -0,0 +1,5 @@ + +set (VALID_LANG CXX) +set (INVALID_LANG C) + +include ("${CMAKE_CURRENT_LIST_DIR}/genex_LINK_LANG_AND_ID-validation.cmake") diff --git a/Tests/RunCMake/target_link_directories/genex_LINK_LANG_AND_ID-LINKER_LANGUAGE-result.txt b/Tests/RunCMake/target_link_directories/genex_LINK_LANG_AND_ID-LINKER_LANGUAGE-result.txt new file mode 100644 index 0000000..8d98f9d --- /dev/null +++ b/Tests/RunCMake/target_link_directories/genex_LINK_LANG_AND_ID-LINKER_LANGUAGE-result.txt @@ -0,0 +1 @@ +.* diff --git a/Tests/RunCMake/target_link_directories/genex_LINK_LANG_AND_ID-basic-check.cmake b/Tests/RunCMake/target_link_directories/genex_LINK_LANG_AND_ID-basic-check.cmake new file mode 100644 index 0000000..6bddee1 --- /dev/null +++ b/Tests/RunCMake/target_link_directories/genex_LINK_LANG_AND_ID-basic-check.cmake @@ -0,0 +1,2 @@ + +include ("${CMAKE_CURRENT_LIST_DIR}/genex_LINK_LANG_AND_ID-validation.cmake") diff --git a/Tests/RunCMake/target_link_directories/genex_LINK_LANG_AND_ID-basic-result.txt b/Tests/RunCMake/target_link_directories/genex_LINK_LANG_AND_ID-basic-result.txt new file mode 100644 index 0000000..8d98f9d --- /dev/null +++ b/Tests/RunCMake/target_link_directories/genex_LINK_LANG_AND_ID-basic-result.txt @@ -0,0 +1 @@ +.* diff --git a/Tests/RunCMake/target_link_directories/genex_LINK_LANG_AND_ID-interface-check.cmake b/Tests/RunCMake/target_link_directories/genex_LINK_LANG_AND_ID-interface-check.cmake new file mode 100644 index 0000000..a328738 --- /dev/null +++ b/Tests/RunCMake/target_link_directories/genex_LINK_LANG_AND_ID-interface-check.cmake @@ -0,0 +1,4 @@ + +set (TYPE INTERFACE) + +include ("${CMAKE_CURRENT_LIST_DIR}/genex_LINK_LANG_AND_ID-validation.cmake") diff --git a/Tests/RunCMake/target_link_directories/genex_LINK_LANG_AND_ID-interface-result.txt b/Tests/RunCMake/target_link_directories/genex_LINK_LANG_AND_ID-interface-result.txt new file mode 100644 index 0000000..8d98f9d --- /dev/null +++ b/Tests/RunCMake/target_link_directories/genex_LINK_LANG_AND_ID-interface-result.txt @@ -0,0 +1 @@ +.* diff --git a/Tests/RunCMake/target_link_directories/genex_LINK_LANG_AND_ID-validation.cmake b/Tests/RunCMake/target_link_directories/genex_LINK_LANG_AND_ID-validation.cmake new file mode 100644 index 0000000..9872953 --- /dev/null +++ b/Tests/RunCMake/target_link_directories/genex_LINK_LANG_AND_ID-validation.cmake @@ -0,0 +1,26 @@ + +if (NOT VALID_LANG) + set (VALID_LANG C) +endif() +if (NOT INVALID_LANG) + set (INVALID_LANG CXX) +endif() +if (NOT TYPE) + set (TYPE EXE) +endif() + +if (NOT actual_stdout MATCHES "DIR_${VALID_LANG}_${TYPE}") + set (RunCMake_TEST_FAILED "Not found expected 'DIR_${VALID_LANG}_${TYPE}'.\n") +endif() +if (actual_stdout MATCHES "DIR_${INVALID_LANG}_${TYPE}") + if (RunCMake_TEST_FAILED) + string (APPEND RunCMake_TEST_FAILED "\n") + endif() + string (APPEND RunCMake_TEST_FAILED "Found unexpected 'DIR_${INVALID_LANG}_${TYPE} '.") +endif() +if (actual_stdout MATCHES "DIR_(${VALID_LANG}|${INVALID_LANG})_BADID_${TYPE}") + if (RunCMake_TEST_FAILED) + string (APPEND RunCMake_TEST_FAILED "\n") + endif() + string (APPEND RunCMake_TEST_FAILED "Found unexpected 'DIR_(${VALID_LANG}|${INVALID_LANG})_BADID_${TYPE}'.") +endif() diff --git a/Tests/RunCMake/target_link_directories/genex_LINK_LANG_AND_ID.cmake b/Tests/RunCMake/target_link_directories/genex_LINK_LANG_AND_ID.cmake new file mode 100644 index 0000000..eb3b342 --- /dev/null +++ b/Tests/RunCMake/target_link_directories/genex_LINK_LANG_AND_ID.cmake @@ -0,0 +1,29 @@ + +enable_language(C) +enable_language(CXX) + +set(CMAKE_VERBOSE_MAKEFILE TRUE) +set(CMAKE_C_USE_RESPONSE_FILE_FOR_LIBRARIES FALSE) +set(CMAKE_CXX_USE_RESPONSE_FILE_FOR_LIBRARIES FALSE) + +add_library(LinkDirs_interface INTERFACE) +target_link_directories (LinkDirs_interface INTERFACE $<$<LINK_LANG_AND_ID:C,${CMAKE_C_COMPILER_ID}>:/DIR_C_INTERFACE> + $<$<LINK_LANG_AND_ID:CXX,${CMAKE_CXX_COMPILER_ID}>:/DIR_CXX_INTERFACE> + $<$<LINK_LANG_AND_ID:C,BADID>:/DIR_C_BADID_INTERFACE> + $<$<LINK_LANG_AND_ID:CXX,BADID>:/DIR_CXX_BADID_INTERFACE>) + +add_executable(LinkDirs_exe_interface exe.c) +target_link_libraries (LinkDirs_exe_interface PRIVATE LinkDirs_interface) + +add_executable(LinkDirs_exe_c exe.c) +target_link_options (LinkDirs_exe_c PRIVATE $<$<LINK_LANG_AND_ID:C,${CMAKE_C_COMPILER_ID}>:/DIR_C_EXE> + $<$<LINK_LANG_AND_ID:CXX,${CMAKE_CXX_COMPILER_ID}>:/DIR_CXX_EXE> + $<$<LINK_LANG_AND_ID:C,BADID>:/DIR_C_BADID_EXE> + $<$<LINK_LANG_AND_ID:CXX,BADID>:/DIR_CXX_BADID_EXE>) + +add_executable(LinkDirs_exe_cxx exe.c) +target_link_directories (LinkDirs_exe_cxx PRIVATE $<$<LINK_LANG_AND_ID:C,${CMAKE_C_COMPILER_ID}>:/DIR_C_EXE> + $<$<LINK_LANG_AND_ID:CXX,${CMAKE_CXX_COMPILER_ID}>:/DIR_CXX_EXE> + $<$<LINK_LANG_AND_ID:C,BADID>:/DIR_C_BADID_EXE> + $<$<LINK_LANG_AND_ID:CXX,BADID>:/DIR_CXX_BADID_EXE>) +set_property (TARGET LinkDirs_exe_cxx PROPERTY LINKER_LANGUAGE CXX) diff --git a/Tests/RunCMake/target_link_libraries/RunCMakeTest.cmake b/Tests/RunCMake/target_link_libraries/RunCMakeTest.cmake index 0152d4c..c7feb5f 100644 --- a/Tests/RunCMake/target_link_libraries/RunCMakeTest.cmake +++ b/Tests/RunCMake/target_link_libraries/RunCMakeTest.cmake @@ -20,3 +20,57 @@ run_cmake(StaticPrivateDepNotExported) run_cmake(StaticPrivateDepNotTarget) run_cmake(UNKNOWN-IMPORTED-GLOBAL) run_cmake(empty_keyword_args) +run_cmake(genex_LINK_LANGUAGE-bad-usage) + +if (RunCMake_GENERATOR MATCHES "Makefiles|Ninja|Visual Studio|Xcode|Watcom WMake") + + run_cmake(genex_LINK_LANGUAGE-bad-mix-lang) + run_cmake(genex_LINK_LANG_AND_ID-bad-mix-lang) + + macro(run_cmake_target test subtest target) + set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/${test}-build) + set(RunCMake_TEST_NO_CLEAN 1) + run_cmake_command(${test}-${subtest} ${CMAKE_COMMAND} --build . --target ${target} ${ARGN}) + + unset(RunCMake_TEST_BINARY_DIR) + unset(RunCMake_TEST_NO_CLEAN) + endmacro() + + set(RunCMake_TEST_OUTPUT_MERGE TRUE) + if (NOT RunCMake_GENERATOR_IS_MULTI_CONFIG) + set(RunCMake_TEST_OPTIONS -DCMAKE_BUILD_TYPE=Release) + endif() + + run_cmake(genex_LINK_LANGUAGE) + + run_cmake_target(genex_LINK_LANGUAGE lib LinkLibraries_lib --config Release) + run_cmake_target(genex_LINK_LANGUAGE lib2 LinkLibraries_lib2 --config Release) + run_cmake_target(genex_LINK_LANGUAGE lib3 LinkLibraries_lib3 --config Release) + run_cmake_target(genex_LINK_LANGUAGE exe LinkLibraries_exe --config Release) + run_cmake_target(genex_LINK_LANGUAGE C_import LinkLibraries_C_import --config Release) + run_cmake_target(genex_LINK_LANGUAGE CXX_import LinkLibraries_CXX_import --config Release) + run_cmake_target(genex_LINK_LANGUAGE C_interface LinkLibraries_C_interface --config Release) + run_cmake_target(genex_LINK_LANGUAGE CXX_interface LinkLibraries_CXX_interface --config Release) + run_cmake_target(genex_LINK_LANGUAGE C_interface2 LinkLibraries_C_interface2 --config Release) + run_cmake_target(genex_LINK_LANGUAGE CXX_interface2 LinkLibraries_CXX_interface2 --config Release) + run_cmake_target(genex_LINK_LANGUAGE C_static LinkLibraries_C_static --config Release) + run_cmake_target(genex_LINK_LANGUAGE CXX_static LinkLibraries_CXX_static --config Release) + + run_cmake(genex_LINK_LANG_AND_ID) + + run_cmake_target(genex_LINK_LANG_AND_ID lib LinkLibraries_lib --config Release) + run_cmake_target(genex_LINK_LANG_AND_ID lib2 LinkLibraries_lib2 --config Release) + run_cmake_target(genex_LINK_LANG_AND_ID lib3 LinkLibraries_lib3 --config Release) + run_cmake_target(genex_LINK_LANG_AND_ID exe LinkLibraries_exe --config Release) + run_cmake_target(genex_LINK_LANG_AND_ID C_import LinkLibraries_C_import --config Release) + run_cmake_target(genex_LINK_LANG_AND_ID CXX_import LinkLibraries_CXX_import --config Release) + run_cmake_target(genex_LINK_LANG_AND_ID C_interface LinkLibraries_C_interface --config Release) + run_cmake_target(genex_LINK_LANG_AND_ID CXX_interface LinkLibraries_CXX_interface --config Release) + run_cmake_target(genex_LINK_LANG_AND_ID C_interface2 LinkLibraries_C_interface2 --config Release) + run_cmake_target(genex_LINK_LANG_AND_ID CXX_interface2 LinkLibraries_CXX_interface2 --config Release) + run_cmake_target(genex_LINK_LANG_AND_ID CXX_static LinkLibraries_CXX_static --config Release) + + unset(RunCMake_TEST_OPTIONS) + unset(RunCMake_TEST_OUTPUT_MERGE) + +endif() diff --git a/Tests/RunCMake/target_link_libraries/func.c b/Tests/RunCMake/target_link_libraries/func.c new file mode 100644 index 0000000..415a9bf --- /dev/null +++ b/Tests/RunCMake/target_link_libraries/func.c @@ -0,0 +1,7 @@ + +#if defined(_WIN32) +__declspec(dllexport) +#endif + void func_c() +{ +} diff --git a/Tests/RunCMake/target_link_libraries/func.cxx b/Tests/RunCMake/target_link_libraries/func.cxx new file mode 100644 index 0000000..a12caca --- /dev/null +++ b/Tests/RunCMake/target_link_libraries/func.cxx @@ -0,0 +1,7 @@ + +#if defined(_WIN32) +__declspec(dllexport) +#endif + void func_cxx() +{ +} diff --git a/Tests/RunCMake/target_link_libraries/genex_LINK_LANGUAGE-bad-mix-lang-result.txt b/Tests/RunCMake/target_link_libraries/genex_LINK_LANGUAGE-bad-mix-lang-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/target_link_libraries/genex_LINK_LANGUAGE-bad-mix-lang-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/target_link_libraries/genex_LINK_LANGUAGE-bad-mix-lang-stderr.txt b/Tests/RunCMake/target_link_libraries/genex_LINK_LANGUAGE-bad-mix-lang-stderr.txt new file mode 100644 index 0000000..2ecdc0c --- /dev/null +++ b/Tests/RunCMake/target_link_libraries/genex_LINK_LANGUAGE-bad-mix-lang-stderr.txt @@ -0,0 +1,2 @@ +CMake Error: Evaluation of \$<LINK_LANGUAGE:...> or \$<LINK_LAND_AND_ID:...> changes +the linker language for target "LinkLibraries_bad_mix_languages" \(from 'C' to 'CXX'\) which is invalid. diff --git a/Tests/RunCMake/target_link_libraries/genex_LINK_LANGUAGE-bad-mix-lang.cmake b/Tests/RunCMake/target_link_libraries/genex_LINK_LANGUAGE-bad-mix-lang.cmake new file mode 100644 index 0000000..e8efa75 --- /dev/null +++ b/Tests/RunCMake/target_link_libraries/genex_LINK_LANGUAGE-bad-mix-lang.cmake @@ -0,0 +1,8 @@ + +enable_language(C) +enable_language(CXX) + +add_library(static_CXX STATIC func.cxx) + +add_executable(LinkLibraries_bad_mix_languages main.c) +target_link_libraries (LinkLibraries_bad_mix_languages PRIVATE $<$<LINK_LANGUAGE:C>:static_CXX>) diff --git a/Tests/RunCMake/target_link_libraries/genex_LINK_LANGUAGE-bad-usage-result.txt b/Tests/RunCMake/target_link_libraries/genex_LINK_LANGUAGE-bad-usage-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/target_link_libraries/genex_LINK_LANGUAGE-bad-usage-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/target_link_libraries/genex_LINK_LANGUAGE-bad-usage-stderr.txt b/Tests/RunCMake/target_link_libraries/genex_LINK_LANGUAGE-bad-usage-stderr.txt new file mode 100644 index 0000000..469f1fe --- /dev/null +++ b/Tests/RunCMake/target_link_libraries/genex_LINK_LANGUAGE-bad-usage-stderr.txt @@ -0,0 +1,8 @@ +CMake Error at genex_LINK_LANGUAGE-bad-usage.cmake:4 \(target_link_libraries\): + Error evaluating generator expression: + + \$<LINK_LANGUAGE> + + \$<LINK_LANGUAGE> is not supported in link libraries expression. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/target_link_libraries/genex_LINK_LANGUAGE-bad-usage.cmake b/Tests/RunCMake/target_link_libraries/genex_LINK_LANGUAGE-bad-usage.cmake new file mode 100644 index 0000000..81cfb0c --- /dev/null +++ b/Tests/RunCMake/target_link_libraries/genex_LINK_LANGUAGE-bad-usage.cmake @@ -0,0 +1,4 @@ +enable_language(C) + +add_library(simple SHARED empty.c) +target_link_libraries(simple PRIVATE lib$<LINK_LANGUAGE>) diff --git a/Tests/RunCMake/target_link_libraries/genex_LINK_LANGUAGE.cmake b/Tests/RunCMake/target_link_libraries/genex_LINK_LANGUAGE.cmake new file mode 100644 index 0000000..f3fe955 --- /dev/null +++ b/Tests/RunCMake/target_link_libraries/genex_LINK_LANGUAGE.cmake @@ -0,0 +1,72 @@ + +cmake_minimum_required(VERSION 3.16...3.17) + +enable_language(C) +enable_language(CXX) + +add_library(shared_C SHARED func.c) +add_library(shared_CXX SHARED func.cxx) + + +add_library(static1_C STATIC empty.c) +target_link_libraries (static1_C INTERFACE $<$<LINK_LANGUAGE:C>:shared_C>) + +add_library(static2_C STATIC empty.c) +target_link_libraries (static2_C PRIVATE $<$<LINK_LANGUAGE:C>:shared_C>) + + +set (binary_dir "${CMAKE_BINARY_DIR}") +get_property (is_multi_config GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) +if (is_multi_config) + string (APPEND binary_dir "/Release") +endif() +add_library(import STATIC IMPORTED) +set_property(TARGET import PROPERTY IMPORTED_LOCATION "${binary_dir}/${CMAKE_STATIC_LIBRARY_PREFIX}static1_C${CMAKE_STATIC_LIBRARY_SUFFIX}") +target_link_libraries (import INTERFACE $<$<LINK_LANGUAGE:C>:shared_C>) +target_link_libraries (import INTERFACE $<$<LINK_LANGUAGE:CXX>:shared_CXX>) + + +add_library(interface INTERFACE) +target_link_libraries (interface INTERFACE $<$<LINK_LANGUAGE:C>:shared_C> + $<$<LINK_LANGUAGE:CXX>:shared_CXX>) + + +add_library(interface2 INTERFACE) +target_link_libraries (interface2 INTERFACE import) + + +add_library(static3 STATIC empty.c) +target_link_libraries (static3 PRIVATE interface) + + +add_library(LinkLibraries_lib SHARED lib.c) +target_link_libraries (LinkLibraries_lib PRIVATE $<$<LINK_LANGUAGE:C>:shared_C>) + +add_library(LinkLibraries_lib2 SHARED lib.c) +target_link_libraries (LinkLibraries_lib2 PRIVATE $<$<LINK_LANGUAGE:C>:static1_C>) + +add_library(LinkLibraries_lib3 SHARED lib.c) +target_link_libraries (LinkLibraries_lib3 PRIVATE $<$<LINK_LANGUAGE:C>:static2_C>) + +add_executable(LinkLibraries_exe main.c) +target_link_libraries (LinkLibraries_exe PRIVATE $<$<LINK_LANGUAGE:C>:shared_C>) + +add_executable(LinkLibraries_C_import main.c) +target_link_libraries (LinkLibraries_C_import PRIVATE import) +add_executable(LinkLibraries_CXX_import main.cxx) +target_link_libraries (LinkLibraries_CXX_import PRIVATE import) + +add_executable(LinkLibraries_C_interface main.c) +target_link_libraries (LinkLibraries_C_interface PRIVATE interface) +add_executable(LinkLibraries_CXX_interface main.cxx) +target_link_libraries (LinkLibraries_CXX_interface PRIVATE interface) + +add_executable(LinkLibraries_C_interface2 main.c) +target_link_libraries (LinkLibraries_C_interface2 PRIVATE interface2) +add_executable(LinkLibraries_CXX_interface2 main.cxx) +target_link_libraries (LinkLibraries_CXX_interface2 PRIVATE interface2) + +add_executable(LinkLibraries_C_static main.c) +target_link_libraries (LinkLibraries_C_static PRIVATE static3) +add_executable(LinkLibraries_CXX_static main.cxx) +target_link_libraries (LinkLibraries_CXX_static PRIVATE static3) diff --git a/Tests/RunCMake/target_link_libraries/genex_LINK_LANG_AND_ID-bad-mix-lang-result.txt b/Tests/RunCMake/target_link_libraries/genex_LINK_LANG_AND_ID-bad-mix-lang-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/target_link_libraries/genex_LINK_LANG_AND_ID-bad-mix-lang-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/target_link_libraries/genex_LINK_LANG_AND_ID-bad-mix-lang-stderr.txt b/Tests/RunCMake/target_link_libraries/genex_LINK_LANG_AND_ID-bad-mix-lang-stderr.txt new file mode 100644 index 0000000..2ecdc0c --- /dev/null +++ b/Tests/RunCMake/target_link_libraries/genex_LINK_LANG_AND_ID-bad-mix-lang-stderr.txt @@ -0,0 +1,2 @@ +CMake Error: Evaluation of \$<LINK_LANGUAGE:...> or \$<LINK_LAND_AND_ID:...> changes +the linker language for target "LinkLibraries_bad_mix_languages" \(from 'C' to 'CXX'\) which is invalid. diff --git a/Tests/RunCMake/target_link_libraries/genex_LINK_LANG_AND_ID-bad-mix-lang.cmake b/Tests/RunCMake/target_link_libraries/genex_LINK_LANG_AND_ID-bad-mix-lang.cmake new file mode 100644 index 0000000..f80010a --- /dev/null +++ b/Tests/RunCMake/target_link_libraries/genex_LINK_LANG_AND_ID-bad-mix-lang.cmake @@ -0,0 +1,8 @@ + +enable_language(C) +enable_language(CXX) + +add_library(static_CXX STATIC func.cxx) + +add_executable(LinkLibraries_bad_mix_languages main.c) +target_link_libraries (LinkLibraries_bad_mix_languages PRIVATE $<$<LINK_LANG_AND_ID:C,${CMAKE_C_COMPILER_ID}>:static_CXX>) diff --git a/Tests/RunCMake/target_link_libraries/genex_LINK_LANG_AND_ID-basic-result.txt b/Tests/RunCMake/target_link_libraries/genex_LINK_LANG_AND_ID-basic-result.txt new file mode 100644 index 0000000..8d98f9d --- /dev/null +++ b/Tests/RunCMake/target_link_libraries/genex_LINK_LANG_AND_ID-basic-result.txt @@ -0,0 +1 @@ +.* diff --git a/Tests/RunCMake/target_link_libraries/genex_LINK_LANG_AND_ID-exe_c-result.txt b/Tests/RunCMake/target_link_libraries/genex_LINK_LANG_AND_ID-exe_c-result.txt new file mode 100644 index 0000000..8d98f9d --- /dev/null +++ b/Tests/RunCMake/target_link_libraries/genex_LINK_LANG_AND_ID-exe_c-result.txt @@ -0,0 +1 @@ +.* diff --git a/Tests/RunCMake/target_link_libraries/genex_LINK_LANG_AND_ID-exe_cxx-result.txt b/Tests/RunCMake/target_link_libraries/genex_LINK_LANG_AND_ID-exe_cxx-result.txt new file mode 100644 index 0000000..8d98f9d --- /dev/null +++ b/Tests/RunCMake/target_link_libraries/genex_LINK_LANG_AND_ID-exe_cxx-result.txt @@ -0,0 +1 @@ +.* diff --git a/Tests/RunCMake/target_link_libraries/genex_LINK_LANG_AND_ID-interface-result.txt b/Tests/RunCMake/target_link_libraries/genex_LINK_LANG_AND_ID-interface-result.txt new file mode 100644 index 0000000..8d98f9d --- /dev/null +++ b/Tests/RunCMake/target_link_libraries/genex_LINK_LANG_AND_ID-interface-result.txt @@ -0,0 +1 @@ +.* diff --git a/Tests/RunCMake/target_link_libraries/genex_LINK_LANG_AND_ID-no_language-result.txt b/Tests/RunCMake/target_link_libraries/genex_LINK_LANG_AND_ID-no_language-result.txt new file mode 100644 index 0000000..573541a --- /dev/null +++ b/Tests/RunCMake/target_link_libraries/genex_LINK_LANG_AND_ID-no_language-result.txt @@ -0,0 +1 @@ +0 diff --git a/Tests/RunCMake/target_link_libraries/genex_LINK_LANG_AND_ID.cmake b/Tests/RunCMake/target_link_libraries/genex_LINK_LANG_AND_ID.cmake new file mode 100644 index 0000000..9feccd0 --- /dev/null +++ b/Tests/RunCMake/target_link_libraries/genex_LINK_LANG_AND_ID.cmake @@ -0,0 +1,73 @@ + +cmake_minimum_required(VERSION 3.16...3.17) + +enable_language(C) +enable_language(CXX) + + +add_library(shared_C SHARED func.c) +add_library(shared_CXX SHARED func.cxx) + + +add_library(static1_C STATIC empty.c) +target_link_libraries (static1_C INTERFACE $<$<LINK_LANG_AND_ID:C,${CMAKE_C_COMPILER_ID}>:shared_C>) + +add_library(static2_C STATIC empty.c) +target_link_libraries (static2_C PRIVATE $<$<LINK_LANG_AND_ID:C,${CMAKE_C_COMPILER_ID}>:shared_C>) + + +set (binary_dir "${CMAKE_BINARY_DIR}") +get_property (is_multi_config GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) +if (is_multi_config) + string (APPEND binary_dir "/Release") +endif() +add_library(import STATIC IMPORTED) +set_property(TARGET import PROPERTY IMPORTED_LOCATION "${binary_dir}/${CMAKE_STATIC_LIBRARY_PREFIX}static1_C${CMAKE_STATIC_LIBRARY_SUFFIX}") +target_link_libraries (import INTERFACE $<$<LINK_LANG_AND_ID:C,${CMAKE_C_COMPILER_ID}>:shared_C>) +target_link_libraries (import INTERFACE $<$<LINK_LANG_AND_ID:CXX,${CMAKE_CXX_COMPILER_ID}>:shared_CXX>) + + +add_library(interface INTERFACE) +target_link_libraries (interface INTERFACE $<$<LINK_LANG_AND_ID:C,${CMAKE_C_COMPILER_ID}>:shared_C> + $<$<LINK_LANG_AND_ID:CXX,${CMAKE_CXX_COMPILER_ID}>:shared_CXX>) + + +add_library(interface2 INTERFACE) +target_link_libraries (interface2 INTERFACE import) + + +add_library(static3 STATIC empty.c) +target_link_libraries (static3 PRIVATE interface) + + +add_library(LinkLibraries_lib SHARED lib.c) +target_link_libraries (LinkLibraries_lib PRIVATE $<$<LINK_LANG_AND_ID:C,${CMAKE_C_COMPILER_ID}>:shared_C>) + +add_library(LinkLibraries_lib2 SHARED lib.c) +target_link_libraries (LinkLibraries_lib2 PRIVATE $<$<LINK_LANG_AND_ID:C,${CMAKE_C_COMPILER_ID}>:static1_C>) + +add_library(LinkLibraries_lib3 SHARED lib.c) +target_link_libraries (LinkLibraries_lib3 PRIVATE $<$<LINK_LANG_AND_ID:C,${CMAKE_C_COMPILER_ID}>:static2_C>) + +add_executable(LinkLibraries_exe main.c) +target_link_libraries (LinkLibraries_exe PRIVATE $<$<LINK_LANG_AND_ID:C,${CMAKE_C_COMPILER_ID}>:shared_C>) + +add_executable(LinkLibraries_C_import main.c) +target_link_libraries (LinkLibraries_C_import PRIVATE import) +add_executable(LinkLibraries_CXX_import main.cxx) +target_link_libraries (LinkLibraries_CXX_import PRIVATE import) + +add_executable(LinkLibraries_C_interface main.c) +target_link_libraries (LinkLibraries_C_interface PRIVATE interface) +add_executable(LinkLibraries_CXX_interface main.cxx) +target_link_libraries (LinkLibraries_CXX_interface PRIVATE interface) + +add_executable(LinkLibraries_C_interface2 main.c) +target_link_libraries (LinkLibraries_C_interface2 PRIVATE interface2) +add_executable(LinkLibraries_CXX_interface2 main.cxx) +target_link_libraries (LinkLibraries_CXX_interface2 PRIVATE interface2) + +add_executable(LinkLibraries_C_static main.c) +target_link_libraries (LinkLibraries_C_static PRIVATE static3) +add_executable(LinkLibraries_CXX_static main.cxx) +target_link_libraries (LinkLibraries_CXX_static PRIVATE static3) diff --git a/Tests/RunCMake/target_link_libraries/lib.c b/Tests/RunCMake/target_link_libraries/lib.c new file mode 100644 index 0000000..b2d1b66 --- /dev/null +++ b/Tests/RunCMake/target_link_libraries/lib.c @@ -0,0 +1,10 @@ + +#if defined(_WIN32) +__declspec(dllimport) +#endif + void func_c(); + +void lib() +{ + func_c(); +} diff --git a/Tests/RunCMake/target_link_libraries/main.c b/Tests/RunCMake/target_link_libraries/main.c new file mode 100644 index 0000000..a908dea --- /dev/null +++ b/Tests/RunCMake/target_link_libraries/main.c @@ -0,0 +1,12 @@ + +#if defined(_WIN32) +__declspec(dllimport) +#endif + void func_c(); + +int main() +{ + func_c(); + + return 0; +} diff --git a/Tests/RunCMake/target_link_libraries/main.cxx b/Tests/RunCMake/target_link_libraries/main.cxx new file mode 100644 index 0000000..ffaa3b4 --- /dev/null +++ b/Tests/RunCMake/target_link_libraries/main.cxx @@ -0,0 +1,12 @@ + +#if defined(_WIN32) +__declspec(dllimport) +#endif + void func_cxx(); + +int main() +{ + func_cxx(); + + return 0; +} diff --git a/Tests/RunCMake/target_link_options/RunCMakeTest.cmake b/Tests/RunCMake/target_link_options/RunCMakeTest.cmake index cdfdd7b..9fdcdee 100644 --- a/Tests/RunCMake/target_link_options/RunCMakeTest.cmake +++ b/Tests/RunCMake/target_link_options/RunCMakeTest.cmake @@ -27,6 +27,23 @@ if (NOT CMAKE_C_COMPILER_ID STREQUAL "Intel") run_cmake_target(LINK_OPTIONS mod LinkOptions_mod --config Release) run_cmake_target(LINK_OPTIONS exe LinkOptions_exe --config Release) + + run_cmake(genex_LINK_LANGUAGE) + + run_cmake_target(genex_LINK_LANGUAGE interface LinkOptions_shared_interface --config Release) + run_cmake_target(genex_LINK_LANGUAGE shared_c LinkOptions_shared_c --config Release) + run_cmake_target(genex_LINK_LANGUAGE LINKER_LANGUAGE LinkOptions_shared_cxx --config Release) + run_cmake_target(genex_LINK_LANGUAGE mod LinkOptions_mod --config Release) + run_cmake_target(genex_LINK_LANGUAGE exe LinkOptions_exe --config Release) + + run_cmake(genex_LINK_LANG_AND_ID) + + run_cmake_target(genex_LINK_LANG_AND_ID interface LinkOptions_shared_interface --config Release) + run_cmake_target(genex_LINK_LANG_AND_ID shared_c LinkOptions_shared_c --config Release) + run_cmake_target(genex_LINK_LANG_AND_ID LINKER_LANGUAGE LinkOptions_shared_cxx --config Release) + run_cmake_target(genex_LINK_LANG_AND_ID mod LinkOptions_mod --config Release) + run_cmake_target(genex_LINK_LANG_AND_ID exe LinkOptions_exe --config Release) + unset(RunCMake_TEST_OPTIONS) unset(RunCMake_TEST_OUTPUT_MERGE) endif() diff --git a/Tests/RunCMake/target_link_options/genex_LINK_LANGUAGE-LINKER_LANGUAGE-check.cmake b/Tests/RunCMake/target_link_options/genex_LINK_LANGUAGE-LINKER_LANGUAGE-check.cmake new file mode 100644 index 0000000..aa39810 --- /dev/null +++ b/Tests/RunCMake/target_link_options/genex_LINK_LANGUAGE-LINKER_LANGUAGE-check.cmake @@ -0,0 +1,5 @@ + +set (VALID_LANG CXX) +set (INVALID_LANG C) + +include ("${CMAKE_CURRENT_LIST_DIR}/genex_LINK_LANGUAGE-validation.cmake") diff --git a/Tests/RunCMake/target_link_options/genex_LINK_LANGUAGE-LINKER_LANGUAGE-result.txt b/Tests/RunCMake/target_link_options/genex_LINK_LANGUAGE-LINKER_LANGUAGE-result.txt new file mode 100644 index 0000000..8d98f9d --- /dev/null +++ b/Tests/RunCMake/target_link_options/genex_LINK_LANGUAGE-LINKER_LANGUAGE-result.txt @@ -0,0 +1 @@ +.* diff --git a/Tests/RunCMake/target_link_options/genex_LINK_LANGUAGE-exe-check.cmake b/Tests/RunCMake/target_link_options/genex_LINK_LANGUAGE-exe-check.cmake new file mode 100644 index 0000000..71f641d --- /dev/null +++ b/Tests/RunCMake/target_link_options/genex_LINK_LANGUAGE-exe-check.cmake @@ -0,0 +1,2 @@ + +include ("${CMAKE_CURRENT_LIST_DIR}/genex_LINK_LANGUAGE-validation.cmake") diff --git a/Tests/RunCMake/target_link_options/genex_LINK_LANGUAGE-exe-result.txt b/Tests/RunCMake/target_link_options/genex_LINK_LANGUAGE-exe-result.txt new file mode 100644 index 0000000..8d98f9d --- /dev/null +++ b/Tests/RunCMake/target_link_options/genex_LINK_LANGUAGE-exe-result.txt @@ -0,0 +1 @@ +.* diff --git a/Tests/RunCMake/target_link_options/genex_LINK_LANGUAGE-interface-check.cmake b/Tests/RunCMake/target_link_options/genex_LINK_LANGUAGE-interface-check.cmake new file mode 100644 index 0000000..ba0120c --- /dev/null +++ b/Tests/RunCMake/target_link_options/genex_LINK_LANGUAGE-interface-check.cmake @@ -0,0 +1,5 @@ + +set (VALID_LANG C) +set (INVALID_LANG CXX) + +include ("${CMAKE_CURRENT_LIST_DIR}/genex_LINK_LANGUAGE-validation.cmake") diff --git a/Tests/RunCMake/target_link_options/genex_LINK_LANGUAGE-interface-result.txt b/Tests/RunCMake/target_link_options/genex_LINK_LANGUAGE-interface-result.txt new file mode 100644 index 0000000..8d98f9d --- /dev/null +++ b/Tests/RunCMake/target_link_options/genex_LINK_LANGUAGE-interface-result.txt @@ -0,0 +1 @@ +.* diff --git a/Tests/RunCMake/target_link_options/genex_LINK_LANGUAGE-mod-check.cmake b/Tests/RunCMake/target_link_options/genex_LINK_LANGUAGE-mod-check.cmake new file mode 100644 index 0000000..71f641d --- /dev/null +++ b/Tests/RunCMake/target_link_options/genex_LINK_LANGUAGE-mod-check.cmake @@ -0,0 +1,2 @@ + +include ("${CMAKE_CURRENT_LIST_DIR}/genex_LINK_LANGUAGE-validation.cmake") diff --git a/Tests/RunCMake/target_link_options/genex_LINK_LANGUAGE-mod-result.txt b/Tests/RunCMake/target_link_options/genex_LINK_LANGUAGE-mod-result.txt new file mode 100644 index 0000000..8d98f9d --- /dev/null +++ b/Tests/RunCMake/target_link_options/genex_LINK_LANGUAGE-mod-result.txt @@ -0,0 +1 @@ +.* diff --git a/Tests/RunCMake/target_link_options/genex_LINK_LANGUAGE-shared_c-check.cmake b/Tests/RunCMake/target_link_options/genex_LINK_LANGUAGE-shared_c-check.cmake new file mode 100644 index 0000000..ba0120c --- /dev/null +++ b/Tests/RunCMake/target_link_options/genex_LINK_LANGUAGE-shared_c-check.cmake @@ -0,0 +1,5 @@ + +set (VALID_LANG C) +set (INVALID_LANG CXX) + +include ("${CMAKE_CURRENT_LIST_DIR}/genex_LINK_LANGUAGE-validation.cmake") diff --git a/Tests/RunCMake/target_link_options/genex_LINK_LANGUAGE-shared_c-result.txt b/Tests/RunCMake/target_link_options/genex_LINK_LANGUAGE-shared_c-result.txt new file mode 100644 index 0000000..8d98f9d --- /dev/null +++ b/Tests/RunCMake/target_link_options/genex_LINK_LANGUAGE-shared_c-result.txt @@ -0,0 +1 @@ +.* diff --git a/Tests/RunCMake/target_link_options/genex_LINK_LANGUAGE-validation.cmake b/Tests/RunCMake/target_link_options/genex_LINK_LANGUAGE-validation.cmake new file mode 100644 index 0000000..f0237ab --- /dev/null +++ b/Tests/RunCMake/target_link_options/genex_LINK_LANGUAGE-validation.cmake @@ -0,0 +1,17 @@ + +if (NOT DEFINED VALID_LANG) + set (VALID_LANG C) +endif() +if (NOT DEFINED INVALID_LANG) + set (INVALID_LANG CXX) +endif() + +if (NOT actual_stdout MATCHES "BADFLAG_${VALID_LANG}_LANG") + set (RunCMake_TEST_FAILED "Not found expected 'BADFLAG_${VALID_LANG}_LANG'.") +endif() +if (actual_stdout MATCHES "BADFLAG_${INVALID_LANG}_LANG") + if (RunCMake_TEST_FAILED) + string (APPEND RunCMake_TEST_FAILED "\n") + endif() + string (APPEND RunCMake_TEST_FAILED "Found unexpected 'BADFLAG_${INVALID_LANG}_LANG'.") +endif() diff --git a/Tests/RunCMake/target_link_options/genex_LINK_LANGUAGE.cmake b/Tests/RunCMake/target_link_options/genex_LINK_LANGUAGE.cmake new file mode 100644 index 0000000..61e6159 --- /dev/null +++ b/Tests/RunCMake/target_link_options/genex_LINK_LANGUAGE.cmake @@ -0,0 +1,32 @@ + +enable_language(C) +enable_language(CXX) + +set (obj "${CMAKE_C_OUTPUT_EXTENSION}") +if(BORLAND) + set(pre -) +endif() + +add_library(LinkOptions_interface INTERFACE) +target_link_options (LinkOptions_interface INTERFACE $<$<LINK_LANGUAGE:C>:${pre}BADFLAG_$<LINK_LANGUAGE>_LANG${obj}> + $<$<LINK_LANGUAGE:CXX>:${pre}BADFLAG_$<LINK_LANGUAGE>_LANG${obj}>) + +add_library(LinkOptions_shared_interface SHARED LinkOptionsLib.c) +target_link_libraries (LinkOptions_shared_interface PRIVATE LinkOptions_interface) + +add_library(LinkOptions_shared_c SHARED LinkOptionsLib.c) +target_link_options (LinkOptions_shared_c PRIVATE $<$<LINK_LANGUAGE:C>:${pre}BADFLAG_$<LINK_LANGUAGE>_LANG${obj}> + $<$<LINK_LANGUAGE:CXX>:${pre}BADFLAG_$<LINK_LANGUAGE>_LANG${obj}>) + +add_library(LinkOptions_shared_cxx SHARED LinkOptionsLib.c) +target_link_options (LinkOptions_shared_cxx PRIVATE $<$<LINK_LANGUAGE:C>:${pre}BADFLAG_$<LINK_LANGUAGE>_LANG${obj}> + $<$<LINK_LANGUAGE:CXX>:${pre}BADFLAG_$<LINK_LANGUAGE>_LANG${obj}>) +set_property (TARGET LinkOptions_shared_cxx PROPERTY LINKER_LANGUAGE CXX) + +add_library(LinkOptions_mod MODULE LinkOptionsLib.c) +target_link_options (LinkOptions_mod PRIVATE $<$<LINK_LANGUAGE:C>:${pre}BADFLAG_$<LINK_LANGUAGE>_LANG${obj}> + $<$<LINK_LANGUAGE:CXX>:${pre}BADFLAG_$<LINK_LANGUAGE>_LANG${obj}>) + +add_executable(LinkOptions_exe LinkOptionsExe.c) +target_link_options (LinkOptions_exe PRIVATE $<$<LINK_LANGUAGE:C>:${pre}BADFLAG_$<LINK_LANGUAGE>_LANG${obj}> + $<$<LINK_LANGUAGE:CXX>:${pre}BADFLAG_$<LINK_LANGUAGE>_LANG${obj}>) diff --git a/Tests/RunCMake/target_link_options/genex_LINK_LANG_AND_ID-LINKER_LANGUAGE-check.cmake b/Tests/RunCMake/target_link_options/genex_LINK_LANG_AND_ID-LINKER_LANGUAGE-check.cmake new file mode 100644 index 0000000..ed4f851 --- /dev/null +++ b/Tests/RunCMake/target_link_options/genex_LINK_LANG_AND_ID-LINKER_LANGUAGE-check.cmake @@ -0,0 +1,5 @@ + +set (VALID_LANG CXX) +set (INVALID_LANG C) + +include ("${CMAKE_CURRENT_LIST_DIR}/genex_LINK_LANG_AND_ID-validation.cmake") diff --git a/Tests/RunCMake/target_link_options/genex_LINK_LANG_AND_ID-LINKER_LANGUAGE-result.txt b/Tests/RunCMake/target_link_options/genex_LINK_LANG_AND_ID-LINKER_LANGUAGE-result.txt new file mode 100644 index 0000000..8d98f9d --- /dev/null +++ b/Tests/RunCMake/target_link_options/genex_LINK_LANG_AND_ID-LINKER_LANGUAGE-result.txt @@ -0,0 +1 @@ +.* diff --git a/Tests/RunCMake/target_link_options/genex_LINK_LANG_AND_ID-exe-check.cmake b/Tests/RunCMake/target_link_options/genex_LINK_LANG_AND_ID-exe-check.cmake new file mode 100644 index 0000000..6bddee1 --- /dev/null +++ b/Tests/RunCMake/target_link_options/genex_LINK_LANG_AND_ID-exe-check.cmake @@ -0,0 +1,2 @@ + +include ("${CMAKE_CURRENT_LIST_DIR}/genex_LINK_LANG_AND_ID-validation.cmake") diff --git a/Tests/RunCMake/target_link_options/genex_LINK_LANG_AND_ID-exe-result.txt b/Tests/RunCMake/target_link_options/genex_LINK_LANG_AND_ID-exe-result.txt new file mode 100644 index 0000000..8d98f9d --- /dev/null +++ b/Tests/RunCMake/target_link_options/genex_LINK_LANG_AND_ID-exe-result.txt @@ -0,0 +1 @@ +.* diff --git a/Tests/RunCMake/target_link_options/genex_LINK_LANG_AND_ID-interface-check.cmake b/Tests/RunCMake/target_link_options/genex_LINK_LANG_AND_ID-interface-check.cmake new file mode 100644 index 0000000..cf498d9 --- /dev/null +++ b/Tests/RunCMake/target_link_options/genex_LINK_LANG_AND_ID-interface-check.cmake @@ -0,0 +1,5 @@ + +set (VALID_LANG C) +set (INVALID_LANG CXX) + +include ("${CMAKE_CURRENT_LIST_DIR}/genex_LINK_LANG_AND_ID-validation.cmake") diff --git a/Tests/RunCMake/target_link_options/genex_LINK_LANG_AND_ID-interface-result.txt b/Tests/RunCMake/target_link_options/genex_LINK_LANG_AND_ID-interface-result.txt new file mode 100644 index 0000000..8d98f9d --- /dev/null +++ b/Tests/RunCMake/target_link_options/genex_LINK_LANG_AND_ID-interface-result.txt @@ -0,0 +1 @@ +.* diff --git a/Tests/RunCMake/target_link_options/genex_LINK_LANG_AND_ID-mod-check.cmake b/Tests/RunCMake/target_link_options/genex_LINK_LANG_AND_ID-mod-check.cmake new file mode 100644 index 0000000..6bddee1 --- /dev/null +++ b/Tests/RunCMake/target_link_options/genex_LINK_LANG_AND_ID-mod-check.cmake @@ -0,0 +1,2 @@ + +include ("${CMAKE_CURRENT_LIST_DIR}/genex_LINK_LANG_AND_ID-validation.cmake") diff --git a/Tests/RunCMake/target_link_options/genex_LINK_LANG_AND_ID-mod-result.txt b/Tests/RunCMake/target_link_options/genex_LINK_LANG_AND_ID-mod-result.txt new file mode 100644 index 0000000..8d98f9d --- /dev/null +++ b/Tests/RunCMake/target_link_options/genex_LINK_LANG_AND_ID-mod-result.txt @@ -0,0 +1 @@ +.* diff --git a/Tests/RunCMake/target_link_options/genex_LINK_LANG_AND_ID-shared_c-check.cmake b/Tests/RunCMake/target_link_options/genex_LINK_LANG_AND_ID-shared_c-check.cmake new file mode 100644 index 0000000..cf498d9 --- /dev/null +++ b/Tests/RunCMake/target_link_options/genex_LINK_LANG_AND_ID-shared_c-check.cmake @@ -0,0 +1,5 @@ + +set (VALID_LANG C) +set (INVALID_LANG CXX) + +include ("${CMAKE_CURRENT_LIST_DIR}/genex_LINK_LANG_AND_ID-validation.cmake") diff --git a/Tests/RunCMake/target_link_options/genex_LINK_LANG_AND_ID-shared_c-result.txt b/Tests/RunCMake/target_link_options/genex_LINK_LANG_AND_ID-shared_c-result.txt new file mode 100644 index 0000000..8d98f9d --- /dev/null +++ b/Tests/RunCMake/target_link_options/genex_LINK_LANG_AND_ID-shared_c-result.txt @@ -0,0 +1 @@ +.* diff --git a/Tests/RunCMake/target_link_options/genex_LINK_LANG_AND_ID-validation.cmake b/Tests/RunCMake/target_link_options/genex_LINK_LANG_AND_ID-validation.cmake new file mode 100644 index 0000000..a5dc27f --- /dev/null +++ b/Tests/RunCMake/target_link_options/genex_LINK_LANG_AND_ID-validation.cmake @@ -0,0 +1,23 @@ + +if (NOT VALID_LANG) + set (VALID_LANG C) +endif() +if (NOT INVALID_LANG) + set (INVALID_LANG CXX) +endif() + +if (NOT actual_stdout MATCHES "BADFLAG_${VALID_LANG}_LANG_ID") + set (RunCMake_TEST_FAILED "Not found expected 'BADFLAG_${VALID_LANG}_LANG_ID'.\n") +endif() +if (actual_stdout MATCHES "BADFLAG_${INVALID_LANG}_LANG_ID") + if (RunCMake_TEST_FAILED) + string (APPEND RunCMake_TEST_FAILED "\n") + endif() + string (APPEND RunCMake_TEST_FAILED "Found unexpected 'BADFLAG_${INVALID_LANG}_LANG_ID '.") +endif() +if (actual_stdout MATCHES "BADFLAG_(${VALID_LANG}|${INVALID_LANG})_BADID") + if (RunCMake_TEST_FAILED) + string (APPEND RunCMake_TEST_FAILED "\n") + endif() + string (APPEND RunCMake_TEST_FAILED "Found unexpected 'BADFLAG_(${VALID_LANG}|${INVALID_LANG})_BADID'.") +endif() diff --git a/Tests/RunCMake/target_link_options/genex_LINK_LANG_AND_ID.cmake b/Tests/RunCMake/target_link_options/genex_LINK_LANG_AND_ID.cmake new file mode 100644 index 0000000..db0f500 --- /dev/null +++ b/Tests/RunCMake/target_link_options/genex_LINK_LANG_AND_ID.cmake @@ -0,0 +1,41 @@ + +enable_language(C) +enable_language(CXX) + +if(BORLAND) + set(pre -) +endif() + +add_library(LinkOptions_interface INTERFACE) +target_link_options (LinkOptions_interface INTERFACE $<$<LINK_LANG_AND_ID:C,${CMAKE_C_COMPILER_ID}>:${pre}BADFLAG_C_LANG_ID${CMAKE_C_OUTPUT_EXTENSION}> + $<$<LINK_LANG_AND_ID:CXX,${CMAKE_CXX_COMPILER_ID}>:${pre}BADFLAG_CXX_LANG_ID${CMAKE_CXX_OUTPUT_EXTENSION}> + $<$<LINK_LANG_AND_ID:C,BADID>:${pre}BADFLAG_C_BADID${CMAKE_C_OUTPUT_EXTENSION}> + $<$<LINK_LANG_AND_ID:CXX,BADID>:${pre}BADFLAG_CXX_BADID${CMAKE_CXX_OUTPUT_EXTENSION}>) + +add_library(LinkOptions_shared_interface SHARED LinkOptionsLib.c) +target_link_libraries (LinkOptions_shared_interface PRIVATE LinkOptions_interface) + +add_library(LinkOptions_shared_c SHARED LinkOptionsLib.c) +target_link_options (LinkOptions_shared_c PRIVATE $<$<LINK_LANG_AND_ID:C,${CMAKE_C_COMPILER_ID}>:${pre}BADFLAG_C_LANG_ID${CMAKE_C_OUTPUT_EXTENSION}> + $<$<LINK_LANG_AND_ID:CXX,${CMAKE_CXX_COMPILER_ID}>:${pre}BADFLAG_CXX_LANG_ID${CMAKE_CXX_OUTPUT_EXTENSION}> + $<$<LINK_LANG_AND_ID:C,BADID>:${pre}BADFLAG_C_BADID${CMAKE_C_OUTPUT_EXTENSION}> + $<$<LINK_LANG_AND_ID:CXX,BADID>:${pre}BADFLAG_CXX_BADID${CMAKE_CXX_OUTPUT_EXTENSION}>) + +add_library(LinkOptions_shared_cxx SHARED LinkOptionsLib.c) +target_link_options (LinkOptions_shared_cxx PRIVATE $<$<LINK_LANG_AND_ID:C,${CMAKE_C_COMPILER_ID}>:${pre}BADFLAG_C_LANG_ID${CMAKE_C_OUTPUT_EXTENSION}> + $<$<LINK_LANG_AND_ID:CXX,${CMAKE_CXX_COMPILER_ID}>:${pre}BADFLAG_CXX_LANG_ID${CMAKE_CXX_OUTPUT_EXTENSION}> + $<$<LINK_LANG_AND_ID:C,BADID>:${pre}BADFLAG_C_BADID${CMAKE_C_OUTPUT_EXTENSION}> + $<$<LINK_LANG_AND_ID:CXX,BADID>:${pre}BADFLAG_CXX_BADID${CMAKE_CXX_OUTPUT_EXTENSION}>) +set_property (TARGET LinkOptions_shared_cxx PROPERTY LINKER_LANGUAGE CXX) + +add_library(LinkOptions_mod MODULE LinkOptionsLib.c) +target_link_options (LinkOptions_mod PRIVATE $<$<LINK_LANG_AND_ID:C,${CMAKE_C_COMPILER_ID}>:${pre}BADFLAG_C_LANG_ID${CMAKE_C_OUTPUT_EXTENSION}> + $<$<LINK_LANG_AND_ID:CXX,${CMAKE_CXX_COMPILER_ID}>:${pre}BADFLAG_CXX_LANG_ID${CMAKE_CXX_OUTPUT_EXTENSION}> + $<$<LINK_LANG_AND_ID:C,BADID>:${pre}BADFLAG_C_BADID${CMAKE_C_OUTPUT_EXTENSION}> + $<$<LINK_LANG_AND_ID:CXX,BADID>:${pre}BADFLAG_CXX_BADID${CMAKE_CXX_OUTPUT_EXTENSION}>) + +add_executable(LinkOptions_exe LinkOptionsExe.c) +target_link_options (LinkOptions_exe PRIVATE $<$<LINK_LANG_AND_ID:C,${CMAKE_C_COMPILER_ID}>:${pre}BADFLAG_C_LANG_ID${CMAKE_C_OUTPUT_EXTENSION}> + $<$<LINK_LANG_AND_ID:CXX,${CMAKE_CXX_COMPILER_ID}>:${pre}BADFLAG_CXX_LANG_ID${CMAKE_CXX_OUTPUT_EXTENSION}> + $<$<LINK_LANG_AND_ID:C,BADID>:${pre}BADFLAG_C_BADID${CMAKE_C_OUTPUT_EXTENSION}> + $<$<LINK_LANG_AND_ID:CXX,BADID>:${pre}BADFLAG_CXX_BADID${CMAKE_CXX_OUTPUT_EXTENSION}>) diff --git a/Tests/SwiftOnly/CMakeLists.txt b/Tests/SwiftOnly/CMakeLists.txt index f4cbac2..e24279b 100644 --- a/Tests/SwiftOnly/CMakeLists.txt +++ b/Tests/SwiftOnly/CMakeLists.txt @@ -1,4 +1,16 @@ cmake_minimum_required(VERSION 3.3) + +# NOTE: Force the Release mode configuration as there are some issues with the +# debug information handling on macOS on certain Xcode builds. +if(NOT CMAKE_CONFIGURATION_TYPES) + set(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build" FORCE) +endif() + +# NOTE: enable shared libraries by default. Older Xcode releases do not play +# well with static libraries, and Windows does not currently support static +# libraries in Swift. +set(BUILD_SHARED_LIBS YES) + project(SwiftOnly Swift) if(NOT XCODE_VERSION VERSION_LESS 10.2) @@ -7,7 +19,19 @@ elseif(NOT XCODE_VERSION VERSION_LESS 8.0) set(CMAKE_Swift_LANGUAGE_VERSION 3.0) endif() +set(CMAKE_Swift_MODULE_DIRECTORY ${CMAKE_BINARY_DIR}/swift) + add_executable(SwiftOnly main.swift) +add_library(L L.swift) + +add_library(M M.swift) +target_link_libraries(M PUBLIC + L) + +add_library(N N.swift) +target_link_libraries(N PUBLIC + M) + # Dummy to make sure generation works with such targets. add_library(SwiftIface INTERFACE) diff --git a/Tests/SwiftOnly/L.swift b/Tests/SwiftOnly/L.swift new file mode 100644 index 0000000..79ff87e --- /dev/null +++ b/Tests/SwiftOnly/L.swift @@ -0,0 +1 @@ +public let ThirtyTwo: Int = 32 diff --git a/Tests/SwiftOnly/M.swift b/Tests/SwiftOnly/M.swift new file mode 100644 index 0000000..dd333fe --- /dev/null +++ b/Tests/SwiftOnly/M.swift @@ -0,0 +1,2 @@ +import L +public let SixtyFour: Int = ThirtyTwo * 2 diff --git a/Tests/SwiftOnly/N.swift b/Tests/SwiftOnly/N.swift new file mode 100644 index 0000000..990ddf9 --- /dev/null +++ b/Tests/SwiftOnly/N.swift @@ -0,0 +1,2 @@ +import M +public let OneTwentyEight = SixtyFour * 2 diff --git a/Tests/UseSWIG/BasicConfiguration.cmake b/Tests/UseSWIG/BasicConfiguration.cmake index fd3ac40..d054953 100644 --- a/Tests/UseSWIG/BasicConfiguration.cmake +++ b/Tests/UseSWIG/BasicConfiguration.cmake @@ -18,6 +18,9 @@ unset(SWIG_LANG_LIBRARIES) if(${language} MATCHES csharp) set(SWIG_LANG_TYPE TYPE SHARED) endif() +if(${language} MATCHES fortran) + set(SWIG_LANG_TYPE TYPE SHARED) +endif() if(${language} MATCHES python) find_package(Python REQUIRED COMPONENTS Interpreter Development) set(SWIG_LANG_INCLUDE_DIRECTORIES ${Python_INCLUDE_DIRS}) diff --git a/Tests/UseSWIG/BasicFortran/CMakeLists.txt b/Tests/UseSWIG/BasicFortran/CMakeLists.txt new file mode 100644 index 0000000..e81fb85 --- /dev/null +++ b/Tests/UseSWIG/BasicFortran/CMakeLists.txt @@ -0,0 +1,23 @@ +cmake_minimum_required(VERSION 3.12...3.13) + +project(TestBasicFortran CXX Fortran) + +include(CTest) + +set(language "fortran") + +include (../BasicConfiguration.cmake) +get_target_property(EXAMPLE_PREFIX example PREFIX) +if (NOT EXAMPLE_PREFIX STREQUAL "${CMAKE_SHARED_LIBRARY_PREFIX}" + AND NOT EXAMPLE_PREFIX STREQUAL "EXAMPLE_PREFIX-NOTFOUND") + message(FATAL_ERROR "Unexpected library prefix on target: got " + "'${EXAMPLE_PREFIX}' but expected '${CMAKE_SHARED_LIBRARY_PREFIX}'") +endif() + + +add_executable(runme ${CMAKE_CURRENT_SOURCE_DIR}/../runme.f90) +target_link_libraries(runme example) +set_target_properties(runme PROPERTIES LINKER_LANGUAGE Fortran) + +add_test (NAME BasicFortran + COMMAND $<TARGET_FILE:runme>) diff --git a/Tests/UseSWIG/CMakeLists.txt b/Tests/UseSWIG/CMakeLists.txt index 3cc910f..d102846 100644 --- a/Tests/UseSWIG/CMakeLists.txt +++ b/Tests/UseSWIG/CMakeLists.txt @@ -55,6 +55,21 @@ add_test(NAME UseSWIG.BasicPerl COMMAND --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> ) +if (CMake_TEST_UseSWIG_Fortran) + check_language(Fortran) + if (CMAKE_Fortran_COMPILER) + add_test(NAME UseSWIG.BasicFortran COMMAND + ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> + --build-and-test + "${CMake_SOURCE_DIR}/Tests/UseSWIG/BasicFortran" + "${CMake_BINARY_DIR}/Tests/UseSWIG/BasicFortran" + ${build_generator_args} + --build-project TestBasicFortran + --build-options ${build_options} + --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> + ) + endif() +endif() add_test(NAME UseSWIG.MultipleModules COMMAND ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> diff --git a/Tests/UseSWIG/runme.f90 b/Tests/UseSWIG/runme.f90 new file mode 100644 index 0000000..1d985d3 --- /dev/null +++ b/Tests/UseSWIG/runme.f90 @@ -0,0 +1,77 @@ +! File : runme.f90 +program runme + use ISO_FORTRAN_ENV + implicit none + integer, parameter :: STDOUT = OUTPUT_UNIT + + call run() +contains + +subroutine run() + use example + use iso_c_binding + implicit none + + type(Circle) :: c + type(Square), target :: s ! 'target' allows it to be pointed to + class(Shape), pointer :: sh + integer(C_INT) :: n_shapes + + ! ----- Object creation ----- + + write(STDOUT,*) "Creating some objects" + c = Circle(10.0d0) + s = Square(10.0d0) + + ! ----- Access a static member ----- + write(STDOUT,'(a,i2,a)')"A total of", s%get_nshapes(), " shapes were created" + + ! ----- Member data access ----- + + ! Notice how we can do this using functions specific to + ! the 'Circle' class. + call c%set_x(20.0d0) + call c%set_y(30.0d0) + + ! Now use the same functions in the base class + sh => s + call sh%set_x(-10.0d0) + call sh%set_y( 5.0d0) + + write(STDOUT,*)"Here is their current position:" + write(STDOUT,'(a,f5.1,a,f5.1,a)')" Circle = (", c%get_x(), ",", c%get_y(), " )" + write(STDOUT,'(a,f5.1,a,f5.1,a)')" Square = (", s%get_x(), ",", s%get_y(), " )" + + ! ----- Call some methods ----- + + write(STDOUT,*)"Here are some properties of the shapes:" + call print_shape(c) + call print_shape(s) + + ! ----- Delete everything ----- + + ! Note: this invokes the virtual destructor + call c%release() + call s%release() + + n_shapes = c%get_nshapes() + write(STDOUT,*) n_shapes, "shapes remain" + if (n_shapes /= 0) then + write(STDOUT,*) "Shapes were not freed properly!" + stop 1 + endif + + write(STDOUT,*) "Goodbye" +end subroutine + +subroutine print_shape(s) + use example, only : Shape + use iso_c_binding + implicit none + class(Shape), intent(in) :: s + + write(STDOUT,*)" area = ",s%area() + write(STDOUT,*)" perimeter = ",s%perimeter() +end subroutine + +end program |