ENH: test get directory properties ability to get props from subdirs
This commit is contained in:
parent
2a45d5cd68
commit
fd26d148d8
|
@ -1,6 +1,13 @@
|
|||
# a simple test case
|
||||
PROJECT (OutOfSource)
|
||||
# a simple test cas
|
||||
project (OutOfSource)
|
||||
|
||||
ADD_SUBDIRECTORY(SubDir)
|
||||
add_subdirectory(SubDir)
|
||||
|
||||
SET(KEN 1)
|
||||
get_directory_property(ANIMAL DIRECTORY OutOfSourceSubdir DEFINITION WEASELS)
|
||||
|
||||
configure_file(
|
||||
${OutOfSource_SOURCE_DIR}/testdp.h.in
|
||||
${OutOfSource_BINARY_DIR}/SubDir/OutOfSourceSubdir/testdp.h
|
||||
)
|
||||
|
||||
set(KEN 1)
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR})
|
||||
|
||||
IF ("${PROJECT_SOURCE_DIR}" STREQUAL "${ANOTHER_PROJ_SOURCE_DIR}")
|
||||
SET(BUILD_SHARED_LIBS 1)
|
||||
ADD_LIBRARY(testlib testlib.cxx)
|
||||
|
@ -5,3 +7,5 @@ IF ("${PROJECT_SOURCE_DIR}" STREQUAL "${ANOTHER_PROJ_SOURCE_DIR}")
|
|||
TARGET_LINK_LIBRARIES(simple testlib)
|
||||
ENDIF ("${PROJECT_SOURCE_DIR}" STREQUAL "${ANOTHER_PROJ_SOURCE_DIR}")
|
||||
|
||||
# test getting a definition from a subdir
|
||||
SET (WEASELS SIZZLING)
|
||||
|
|
|
@ -1,7 +1,16 @@
|
|||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "testlib.h"
|
||||
#include "testdp.h"
|
||||
|
||||
int main ()
|
||||
{
|
||||
{
|
||||
if (strcmp(animal,"SIZZLING"))
|
||||
{
|
||||
fprintf(stderr,"Get definitions from a subdir did not work\n");
|
||||
return -2;
|
||||
}
|
||||
if(TestLib() != 1.0)
|
||||
{
|
||||
return -1;
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
char *animal = "${ANIMAL}";
|
Loading…
Reference in New Issue