diff options
author | Sebastien Barre <sebastien.barre@kitware.com> | 2005-10-05 20:06:45 (GMT) |
---|---|---|
committer | Sebastien Barre <sebastien.barre@kitware.com> | 2005-10-05 20:06:45 (GMT) |
commit | 6c54adf0ea6979afdf6ec67df7cd39ee2cca6e87 (patch) | |
tree | 53131b75c9421e98c81000fc4bdaa08990f6ab68 /Source/kwsys | |
parent | 01ac3906da339451729f5ef43ef7367647537b59 (diff) | |
download | CMake-6c54adf0ea6979afdf6ec67df7cd39ee2cca6e87.zip CMake-6c54adf0ea6979afdf6ec67df7cd39ee2cca6e87.tar.gz CMake-6c54adf0ea6979afdf6ec67df7cd39ee2cca6e87.tar.bz2 |
ENH: avoid the use of GET_TARGET_PROPERTY by testing the CMake executable instead of the test executable
Diffstat (limited to 'Source/kwsys')
-rw-r--r-- | Source/kwsys/CMakeLists.txt | 5 | ||||
-rw-r--r-- | Source/kwsys/testSystemTools.cxx | 8 | ||||
-rw-r--r-- | Source/kwsys/testSystemTools.h.in | 4 |
3 files changed, 9 insertions, 8 deletions
diff --git a/Source/kwsys/CMakeLists.txt b/Source/kwsys/CMakeLists.txt index 77c7030..51066b5 100644 --- a/Source/kwsys/CMakeLists.txt +++ b/Source/kwsys/CMakeLists.txt @@ -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) diff --git a/Source/kwsys/testSystemTools.cxx b/Source/kwsys/testSystemTools.cxx index 7805c2a..9ccec3d 100644 --- a/Source/kwsys/testSystemTools.cxx +++ b/Source/kwsys/testSystemTools.cxx @@ -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; } diff --git a/Source/kwsys/testSystemTools.h.in b/Source/kwsys/testSystemTools.h.in index a96f39e..3e63a43 100644 --- a/Source/kwsys/testSystemTools.h.in +++ b/Source/kwsys/testSystemTools.h.in @@ -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 |