From 683a08eedd4e28738fae0fbd7e329f35879b5957 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Hohnst=C3=A4dt?= Date: Fri, 5 Aug 2022 10:28:39 +0200 Subject: [PATCH] cmake: fix dependency issue complained by xcode Also remove stamp files and simplify CMake rules: - Name all generated files in OUTPUT - Drop BYPRODUCT, which is not necessary now. - Let the target depend on all OUTPPUTs of the command. --- README.md | 12 +++++++----- doc/CMakeLists.txt | 22 +++++++++------------- 2 files changed, 16 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index e4444978..c83c1f88 100644 --- a/README.md +++ b/README.md @@ -56,12 +56,14 @@ To build XCA you need: brew install openssl qt5 python3 cmake pip3 install sphinx ``` - - Clone: `git clone https://github.com/chris2511/xca.git` - - Configure: `cmake -B build xca` - - Make: `cmake --build build -j5` - - Build the DMG: `cd build && cpack` - - Build the PKG: `cd build && cpack -G productbuild` +- Clone: `git clone https://github.com/chris2511/xca.git` +- Configure: `cmake -B build xca` +- Make: `cmake --build build -j5` +- Build the DMG: `cd build && cpack` +- Build the PKG: `cd build && cpack -G productbuild` +XCA can be used with Xcode after initializing the directory with: +`cmake -G Xcode -B .` ### Windows - Install the dependencies diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt index d486d3cc..a13b7398 100644 --- a/doc/CMakeLists.txt +++ b/doc/CMakeLists.txt @@ -40,23 +40,21 @@ WixFile(${D}/documentation.wxs ${WIX_DOC_CONTENT}) if(SPHINX) configure_file(${S}/conf.py.in ${D}/rst/conf.py) add_custom_command( - OUTPUT ${D}/html.stamp - BYPRODUCTS ${HTML_DEST} + OUTPUT ${HTML_DEST} COMMAND ${SPHINX} -q -b html ${D}/rst ${D}/html - COMMAND cmake -E touch ${D}/html.stamp DEPENDS ${D}/rst/conf.py sphinx-src COMMENT "Create HTML documentation" ) - add_custom_target(sphinx-html DEPENDS ${D}/html.stamp) + add_custom_target(sphinx-html DEPENDS ${HTML_DEST}) add_custom_command( - OUTPUT ${D}/qthelp.stamp - BYPRODUCTS ${D}/qthelp/xca.qhcp ${D}/qthelp/xca.qhp ${QTHELP_DEST} + OUTPUT ${D}/qthelp/xca.qhcp ${D}/qthelp/xca.qhp ${QTHELP_DEST} COMMAND ${SPHINX} -q -b qthelp ${D}/rst ${D}/qthelp - COMMAND cmake -E touch ${D}/qthelp.stamp DEPENDS ${D}/rst/conf.py sphinx-src COMMENT "Create context sensitive help" ) - add_custom_target(sphinx-qthelp DEPENDS ${D}/qthelp.stamp) + add_custom_target(sphinx-qthelp + DEPENDS ${D}/qthelp/xca.qhcp ${D}/qthelp/xca.qhp ${QTHELP_DEST} + ) add_custom_command( OUTPUT ${D}/rst/database_schema.sql COMMAND ${CMAKE_COMMAND} -E make_directory ${D}/rst/_static @@ -110,14 +108,12 @@ if(SPHINX) if(QTCOLLGEN) set(QTHELP_IDX ${D}/qthelp/xca.qhc ${D}/qthelp/xca.qch) add_custom_command( - OUTPUT ${D}/qtcollgen.stamp - BYPRODUCTS ${QTHELP_IDX} + OUTPUT ${QTHELP_IDX} COMMAND ${QTCOLLGEN} ${D}/qthelp/xca.qhcp - COMMAND cmake -E touch ${D}/qtcollgen.stamp - DEPENDS ${D}/qthelp.stamp + DEPENDS sphinx-qthelp COMMENT "Create context sensitive help index" ) - add_custom_target(sphinx-qtcollgen DEPENDS ${D}/qtcollgen.stamp) + add_custom_target(sphinx-qtcollgen DEPENDS ${QTHELP_IDX}) target_sources(${CMAKE_PROJECT_NAME} PRIVATE ${QTHELP_DEST} ${QTHELP_IDX}) add_dependencies(${CMAKE_PROJECT_NAME} sphinx-qtcollgen) list(APPEND APP_RESOURCES ${QTHELP_DEST} ${QTHELP_IDX})