summaryrefslogtreecommitdiffstats
path: root/Source/kwsys/CMakeLists.txt
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2003-06-10 19:46:31 (GMT)
committerBrad King <brad.king@kitware.com>2003-06-10 19:46:31 (GMT)
commit96ccaed54dcf97e802c2e958185cf321dfa7f1e4 (patch)
treefdeb2ff895a72232e4f290f39126faad8ab7b68f /Source/kwsys/CMakeLists.txt
parent89cf5d538c53af72c6f212d86e74011277233067 (diff)
downloadCMake-96ccaed54dcf97e802c2e958185cf321dfa7f1e4.zip
CMake-96ccaed54dcf97e802c2e958185cf321dfa7f1e4.tar.gz
CMake-96ccaed54dcf97e802c2e958185cf321dfa7f1e4.tar.bz2
ENH: Added Process execution implementation.
Diffstat (limited to 'Source/kwsys/CMakeLists.txt')
-rw-r--r--Source/kwsys/CMakeLists.txt50
1 files changed, 47 insertions, 3 deletions
diff --git a/Source/kwsys/CMakeLists.txt b/Source/kwsys/CMakeLists.txt
index 83ebe22..68bd8c0 100644
--- a/Source/kwsys/CMakeLists.txt
+++ b/Source/kwsys/CMakeLists.txt
@@ -29,9 +29,19 @@ SET(KWSYS_NO_ANSI_STRING_STREAM ${CMAKE_NO_ANSI_STRING_STREAM})
SET(KWSYS_NO_ANSI_FOR_SCOPE ${CMAKE_NO_ANSI_FOR_SCOPE})
SET(CLASSES Directory RegularExpression SystemTools)
-SET(HEADERS Configure)
+SET(H Process)
+SET(HXX Configure)
+
+IF(NOT UNIX)
+ ADD_EXECUTABLE(${KWSYS_NAMESPACE}ProcessFwd9x ProcessFwd9x.c)
+ ADD_EXECUTABLE(${KWSYS_NAMESPACE}EncodeExecutable EncodeExecutable.c)
+ SET(SRCS ProcessWin32.c ${CMAKE_CURRENT_BINARY_DIR}/${KWSYS_NAMESPACE}ProcessFwd9xEnc.c)
+ SET_SOURCE_FILES_PROPERTIES(${CMAKE_CURRENT_BINARY_DIR}/${KWSYS_NAMESPACE}ProcessFwd9xEnc.c
+ PROPERTIES GENERATED 1)
+ELSE(NOT UNIX)
+ SET(SRCS ProcessUNIX.c)
+ENDIF(NOT UNIX)
-SET(SRCS)
SET(KWSYS_INCLUDES)
FOREACH(c ${CLASSES})
SET(SRCS ${SRCS} ${c}.cxx)
@@ -42,7 +52,15 @@ FOREACH(c ${CLASSES})
${PROJECT_BINARY_DIR}/../${KWSYS_NAMESPACE}/${c}.hxx)
ENDFOREACH(c)
-FOREACH(h ${HEADERS})
+FOREACH(h ${H})
+ CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/${h}.h.in
+ ${PROJECT_BINARY_DIR}/../${KWSYS_NAMESPACE}/${h}.h
+ @ONLY IMMEDIATE)
+ SET(KWSYS_INCLUDES ${KWSYS_INCLUDES}
+ ${PROJECT_BINARY_DIR}/../${KWSYS_NAMESPACE}/${h}.h)
+ENDFOREACH(h)
+
+FOREACH(h ${HXX})
CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/${h}.hxx.in
${PROJECT_BINARY_DIR}/../${KWSYS_NAMESPACE}/${h}.hxx
@ONLY IMMEDIATE)
@@ -93,3 +111,29 @@ IF(KWSYS_DEFAULTS)
ADD_EXECUTABLE(test1 test1.cxx)
TARGET_LINK_LIBRARIES(test1 ${KWSYS_NAMESPACE})
ENDIF(KWSYS_DEFAULTS)
+
+IF(NOT UNIX)
+ SET(BIN_DIR ${CMAKE_CURRENT_BINARY_DIR})
+ IF(EXECUTABLE_OUTPUT_PATH)
+ SET(BIN_DIR ${EXECUTABLE_OUTPUT_PATH})
+ ENDIF(EXECUTABLE_OUTPUT_PATH)
+
+ SET(MAKE_SYSTEM)
+ SET(CFG_INTDIR "/${CMAKE_CFG_INTDIR}")
+ IF(CMAKE_BUILD_TOOL MATCHES "make")
+ SET(CFG_INTDIR "")
+ ENDIF(CMAKE_BUILD_TOOL MATCHES "make")
+
+ SET(CMD ${BIN_DIR}${CFG_INTDIR}/${KWSYS_NAMESPACE}EncodeExecutable.exe)
+ SET(FWD ${BIN_DIR}${CFG_INTDIR}/${KWSYS_NAMESPACE}ProcessFwd9x.exe)
+ ADD_CUSTOM_COMMAND(
+ TARGET ${KWSYS_NAMESPACE}
+ SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/ProcessFwd9x.c
+ COMMAND ${CMD}
+ ARGS ${FWD} ${CMAKE_CURRENT_BINARY_DIR}/${KWSYS_NAMESPACE}ProcessFwd9xEnc.c
+ ${KWSYS_NAMESPACE} ProcessFwd9x
+ OUTPUTS ${CMAKE_CURRENT_BINARY_DIR}/${KWSYS_NAMESPACE}ProcessFwd9xEnc.c
+ DEPENDS ${CMD} ${FWD})
+ ADD_DEPENDENCIES(${KWSYS_NAMESPACE} ${KWSYS_NAMESPACE}ProcessFwd9x
+ ${KWSYS_NAMESPACE}EncodeExecutable)
+ENDIF(NOT UNIX)