mirror of
https://github.com/reactos/CMake.git
synced 2024-12-19 09:36:44 +00:00
d331292c12
This is useful for cases like: add_test(NAME mytest COMMAND mydriver $<TARGET_FILE:myexe>) set_tests_properties(mytest PROPERTIES REQUIRED_FILES "$<TARGET_FILE:myexe>" WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/$<CONFIGURATION>" ) In this example we require the actual test executable to exist to run the test in addition to the test driver at argv[0]. Also the $<CONFIGURATION> expression improves over \${CTEST_CONFIGURATION_TYPE} because the latter is not normalized for case-sensitive filesystems.
35 lines
492 B
C
35 lines
492 B
C
#include <limits.h>
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
|
|
#ifdef _WIN32
|
|
#include <direct.h>
|
|
#define getcurdir _getcwd
|
|
#else
|
|
#include <unistd.h>
|
|
#define getcurdir getcwd
|
|
#endif
|
|
|
|
int main(int argc, char* argv[])
|
|
{
|
|
#define BUFSZ 20000
|
|
char buf[BUFSZ + 1];
|
|
#ifdef _WIN32
|
|
char *pos;
|
|
#endif
|
|
getcurdir(buf, BUFSZ);
|
|
#ifdef _WIN32
|
|
pos = buf;
|
|
while (*pos)
|
|
{
|
|
if (*pos == '\\')
|
|
{
|
|
*pos = '/';
|
|
}
|
|
++pos;
|
|
}
|
|
#endif
|
|
printf("%s\n", buf);
|
|
return EXIT_SUCCESS;
|
|
}
|