From 5bbfbd56f584a43b13f3b2409f168bcfd6e02411 Mon Sep 17 00:00:00 2001 From: Andy Cedilnik Date: Tue, 1 Jun 2004 12:55:23 -0400 Subject: ENH: More elaborate install test --- Tests/SimpleInstall/CMakeLists.txt | 3 +++ Tests/SimpleInstall/TestSubDir/CMakeLists.txt | 3 +++ Tests/SimpleInstall/TestSubDir/TSD.cxx | 10 ++++++++++ Tests/SimpleInstall/TestSubDir/TSD.h | 1 + Tests/SimpleInstall/TestSubDir/TSD_utils.cxx | 10 ++++++++++ Tests/SimpleInstallS2/CMakeLists.txt | 3 +++ Tests/SimpleInstallS2/TestSubDir/CMakeLists.txt | 3 +++ Tests/SimpleInstallS2/TestSubDir/TSD.cxx | 10 ++++++++++ Tests/SimpleInstallS2/TestSubDir/TSD.h | 1 + Tests/SimpleInstallS2/TestSubDir/TSD_utils.cxx | 10 ++++++++++ 10 files changed, 54 insertions(+) create mode 100644 Tests/SimpleInstall/TestSubDir/CMakeLists.txt create mode 100644 Tests/SimpleInstall/TestSubDir/TSD.cxx create mode 100644 Tests/SimpleInstall/TestSubDir/TSD.h create mode 100644 Tests/SimpleInstall/TestSubDir/TSD_utils.cxx create mode 100644 Tests/SimpleInstallS2/TestSubDir/CMakeLists.txt create mode 100644 Tests/SimpleInstallS2/TestSubDir/TSD.cxx create mode 100644 Tests/SimpleInstallS2/TestSubDir/TSD.h create mode 100644 Tests/SimpleInstallS2/TestSubDir/TSD_utils.cxx diff --git a/Tests/SimpleInstall/CMakeLists.txt b/Tests/SimpleInstall/CMakeLists.txt index df9a644..0221da3 100644 --- a/Tests/SimpleInstall/CMakeLists.txt +++ b/Tests/SimpleInstall/CMakeLists.txt @@ -50,6 +50,8 @@ IF(STAGE2) INSTALL_TARGETS(/bin SimpleInstallS2) ELSE(STAGE2) + SUBDIRS(PREORDER TestSubDir) + # this is stage 1, so create libraries and modules and install everything ADD_LIBRARY(test1 STATIC lib1.cxx) ADD_LIBRARY(test2 SHARED lib2.cxx) @@ -65,6 +67,7 @@ ELSE(STAGE2) INSTALL_TARGETS(/bin SimpleInstall) INSTALL_TARGETS(/lib test1 test2 test3) INSTALL_TARGETS(/include lib1.h lib2.h lib3.h) + SET_TARGET_PROPERTIES(SimpleInstall PROPERTIES PRE_INSTALL_SCRIPT ${CMAKE_CURRENT_SOURCE_DIR}/PreInstall.cmake) SET_TARGET_PROPERTIES(SimpleInstall PROPERTIES POST_INSTALL_SCRIPT diff --git a/Tests/SimpleInstall/TestSubDir/CMakeLists.txt b/Tests/SimpleInstall/TestSubDir/CMakeLists.txt new file mode 100644 index 0000000..a99711d --- /dev/null +++ b/Tests/SimpleInstall/TestSubDir/CMakeLists.txt @@ -0,0 +1,3 @@ +ADD_EXECUTABLE(TSD TSD.cxx TSD_utils.cxx) +INSTALL_FILES(/include FILES TSD.h) +INSTALL_TARGETS(/bin TSD) diff --git a/Tests/SimpleInstall/TestSubDir/TSD.cxx b/Tests/SimpleInstall/TestSubDir/TSD.cxx new file mode 100644 index 0000000..8fc3878 --- /dev/null +++ b/Tests/SimpleInstall/TestSubDir/TSD.cxx @@ -0,0 +1,10 @@ +#include + +#include "TSD.h" + +int main() +{ + int res = TSD("TEST"); + printf("Hello from TSD\n"); + return res; +} diff --git a/Tests/SimpleInstall/TestSubDir/TSD.h b/Tests/SimpleInstall/TestSubDir/TSD.h new file mode 100644 index 0000000..6a3c1af --- /dev/null +++ b/Tests/SimpleInstall/TestSubDir/TSD.h @@ -0,0 +1 @@ +int TSD(const char*); diff --git a/Tests/SimpleInstall/TestSubDir/TSD_utils.cxx b/Tests/SimpleInstall/TestSubDir/TSD_utils.cxx new file mode 100644 index 0000000..0277f05 --- /dev/null +++ b/Tests/SimpleInstall/TestSubDir/TSD_utils.cxx @@ -0,0 +1,10 @@ +#include + +int TSD(const char* foo) +{ + if ( strcmp(foo, "TEST") == 0 ) + { + return 0; + } + return 1; +} diff --git a/Tests/SimpleInstallS2/CMakeLists.txt b/Tests/SimpleInstallS2/CMakeLists.txt index df9a644..0221da3 100644 --- a/Tests/SimpleInstallS2/CMakeLists.txt +++ b/Tests/SimpleInstallS2/CMakeLists.txt @@ -50,6 +50,8 @@ IF(STAGE2) INSTALL_TARGETS(/bin SimpleInstallS2) ELSE(STAGE2) + SUBDIRS(PREORDER TestSubDir) + # this is stage 1, so create libraries and modules and install everything ADD_LIBRARY(test1 STATIC lib1.cxx) ADD_LIBRARY(test2 SHARED lib2.cxx) @@ -65,6 +67,7 @@ ELSE(STAGE2) INSTALL_TARGETS(/bin SimpleInstall) INSTALL_TARGETS(/lib test1 test2 test3) INSTALL_TARGETS(/include lib1.h lib2.h lib3.h) + SET_TARGET_PROPERTIES(SimpleInstall PROPERTIES PRE_INSTALL_SCRIPT ${CMAKE_CURRENT_SOURCE_DIR}/PreInstall.cmake) SET_TARGET_PROPERTIES(SimpleInstall PROPERTIES POST_INSTALL_SCRIPT diff --git a/Tests/SimpleInstallS2/TestSubDir/CMakeLists.txt b/Tests/SimpleInstallS2/TestSubDir/CMakeLists.txt new file mode 100644 index 0000000..a99711d --- /dev/null +++ b/Tests/SimpleInstallS2/TestSubDir/CMakeLists.txt @@ -0,0 +1,3 @@ +ADD_EXECUTABLE(TSD TSD.cxx TSD_utils.cxx) +INSTALL_FILES(/include FILES TSD.h) +INSTALL_TARGETS(/bin TSD) diff --git a/Tests/SimpleInstallS2/TestSubDir/TSD.cxx b/Tests/SimpleInstallS2/TestSubDir/TSD.cxx new file mode 100644 index 0000000..8fc3878 --- /dev/null +++ b/Tests/SimpleInstallS2/TestSubDir/TSD.cxx @@ -0,0 +1,10 @@ +#include + +#include "TSD.h" + +int main() +{ + int res = TSD("TEST"); + printf("Hello from TSD\n"); + return res; +} diff --git a/Tests/SimpleInstallS2/TestSubDir/TSD.h b/Tests/SimpleInstallS2/TestSubDir/TSD.h new file mode 100644 index 0000000..6a3c1af --- /dev/null +++ b/Tests/SimpleInstallS2/TestSubDir/TSD.h @@ -0,0 +1 @@ +int TSD(const char*); diff --git a/Tests/SimpleInstallS2/TestSubDir/TSD_utils.cxx b/Tests/SimpleInstallS2/TestSubDir/TSD_utils.cxx new file mode 100644 index 0000000..0277f05 --- /dev/null +++ b/Tests/SimpleInstallS2/TestSubDir/TSD_utils.cxx @@ -0,0 +1,10 @@ +#include + +int TSD(const char* foo) +{ + if ( strcmp(foo, "TEST") == 0 ) + { + return 0; + } + return 1; +} -- cgit v0.12