2004-09-15 00:01:00 +04:00
|
|
|
PROJECT(VSExternalInclude)
|
|
|
|
|
|
|
|
IF(${CMAKE_GENERATOR} MATCHES "Visual Studio 6")
|
2004-09-16 18:48:10 +04:00
|
|
|
SET(PROJECT_EXT dsp)
|
2004-09-15 00:01:00 +04:00
|
|
|
ELSE(${CMAKE_GENERATOR} MATCHES "Visual Studio 6")
|
2004-09-15 00:35:39 +04:00
|
|
|
SET(PROJECT_EXT vcproj)
|
2004-09-15 00:01:00 +04:00
|
|
|
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)
|
2004-09-15 18:35:58 +04:00
|
|
|
MESSAGE("CMAKE Ran with the following output:\n\"${OUT}\"")
|
2004-09-15 00:01:00 +04:00
|
|
|
|
|
|
|
# generate lib2
|
|
|
|
EXEC_PROGRAM("${CMAKE_COMMAND}" "${LIB2_BINARY_DIR}" ARGS -G\"${CMAKE_GENERATOR}\"
|
|
|
|
\"${VSExternalInclude_SOURCE_DIR}/Lib2\" OUTPUT_VARIABLE OUT)
|
2004-09-15 18:35:58 +04:00
|
|
|
MESSAGE("CMAKE Ran with the following output:\n\"${OUT}\"")
|
2004-09-15 00:01:00 +04:00
|
|
|
|
|
|
|
|
|
|
|
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})
|
|
|
|
|
2004-09-15 00:34:57 +04:00
|
|
|
# target depends on lib2
|
2004-09-15 00:01:00 +04:00
|
|
|
ADD_DEPENDENCIES(VSExternalInclude lib2)
|