summaryrefslogtreecommitdiffstats
path: root/Tests/VSExternalInclude/CMakeLists.txt
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2004-09-14 20:01:00 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2004-09-14 20:01:00 (GMT)
commit013b66d8fa7e3b832f5e6c88efd33bd369fda7eb (patch)
tree5bd7d3eded68277c2817ed4c427a8f746b45dbab /Tests/VSExternalInclude/CMakeLists.txt
parent32fe8caaefba6d0ec8ea183ec87cedad29a660c0 (diff)
downloadCMake-013b66d8fa7e3b832f5e6c88efd33bd369fda7eb.zip
CMake-013b66d8fa7e3b832f5e6c88efd33bd369fda7eb.tar.gz
CMake-013b66d8fa7e3b832f5e6c88efd33bd369fda7eb.tar.bz2
ENH: add a test for external projects
Diffstat (limited to 'Tests/VSExternalInclude/CMakeLists.txt')
-rw-r--r--Tests/VSExternalInclude/CMakeLists.txt38
1 files changed, 38 insertions, 0 deletions
diff --git a/Tests/VSExternalInclude/CMakeLists.txt b/Tests/VSExternalInclude/CMakeLists.txt
new file mode 100644
index 0000000..74f6868
--- /dev/null
+++ b/Tests/VSExternalInclude/CMakeLists.txt
@@ -0,0 +1,38 @@
+PROJECT(VSExternalInclude)
+
+IF(${CMAKE_GENERATOR} MATCHES "Visual Studio 6")
+SET(PROJECT_EXT dps)
+ELSE(${CMAKE_GENERATOR} MATCHES "Visual Studio 6")
+SET(PROJECT_EXT vcproj)
+ENDIF(${CMAKE_GENERATOR} MATCHES "Visual Studio 6")
+
+
+# make sure directories exists
+SET(LIB1_BINARY_DIR ${VSExternalInclude_BINARY_DIR}/Lib1)
+MAKE_DIRECTORY("${LIB1_BINARY_DIR}")
+
+SET(LIB2_BINARY_DIR ${VSExternalInclude_BINARY_DIR}/Lib2)
+MAKE_DIRECTORY("${LIB2_BINARY_DIR}")
+
+# generate lib1
+EXEC_PROGRAM("${CMAKE_COMMAND}" "${LIB1_BINARY_DIR}" ARGS -G\"${CMAKE_GENERATOR}\"
+ \"${VSExternalInclude_SOURCE_DIR}/Lib1\" OUTPUT_VARIABLE OUT)
+
+
+# generate lib2
+EXEC_PROGRAM("${CMAKE_COMMAND}" "${LIB2_BINARY_DIR}" ARGS -G\"${CMAKE_GENERATOR}\"
+ \"${VSExternalInclude_SOURCE_DIR}/Lib2\" OUTPUT_VARIABLE OUT)
+
+
+INCLUDE_EXTERNAL_MSPROJECT(lib1 ${VSExternalInclude_BINARY_DIR}/Lib1/LIB1.${PROJECT_EXT})
+# lib2 depends on lib1
+INCLUDE_EXTERNAL_MSPROJECT(lib2 ${VSExternalInclude_BINARY_DIR}/Lib2/LIB2.${PROJECT_EXT} lib1)
+
+INCLUDE_DIRECTORIES(${VSExternalInclude_SOURCE_DIR}/Lib2 ${VSExternalInclude_SOURCE_DIR}/Lib1)
+
+SET(SOURCES main.cpp)
+
+ADD_EXECUTABLE(VSExternalInclude ${SOURCES})
+
+# target depends on lib1
+ADD_DEPENDENCIES(VSExternalInclude lib2)