多くのサブフォルダーがあります
home
|
|-library1
|-library2
|
|-libraryn
ホームフォルダーにメインCMakeLists.txt
があり、すべてのサブフォルダーに CMakeLists.txt があります。
すべてのサブプロジェクトには、ドキュメントのコンパイルに使用するカスタム ターゲットがあります。
# in library1/CMakelists.txt
find_package (Doxygen)
if (DOXYGEN_FOUND)
set (Doxygen_Dir ${CMAKE_BINARY_DIR}/export/${library1_Version}/doc)
# Copy images folder
file (GLOB IMAGES_SRC "images/*")
file (COPY ${IMAGES_SRC} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/images)
configure_file (${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile @ONLY)
add_custom_target (library1_doc
${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Generating doxygen documentation" VERBATIM
)
else (DOXYGEN_FOUND)
message (STATUS "Doxygen must be installed in order to compile doc")
endif (DOXYGEN_FOUND)
# in libraryn/CMakelists.txt
find_package (Doxygen)
if (DOXYGEN_FOUND)
set (Doxygen_Dir ${CMAKE_BINARY_DIR}/export/${library1_Version}/doc)
# Copy images folder
file (GLOB IMAGES_SRC "images/*")
file (COPY ${IMAGES_SRC} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/images)
configure_file (${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile @ONLY)
add_custom_target (libraryn_doc
${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Generating doxygen documentation" VERBATIM
)
else (DOXYGEN_FOUND)
message (STATUS "Doxygen must be installed in order to compile doc")
endif (DOXYGEN_FOUND)
ご覧のとおり、すべてのサブプロジェクトでlibraryn_doc
ターゲットを作成します。
これはメインの CMakeLists.txt です。
cmake_minimum_required (VERSION 2.8)
### Versions ###
# This exports the library version
set (library1_Version 0.0)
### Projects ###
add_subdirectory (library1)
add_subdirectory (library2)
add_subdirectory (library3)
add_subdirectory (library4)
### Project dependencies ###
add_dependencies (librrary4 library1)
### Project documentation ###
add_custom_target(doc
DEPENDS library1 library2 library3 library4
)
doc
すべての libraryn_doc カスタム ターゲットを実行するために、メインの CMakelists.txtのターゲットを変更したいのでmake doc
、make library1_doc; ... make libraryn_doc
.
どうすればいいですか?