summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy Cedilnik <andy.cedilnik@kitware.com>2004-04-27 13:22:57 (GMT)
committerAndy Cedilnik <andy.cedilnik@kitware.com>2004-04-27 13:22:57 (GMT)
commit482eef71122acf6408e0d5bd02161bb832155f08 (patch)
tree61500ef9273621f9d8816b2286ed6c8838137e30
parentc19a70b3ada66a59c7a0ff78bf1a4a1cd557db9a (diff)
downloadCMake-482eef71122acf6408e0d5bd02161bb832155f08.zip
CMake-482eef71122acf6408e0d5bd02161bb832155f08.tar.gz
CMake-482eef71122acf6408e0d5bd02161bb832155f08.tar.bz2
BUG: Fix aus source dir and add better testing of it
-rw-r--r--Source/cmSourceFile.cxx16
-rw-r--r--Tests/SubDir/AnotherSubdir/pair+int.int.c6
-rw-r--r--Tests/SubDir/AnotherSubdir/secondone.c6
-rw-r--r--Tests/SubDir/AnotherSubdir/testfromsubdir.c8
-rw-r--r--Tests/SubDir/CMakeLists.txt13
-rw-r--r--Tests/SubDir/ThirdSubDir/pair+int.int1.c6
-rw-r--r--Tests/SubDir/ThirdSubDir/testfromauxsubdir.c14
-rw-r--r--Tests/SubDir/ThirdSubDir/thirdone.c6
-rw-r--r--Tests/SubDir/vcl_algorithm+vcl_pair+double.foo.c6
9 files changed, 69 insertions, 12 deletions
diff --git a/Source/cmSourceFile.cxx b/Source/cmSourceFile.cxx
index b8a547a..ed8d63f 100644
--- a/Source/cmSourceFile.cxx
+++ b/Source/cmSourceFile.cxx
@@ -30,12 +30,8 @@ void cmSourceFile::SetName(const char* name, const char* dir,
this->SetProperty("HEADER_FILE_ONLY","1");
- m_SourceName = cmSystemTools::GetFilenamePath(name);
- if ( m_SourceName.size() > 0 )
- {
- m_SourceName += "/";
- }
- m_SourceName += cmSystemTools::GetFilenameWithoutLastExtension(name);
+
+ m_SourceName = name;
std::string pathname = dir;
@@ -58,6 +54,12 @@ void cmSourceFile::SetName(const char* name, const char* dir,
std::string hname = pathname;
if(cmSystemTools::FileExists(hname.c_str()))
{
+ m_SourceName = cmSystemTools::GetFilenamePath(name);
+ if ( m_SourceName.size() > 0 )
+ {
+ m_SourceName += "/";
+ }
+ m_SourceName += cmSystemTools::GetFilenameWithoutLastExtension(name);
std::string::size_type pos = hname.rfind('.');
if(pos != std::string::npos)
{
@@ -74,7 +76,7 @@ void cmSourceFile::SetName(const char* name, const char* dir,
// See if the file is a header file
if(std::find( headerExts.begin(), headerExts.end(), m_SourceExtension ) ==
- headerExts.end())
+ headerExts.end())
{
this->SetProperty("HEADER_FILE_ONLY","0");
}
diff --git a/Tests/SubDir/AnotherSubdir/pair+int.int.c b/Tests/SubDir/AnotherSubdir/pair+int.int.c
new file mode 100644
index 0000000..b7a6237
--- /dev/null
+++ b/Tests/SubDir/AnotherSubdir/pair+int.int.c
@@ -0,0 +1,6 @@
+#include <stdio.h>
+
+void pair_stuff()
+{
+ printf("Placeholder for a strange file in subdirectory\n");
+}
diff --git a/Tests/SubDir/AnotherSubdir/secondone.c b/Tests/SubDir/AnotherSubdir/secondone.c
index b55d05f..3e9e5af 100644
--- a/Tests/SubDir/AnotherSubdir/secondone.c
+++ b/Tests/SubDir/AnotherSubdir/secondone.c
@@ -1,4 +1,6 @@
-const char* secondone()
+#include <stdio.h>
+
+void secondone()
{
- return "Hello again";
+ printf("Hello again\n");
}
diff --git a/Tests/SubDir/AnotherSubdir/testfromsubdir.c b/Tests/SubDir/AnotherSubdir/testfromsubdir.c
index b784b16..34b6e7a 100644
--- a/Tests/SubDir/AnotherSubdir/testfromsubdir.c
+++ b/Tests/SubDir/AnotherSubdir/testfromsubdir.c
@@ -1,10 +1,14 @@
#include <stdio.h>
-const char* secondone();
+void secondone();
+void pair_stuff();
+void vcl_stuff();
int main()
{
printf("Hello from subdirectory\n");
- printf("SO: %s\n", secondone());
+ secondone();
+ pair_stuff();
+ vcl_stuff();
return 0;
}
diff --git a/Tests/SubDir/CMakeLists.txt b/Tests/SubDir/CMakeLists.txt
index a1da9b6..5cf8859 100644
--- a/Tests/SubDir/CMakeLists.txt
+++ b/Tests/SubDir/CMakeLists.txt
@@ -2,4 +2,15 @@ PROJECT(SUBDIR)
SUBDIRS(Executable EXCLUDE_FROM_ALL Examples)
WRITE_FILE(${SUBDIR_BINARY_DIR}/ShouldBeHere "This file should exist.")
-ADD_EXECUTABLE(TestFromSubdir AnotherSubdir/testfromsubdir.c AnotherSubdir/secondone)
+ADD_EXECUTABLE(TestFromSubdir
+ AnotherSubdir/testfromsubdir.c
+ AnotherSubdir/secondone
+ AnotherSubdir/pair+int.int.c
+ vcl_algorithm+vcl_pair+double.foo.c
+ )
+
+AUX_SOURCE_DIRECTORY(ThirdSubDir SOURCES)
+SET(SOURCES ${SOURCES}
+ vcl_algorithm+vcl_pair+double.foo.c)
+MESSAGE("Sources: ${SOURCES}")
+ADD_EXECUTABLE(TestWithAuxSourceDir ${SOURCES})
diff --git a/Tests/SubDir/ThirdSubDir/pair+int.int1.c b/Tests/SubDir/ThirdSubDir/pair+int.int1.c
new file mode 100644
index 0000000..b7a6237
--- /dev/null
+++ b/Tests/SubDir/ThirdSubDir/pair+int.int1.c
@@ -0,0 +1,6 @@
+#include <stdio.h>
+
+void pair_stuff()
+{
+ printf("Placeholder for a strange file in subdirectory\n");
+}
diff --git a/Tests/SubDir/ThirdSubDir/testfromauxsubdir.c b/Tests/SubDir/ThirdSubDir/testfromauxsubdir.c
new file mode 100644
index 0000000..34b6e7a
--- /dev/null
+++ b/Tests/SubDir/ThirdSubDir/testfromauxsubdir.c
@@ -0,0 +1,14 @@
+#include <stdio.h>
+
+void secondone();
+void pair_stuff();
+void vcl_stuff();
+
+int main()
+{
+ printf("Hello from subdirectory\n");
+ secondone();
+ pair_stuff();
+ vcl_stuff();
+ return 0;
+}
diff --git a/Tests/SubDir/ThirdSubDir/thirdone.c b/Tests/SubDir/ThirdSubDir/thirdone.c
new file mode 100644
index 0000000..3e9e5af
--- /dev/null
+++ b/Tests/SubDir/ThirdSubDir/thirdone.c
@@ -0,0 +1,6 @@
+#include <stdio.h>
+
+void secondone()
+{
+ printf("Hello again\n");
+}
diff --git a/Tests/SubDir/vcl_algorithm+vcl_pair+double.foo.c b/Tests/SubDir/vcl_algorithm+vcl_pair+double.foo.c
new file mode 100644
index 0000000..a0c60f7
--- /dev/null
+++ b/Tests/SubDir/vcl_algorithm+vcl_pair+double.foo.c
@@ -0,0 +1,6 @@
+#include <stdio.h>
+
+void vcl_stuff()
+{
+ printf("Placeholder for a file with strange name\n");
+}