TEST is a keyword in if() statements in recent CMake, rename a variable to avoid a conflict.

main
David Chisnall 10 years ago
parent b581098831
commit 8b1d4fbcc2

@ -33,26 +33,26 @@ set(TESTS
# Function for adding a test. This takes the name of the test and the list of
# source files as arguments.
function(addtest_flags TEST FLAGS TEST_SOURCE)
if (TEST MATCHES ".*_arc")
function(addtest_flags TEST_NAME FLAGS TEST_SOURCE)
if (${TEST_NAME} MATCHES ".*_arc")
# Only compile the main file with ARC
set_source_files_properties(${TEST_SOURCE}
COMPILE_FLAGS "-fobjc-arc")
# Add the ARC-incompatible definitions of the test class.
list(APPEND TEST_SOURCE "Test.m")
endif()
add_executable(${TEST} ${TEST_SOURCE})
add_test(${TEST} ${TEST})
add_executable(${TEST_NAME} ${TEST_SOURCE})
add_test(${TEST_NAME} ${TEST_NAME})
set(ARC "")
set_target_properties(${TEST} PROPERTIES
set_target_properties(${TEST_NAME} PROPERTIES
INCLUDE_DIRECTORIES "${CMAKE_SOURCE_DIR}"
COMPILE_FLAGS "-fobjc-runtime=gnustep-1.7 -fblocks ${FLAGS}"
LINKER_LANGUAGE C
)
set_property(TEST ${TEST} PROPERTY
set_property(TEST ${TEST_NAME} PROPERTY
ENVIRONMENT "LD_LIBRARY_PATH="
)
target_link_libraries(${TEST} objc)
target_link_libraries(${TEST_NAME} objc)
endfunction(addtest_flags)
foreach(TEST_SOURCE ${TESTS})

Loading…
Cancel
Save