1 PROJECT(VSExternalInclude)
3 IF(${CMAKE_GENERATOR} MATCHES "Visual Studio 6")
5 ELSE(${CMAKE_GENERATOR} MATCHES "Visual Studio 6")
6 SET(PROJECT_EXT vcproj)
7 ENDIF(${CMAKE_GENERATOR} MATCHES "Visual Studio 6")
10 # make sure directories exists
11 SET(LIB1_BINARY_DIR ${VSExternalInclude_BINARY_DIR}/Lib1)
12 MAKE_DIRECTORY("${LIB1_BINARY_DIR}")
14 SET(LIB2_BINARY_DIR ${VSExternalInclude_BINARY_DIR}/Lib2)
15 MAKE_DIRECTORY("${LIB2_BINARY_DIR}")
18 EXEC_PROGRAM("${CMAKE_COMMAND}" "${LIB1_BINARY_DIR}" ARGS -G\"${CMAKE_GENERATOR}\"
19 \"${VSExternalInclude_SOURCE_DIR}/Lib1\" OUTPUT_VARIABLE OUT)
20 MESSAGE("CMAKE Ran with the following output:\n\"${OUT}\"")
23 EXEC_PROGRAM("${CMAKE_COMMAND}" "${LIB2_BINARY_DIR}" ARGS -G\"${CMAKE_GENERATOR}\"
24 \"${VSExternalInclude_SOURCE_DIR}/Lib2\" OUTPUT_VARIABLE OUT)
25 MESSAGE("CMAKE Ran with the following output:\n\"${OUT}\"")
28 INCLUDE_EXTERNAL_MSPROJECT(lib1 ${VSExternalInclude_BINARY_DIR}/Lib1/LIB1.${PROJECT_EXT})
29 # lib2 depends on lib1
30 INCLUDE_EXTERNAL_MSPROJECT(lib2 ${VSExternalInclude_BINARY_DIR}/Lib2/LIB2.${PROJECT_EXT} lib1)
32 INCLUDE_DIRECTORIES(${VSExternalInclude_SOURCE_DIR}/Lib2 ${VSExternalInclude_SOURCE_DIR}/Lib1)
36 ADD_EXECUTABLE(VSExternalInclude ${SOURCES})
38 # target depends on lib2
39 ADD_DEPENDENCIES(VSExternalInclude lib2)