mirror of
https://github.com/reactos/CMake.git
synced 2025-03-06 02:48:38 +00:00
ENH: More elaborate install test
This commit is contained in:
parent
2936c54cdd
commit
5bbfbd56f5
@ -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
|
||||
|
3
Tests/SimpleInstall/TestSubDir/CMakeLists.txt
Normal file
3
Tests/SimpleInstall/TestSubDir/CMakeLists.txt
Normal file
@ -0,0 +1,3 @@
|
||||
ADD_EXECUTABLE(TSD TSD.cxx TSD_utils.cxx)
|
||||
INSTALL_FILES(/include FILES TSD.h)
|
||||
INSTALL_TARGETS(/bin TSD)
|
10
Tests/SimpleInstall/TestSubDir/TSD.cxx
Normal file
10
Tests/SimpleInstall/TestSubDir/TSD.cxx
Normal file
@ -0,0 +1,10 @@
|
||||
#include <stdio.h>
|
||||
|
||||
#include "TSD.h"
|
||||
|
||||
int main()
|
||||
{
|
||||
int res = TSD("TEST");
|
||||
printf("Hello from TSD\n");
|
||||
return res;
|
||||
}
|
1
Tests/SimpleInstall/TestSubDir/TSD.h
Normal file
1
Tests/SimpleInstall/TestSubDir/TSD.h
Normal file
@ -0,0 +1 @@
|
||||
int TSD(const char*);
|
10
Tests/SimpleInstall/TestSubDir/TSD_utils.cxx
Normal file
10
Tests/SimpleInstall/TestSubDir/TSD_utils.cxx
Normal file
@ -0,0 +1,10 @@
|
||||
#include <string.h>
|
||||
|
||||
int TSD(const char* foo)
|
||||
{
|
||||
if ( strcmp(foo, "TEST") == 0 )
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
}
|
@ -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
|
||||
|
3
Tests/SimpleInstallS2/TestSubDir/CMakeLists.txt
Normal file
3
Tests/SimpleInstallS2/TestSubDir/CMakeLists.txt
Normal file
@ -0,0 +1,3 @@
|
||||
ADD_EXECUTABLE(TSD TSD.cxx TSD_utils.cxx)
|
||||
INSTALL_FILES(/include FILES TSD.h)
|
||||
INSTALL_TARGETS(/bin TSD)
|
10
Tests/SimpleInstallS2/TestSubDir/TSD.cxx
Normal file
10
Tests/SimpleInstallS2/TestSubDir/TSD.cxx
Normal file
@ -0,0 +1,10 @@
|
||||
#include <stdio.h>
|
||||
|
||||
#include "TSD.h"
|
||||
|
||||
int main()
|
||||
{
|
||||
int res = TSD("TEST");
|
||||
printf("Hello from TSD\n");
|
||||
return res;
|
||||
}
|
1
Tests/SimpleInstallS2/TestSubDir/TSD.h
Normal file
1
Tests/SimpleInstallS2/TestSubDir/TSD.h
Normal file
@ -0,0 +1 @@
|
||||
int TSD(const char*);
|
10
Tests/SimpleInstallS2/TestSubDir/TSD_utils.cxx
Normal file
10
Tests/SimpleInstallS2/TestSubDir/TSD_utils.cxx
Normal file
@ -0,0 +1,10 @@
|
||||
#include <string.h>
|
||||
|
||||
int TSD(const char* foo)
|
||||
{
|
||||
if ( strcmp(foo, "TEST") == 0 )
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user