mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-24 23:49:18 -06:00
Add three tests in Tests/RunCMake/PrintHelpers, meant to verify basic functionality of the module. Tests are: * Variables: Test the results of a cmake_print_variables() call on two variables set within the test script. * Properties: Test cmake_print_properties() calls on a pair of SOURCES and a pair of TARGETS, printing some basic properties. * PropertiesSources: Specifically verify the results of a cmake_print_properties() call for the SOURCES property of a TARGET. Prior to the fix introduced alongside these tests, it was a known bug that such a request caused a FATAL_ERROR.
27 lines
529 B
CMake
27 lines
529 B
CMake
enable_language(C)
|
|
|
|
set_property(SOURCE nothing.c PROPERTY LANGUAGE C)
|
|
set_property(SOURCE something.c PROPERTY
|
|
COMPILE_DEFINITIONS SOMETHING=1)
|
|
|
|
add_library(nothing STATIC nothing.c nothing.h)
|
|
|
|
add_executable(something something.c something.h)
|
|
target_link_libraries(something PUBLIC nothing)
|
|
|
|
include(CMakePrintHelpers)
|
|
|
|
cmake_print_properties(
|
|
TARGETS nothing something
|
|
PROPERTIES
|
|
LINKER_LANGUAGE
|
|
TYPE
|
|
)
|
|
|
|
cmake_print_properties(
|
|
SOURCES nothing.c something.c
|
|
PROPERTIES
|
|
COMPILE_DEFINITIONS
|
|
LANGUAGE
|
|
)
|