STYLE: use GET_TARGET_PROPERTY(LOCATION) instead of manually building the
path to the executables (tested with cmake 2.2.3) Alex
This commit is contained in:
parent
18cc1228bb
commit
ca3a613595
|
@ -1,19 +1,12 @@
|
||||||
SUBDIRS(Doxygen KWStyle)
|
SUBDIRS(Doxygen KWStyle)
|
||||||
|
|
||||||
SET(CMD_DIR ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR})
|
|
||||||
IF(WIN32)
|
|
||||||
SET(CMD_EXT ".exe")
|
|
||||||
ELSE(WIN32)
|
|
||||||
SET(CMD_EXT "")
|
|
||||||
ENDIF(WIN32)
|
|
||||||
|
|
||||||
MAKE_DIRECTORY(${CMake_BINARY_DIR}/Docs)
|
MAKE_DIRECTORY(${CMake_BINARY_DIR}/Docs)
|
||||||
|
|
||||||
# Add a documentation target.
|
# Add a documentation target.
|
||||||
SET(DOC_FILES "")
|
SET(DOC_FILES "")
|
||||||
|
|
||||||
# Generate documentation for "cmake" executable.
|
# Generate documentation for "cmake" executable.
|
||||||
SET(CMD ${CMD_DIR}/cmake${CMD_EXT})
|
GET_TARGET_PROPERTY(CMD cmake LOCATION)
|
||||||
ADD_CUSTOM_COMMAND(
|
ADD_CUSTOM_COMMAND(
|
||||||
OUTPUT ${CMake_BINARY_DIR}/Docs/cmake.txt
|
OUTPUT ${CMake_BINARY_DIR}/Docs/cmake.txt
|
||||||
COMMAND ${CMD}
|
COMMAND ${CMD}
|
||||||
|
@ -33,7 +26,7 @@ INSTALL_FILES(${CMAKE_DOC_DIR} FILES
|
||||||
SET(DOC_FILES ${DOC_FILES} ${CMake_BINARY_DIR}/Docs/cmake.txt)
|
SET(DOC_FILES ${DOC_FILES} ${CMake_BINARY_DIR}/Docs/cmake.txt)
|
||||||
|
|
||||||
# Generate documentation for "ctest" executable.
|
# Generate documentation for "ctest" executable.
|
||||||
SET(CMD ${CMD_DIR}/ctest${CMD_EXT})
|
GET_TARGET_PROPERTY(CMD ctest LOCATION)
|
||||||
ADD_CUSTOM_COMMAND(
|
ADD_CUSTOM_COMMAND(
|
||||||
OUTPUT ${CMake_BINARY_DIR}/Docs/ctest.txt
|
OUTPUT ${CMake_BINARY_DIR}/Docs/ctest.txt
|
||||||
COMMAND ${CMD}
|
COMMAND ${CMD}
|
||||||
|
@ -52,7 +45,7 @@ SET(DOC_FILES ${DOC_FILES} ${CMake_BINARY_DIR}/Docs/ctest.txt)
|
||||||
|
|
||||||
# Generate documentation for "ccmake" executable.
|
# Generate documentation for "ccmake" executable.
|
||||||
IF(BUILD_CursesDialog)
|
IF(BUILD_CursesDialog)
|
||||||
SET(CMD ${CMD_DIR}/ccmake${CMD_EXT})
|
GET_TARGET_PROPERTY(CMD ccmake LOCATION)
|
||||||
ADD_CUSTOM_COMMAND(
|
ADD_CUSTOM_COMMAND(
|
||||||
OUTPUT ${CMake_BINARY_DIR}/Docs/ccmake.txt
|
OUTPUT ${CMake_BINARY_DIR}/Docs/ccmake.txt
|
||||||
COMMAND ${CMD}
|
COMMAND ${CMD}
|
||||||
|
@ -73,7 +66,7 @@ IF(BUILD_CursesDialog)
|
||||||
ENDIF(BUILD_CursesDialog)
|
ENDIF(BUILD_CursesDialog)
|
||||||
|
|
||||||
IF(BUILD_MFCDialog)
|
IF(BUILD_MFCDialog)
|
||||||
SET(CMD ${CMD_DIR}/CMakeSetup${CMD_EXT})
|
GET_TARGET_PROPERTY(CMD CMakeSetup LOCATION)
|
||||||
ADD_CUSTOM_COMMAND(
|
ADD_CUSTOM_COMMAND(
|
||||||
OUTPUT ${CMake_BINARY_DIR}/Docs/CMakeSetup.txt
|
OUTPUT ${CMake_BINARY_DIR}/Docs/CMakeSetup.txt
|
||||||
COMMAND ${CMD}
|
COMMAND ${CMD}
|
||||||
|
@ -94,6 +87,6 @@ IF(BUILD_MFCDialog)
|
||||||
ENDIF(BUILD_MFCDialog)
|
ENDIF(BUILD_MFCDialog)
|
||||||
|
|
||||||
# Drive documentation generation.
|
# Drive documentation generation.
|
||||||
ADD_CUSTOM_TARGET(documentation ALL
|
ADD_CUSTOM_TARGET(documentation ALL
|
||||||
DEPENDS ${DOC_FILES}
|
DEPENDS ${DOC_FILES}
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue