ENH: avoid the use of GET_TARGET_PROPERTY by testing the CMake executable instead of the test executable
This commit is contained in:
parent
01ac3906da
commit
6c54adf0ea
|
@ -620,8 +620,9 @@ IF(KWSYS_STANDALONE OR CMake_SOURCE_DIR)
|
|||
|
||||
IF(BUILD_TESTING)
|
||||
|
||||
GET_TARGET_PROPERTY(TEST_SYSTEMTOOLS_EXE testSystemTools LOCATION)
|
||||
SET(TEST_SYSTEMTOOLS_SRC "${CMAKE_CURRENT_SOURCE_DIR}/testSystemTools.cxx")
|
||||
SET(TEST_SYSTEMTOOLS_EXE_FILE ${CMAKE_COMMAND})
|
||||
SET(TEST_SYSTEMTOOLS_SRC_FILE
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/testSystemTools.cxx")
|
||||
CONFIGURE_FILE(
|
||||
${PROJECT_SOURCE_DIR}/testSystemTools.h.in
|
||||
${PROJECT_BINARY_DIR}/testSystemTools.h)
|
||||
|
|
|
@ -97,21 +97,21 @@ bool CheckDetectFileType()
|
|||
{
|
||||
bool res = true;
|
||||
|
||||
if (kwsys::SystemTools::DetectFileType(TEST_SYSTEMTOOLS_EXE) !=
|
||||
if (kwsys::SystemTools::DetectFileType(TEST_SYSTEMTOOLS_EXE_FILE) !=
|
||||
kwsys::SystemTools::FileTypeBinary)
|
||||
{
|
||||
kwsys_ios::cerr
|
||||
<< "Problem with DetectFileType - failed to detect type of: "
|
||||
<< TEST_SYSTEMTOOLS_EXE << kwsys_ios::endl;
|
||||
<< TEST_SYSTEMTOOLS_EXE_FILE << kwsys_ios::endl;
|
||||
res = false;
|
||||
}
|
||||
|
||||
if (kwsys::SystemTools::DetectFileType(TEST_SYSTEMTOOLS_SRC) !=
|
||||
if (kwsys::SystemTools::DetectFileType(TEST_SYSTEMTOOLS_SRC_FILE) !=
|
||||
kwsys::SystemTools::FileTypeText)
|
||||
{
|
||||
kwsys_ios::cerr
|
||||
<< "Problem with DetectFileType - failed to detect type of: "
|
||||
<< TEST_SYSTEMTOOLS_SRC << kwsys_ios::endl;
|
||||
<< TEST_SYSTEMTOOLS_SRC_FILE << kwsys_ios::endl;
|
||||
res = false;
|
||||
}
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
#ifndef @KWSYS_NAMESPACE@_testSystemtools_h
|
||||
#define @KWSYS_NAMESPACE@_testSystemtools_h
|
||||
|
||||
#define TEST_SYSTEMTOOLS_EXE "@TEST_SYSTEMTOOLS_EXE@"
|
||||
#define TEST_SYSTEMTOOLS_SRC "@TEST_SYSTEMTOOLS_SRC@"
|
||||
#define TEST_SYSTEMTOOLS_EXE_FILE "@TEST_SYSTEMTOOLS_EXE_FILE@"
|
||||
#define TEST_SYSTEMTOOLS_SRC_FILE "@TEST_SYSTEMTOOLS_SRC_FILE@"
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue