From e7311a036e16cf56692862103be37df95853a1dc Mon Sep 17 00:00:00 2001 From: Anonymous Maarten Date: Wed, 16 Sep 2020 16:24:06 +0200 Subject: Allow building doxygen as a subproject --- CMakeLists.txt | 14 +++++++------- addon/doxmlparser/src/CMakeLists.txt | 2 +- addon/doxmlparser/test/CMakeLists.txt | 2 +- addon/doxyapp/CMakeLists.txt | 6 +++--- addon/doxyparse/CMakeLists.txt | 6 +++--- addon/doxysearch/CMakeLists.txt | 4 ++-- addon/doxywizard/CMakeLists.txt | 14 +++++++------- cmake/Coverage.cmake | 12 ++++++------ cmake/doxygen_version.cmake | 2 +- cmake/git_watcher.cmake | 2 +- doc/CMakeLists.txt | 26 +++++++++++++------------- examples/CMakeLists.txt | 6 +++--- libmscgen/CMakeLists.txt | 8 ++++---- libversion/CMakeLists.txt | 8 ++++---- src/CMakeLists.txt | 34 +++++++++++++++++----------------- testing/CMakeLists.txt | 4 ++-- vhdlparser/CMakeLists.txt | 8 ++++---- 17 files changed, 79 insertions(+), 79 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 35e6a0c..61786f7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -34,9 +34,9 @@ option(enable_coverage "Enable coverage reporting for gcc/clang [development]" O SET(enlarge_lex_buffers "262144" CACHE INTERNAL "Sets the lex input and read buffers to the specified size") -list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake") -list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/Sanitizers") -set(TOP "${CMAKE_SOURCE_DIR}") +list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake") +list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake/Sanitizers") +set(TOP "${PROJECT_SOURCE_DIR}") include(version) set(sqlite3 "0" CACHE INTERNAL "used in settings.h") @@ -71,7 +71,7 @@ if (WIN32) if ((NOT CMAKE_GENERATOR MATCHES "MinGW Makefiles") AND (NOT CMAKE_GENERATOR MATCHES "MSYS Makefiles")) if (NOT ICONV_DIR) - set(ICONV_DIR "${CMAKE_SOURCE_DIR}/winbuild") + set(ICONV_DIR "${PROJECT_SOURCE_DIR}/winbuild") endif() set(CMAKE_REQUIRED_DEFINITIONS "-DLIBICONV_STATIC") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /bigobj") # needed for language.cpp on 64bit @@ -120,10 +120,10 @@ find_package(Iconv REQUIRED) include_directories(${ICONV_INCLUDE_DIR}) -#set(DOXYDOCS ${CMAKE_SOURCE_DIR}/doc CACHE INTERNAL "Path to doxygen docs") +#set(DOXYDOCS ${PROJECT_SOURCE_DIR}/doc CACHE INTERNAL "Path to doxygen docs") set(DOXYDOCS ${PROJECT_BINARY_DIR}/doc) set(ENV{DOXYGEN_DOCDIR} ${DOXYDOCS}) -set(GENERATED_SRC "${CMAKE_BINARY_DIR}/generated_src" CACHE INTERNAL "Stores generated files") +set(GENERATED_SRC "${PROJECT_BINARY_DIR}/generated_src" CACHE INTERNAL "Stores generated files") set(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib) set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin) @@ -135,7 +135,7 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_MINSIZEREL ${EXECUTABLE_OUTPUT_PATH}) set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELWITHDEBINFO ${EXECUTABLE_OUTPUT_PATH}) # gather lang codes for translation -file(GLOB lang_files RELATIVE "${CMAKE_SOURCE_DIR}/src" "${CMAKE_SOURCE_DIR}/src/translator_??.h") +file(GLOB lang_files RELATIVE "${PROJECT_SOURCE_DIR}/src" "${PROJECT_SOURCE_DIR}/src/translator_??.h") if (english_only) # user only wants English set(lcodes "ENONLY") else () diff --git a/addon/doxmlparser/src/CMakeLists.txt b/addon/doxmlparser/src/CMakeLists.txt index 35f6c83..cbd5811 100644 --- a/addon/doxmlparser/src/CMakeLists.txt +++ b/addon/doxmlparser/src/CMakeLists.txt @@ -1,7 +1,7 @@ include_directories( . ../include - ${CMAKE_SOURCE_DIR}/qtools + ${PROJECT_SOURCE_DIR}/qtools ) add_library(doxmlparser STATIC basehandler.cpp diff --git a/addon/doxmlparser/test/CMakeLists.txt b/addon/doxmlparser/test/CMakeLists.txt index 2d92b72..7cdeda6 100644 --- a/addon/doxmlparser/test/CMakeLists.txt +++ b/addon/doxmlparser/test/CMakeLists.txt @@ -1,7 +1,7 @@ include_directories( ../include - ${CMAKE_SOURCE_DIR}/qtools + ${PROJECT_SOURCE_DIR}/qtools ) add_executable(doxmlparser_test diff --git a/addon/doxyapp/CMakeLists.txt b/addon/doxyapp/CMakeLists.txt index a6a776a..3e58d32 100644 --- a/addon/doxyapp/CMakeLists.txt +++ b/addon/doxyapp/CMakeLists.txt @@ -1,10 +1,10 @@ find_package(Iconv) include_directories( - ${CMAKE_SOURCE_DIR}/src - ${CMAKE_SOURCE_DIR}/libversion + ${PROJECT_SOURCE_DIR}/src + ${PROJECT_SOURCE_DIR}/libversion ${GENERATED_SRC} - ${CMAKE_SOURCE_DIR}/qtools + ${PROJECT_SOURCE_DIR}/qtools ${ICONV_INCLUDE_DIR} ${CLANG_INCLUDEDIR} ) diff --git a/addon/doxyparse/CMakeLists.txt b/addon/doxyparse/CMakeLists.txt index 8df99ab..fe2f2c2 100644 --- a/addon/doxyparse/CMakeLists.txt +++ b/addon/doxyparse/CMakeLists.txt @@ -1,10 +1,10 @@ find_package(Iconv) include_directories( - ${CMAKE_SOURCE_DIR}/src - ${CMAKE_SOURCE_DIR}/libversion + ${PROJECT_SOURCE_DIR}/src + ${PROJECT_SOURCE_DIR}/libversion ${GENERATED_SRC} - ${CMAKE_SOURCE_DIR}/qtools + ${PROJECT_SOURCE_DIR}/qtools ${ICONV_INCLUDE_DIR} ${CLANG_INCLUDEDIR} ) diff --git a/addon/doxysearch/CMakeLists.txt b/addon/doxysearch/CMakeLists.txt index 7a1e1c1..dd3258d 100644 --- a/addon/doxysearch/CMakeLists.txt +++ b/addon/doxysearch/CMakeLists.txt @@ -2,11 +2,11 @@ find_package(Xapian REQUIRED) find_package(ZLIB REQUIRED) if (WIN32) - set(WIN_EXTRA_LIBS "uuid.lib rpcrt4.lib ws2_32.lib") + set(WIN_EXTRA_LIBS uuid.lib rpcrt4.lib ws2_32.lib) endif() include_directories( - ${CMAKE_SOURCE_DIR}/qtools + ${PROJECT_SOURCE_DIR}/qtools ${XAPIAN_INCLUDE_DIR} ${ZLIB_INCLUDE_DIRS} ) diff --git a/addon/doxywizard/CMakeLists.txt b/addon/doxywizard/CMakeLists.txt index 6aacd8b..6484cb4 100644 --- a/addon/doxywizard/CMakeLists.txt +++ b/addon/doxywizard/CMakeLists.txt @@ -30,8 +30,8 @@ endif() include_directories( . - ${CMAKE_SOURCE_DIR}/libversion - ${CMAKE_SOURCE_DIR}/qtools + ${PROJECT_SOURCE_DIR}/libversion + ${PROJECT_SOURCE_DIR}/qtools ${GENERATED_SRC} ) @@ -58,15 +58,15 @@ set_source_files_properties(${GENERATED_SRC_WIZARD}/settings.h PROPERTIES GENERA # generate version.cpp add_custom_command( - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/src/version.py ${VERSION} > ${GENERATED_SRC_WIZARD}/version.cpp - DEPENDS ${CMAKE_SOURCE_DIR}/VERSION ${CMAKE_SOURCE_DIR}/src/version.py + COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_SOURCE_DIR}/src/version.py ${VERSION} > ${GENERATED_SRC_WIZARD}/version.cpp + DEPENDS ${PROJECT_SOURCE_DIR}/VERSION ${PROJECT_SOURCE_DIR}/src/version.py OUTPUT ${GENERATED_SRC_WIZARD}/version.cpp ) set_source_files_properties(${GENERATED_SRC_WIZARD}/version.cpp PROPERTIES GENERATED 1) # generate configdoc.cpp add_custom_command( -COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/src/configgen.py -wiz ${CMAKE_SOURCE_DIR}/src/config.xml > ${GENERATED_SRC_WIZARD}/configdoc.cpp +COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_SOURCE_DIR}/src/configgen.py -wiz ${PROJECT_SOURCE_DIR}/src/config.xml > ${GENERATED_SRC_WIZARD}/configdoc.cpp OUTPUT ${GENERATED_SRC_WIZARD}/configdoc.cpp ) set_source_files_properties(${GENERATED_SRC_WIZARD}/configdoc.cpp PROPERTIES GENERATED 1) @@ -74,8 +74,8 @@ set_source_files_properties(${GENERATED_SRC_WIZARD}/configdoc.cpp PROPERTIES GEN set(LEX_FILES config_doxyw) foreach(lex_file ${LEX_FILES}) add_custom_command( - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/src/scan_states.py ${CMAKE_SOURCE_DIR}/addon/doxywizard/${lex_file}.l > ${GENERATED_SRC_WIZARD}/${lex_file}.l.h - DEPENDS ${CMAKE_SOURCE_DIR}/src/scan_states.py ${CMAKE_SOURCE_DIR}/addon/doxywizard/${lex_file}.l + COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_SOURCE_DIR}/src/scan_states.py ${PROJECT_SOURCE_DIR}/addon/doxywizard/${lex_file}.l > ${GENERATED_SRC_WIZARD}/${lex_file}.l.h + DEPENDS ${PROJECT_SOURCE_DIR}/src/scan_states.py ${PROJECT_SOURCE_DIR}/addon/doxywizard/${lex_file}.l OUTPUT ${GENERATED_SRC_WIZARD}/${lex_file}.l.h ) set_source_files_properties(${GENERATED_SRC_WIZARD}/${lex_file}.l.h PROPERTIES GENERATED 1) diff --git a/cmake/Coverage.cmake b/cmake/Coverage.cmake index 31f8341..ce7d431 100644 --- a/cmake/Coverage.cmake +++ b/cmake/Coverage.cmake @@ -7,23 +7,23 @@ if(enable_coverage) CACHE INTERNAL "") add_custom_target(coverage-clean COMMAND ${LCOV_PATH} --rc lcov_branch_coverage=1 --directory . --zerocounters - WORKING_DIRECTORY ${CMAKE_BINARY_DIR} + WORKING_DIRECTORY ${PROJECT_BINARY_DIR} ) add_custom_target(coverage COMMAND ${LCOV_PATH} --rc lcov_branch_coverage=1 --directory . --capture --output-file cov.info COMMAND ${LCOV_PATH} --rc lcov_branch_coverage=1 --remove cov.info '*/c++/*' '*/_ctype.h' '*/generated_src/*' --output-file cov.info.cleaned - COMMAND ${CMAKE_COMMAND} -Dsearch=${CMAKE_BINARY_DIR} - -Dreplace=${CMAKE_SOURCE_DIR} + COMMAND ${CMAKE_COMMAND} -Dsearch=${PROJECT_BINARY_DIR} + -Dreplace=${PROJECT_SOURCE_DIR} -Dsrc=cov.info.cleaned -Ddst=cov.info.final - -P ${CMAKE_SOURCE_DIR}/cmake/SearchReplace.cmake + -P ${PROJECT_SOURCE_DIR}/cmake/SearchReplace.cmake COMMAND ${GENHTML_PATH} --rc genhtml_branch_coverage=1 --function-coverage --branch-coverage --title "Doxygen Coverage Report" --num-spaces 2 - --legend --prefix ${CMAKE_SOURCE_DIR} --demangle-cpp + --legend --prefix ${PROJECT_SOURCE_DIR} --demangle-cpp --output-directory cov_output cov.info.final COMMAND ${CMAKE_COMMAND} -E remove cov.info cov.info.cleaned cov.info.final - WORKING_DIRECTORY ${CMAKE_BINARY_DIR} + WORKING_DIRECTORY ${PROJECT_BINARY_DIR} ) add_custom_command(TARGET coverage POST_BUILD COMMAND ; diff --git a/cmake/doxygen_version.cmake b/cmake/doxygen_version.cmake index 2433889..0797cac 100644 --- a/cmake/doxygen_version.cmake +++ b/cmake/doxygen_version.cmake @@ -40,7 +40,7 @@ endmacro() CHECK_REQUIRED_VARIABLE(PRE_CONFIGURE_DOXYGEN_VERSION_FILE) CHECK_REQUIRED_VARIABLE(POST_CONFIGURE_DOXYGEN_VERSION_FILE) -CHECK_OPTIONAL_VARIABLE(DOXY_STATE_FILE "${CMAKE_SOURCE_DIR}/VERSION") +CHECK_OPTIONAL_VARIABLE(DOXY_STATE_FILE "${PROJECT_SOURCE_DIR}/VERSION") # Function: DoxygenStateChangedAction # Description: this function is executed when the diff --git a/cmake/git_watcher.cmake b/cmake/git_watcher.cmake index ac34c1d..da1a68f 100644 --- a/cmake/git_watcher.cmake +++ b/cmake/git_watcher.cmake @@ -64,7 +64,7 @@ CHECK_REQUIRED_VARIABLE(PRE_CONFIGURE_GIT_VERSION_FILE) CHECK_REQUIRED_VARIABLE(POST_CONFIGURE_GIT_VERSION_FILE) CHECK_OPTIONAL_VARIABLE(GIT_STATE_FILE "${GENERATED_SRC}/git_state") #CHECK_REQUIRED_VARIABLE(GIT_STATE_FILE) -CHECK_OPTIONAL_VARIABLE(GIT_WORKING_DIR "${CMAKE_SOURCE_DIR}") +CHECK_OPTIONAL_VARIABLE(GIT_WORKING_DIR "${PROJECT_SOURCE_DIR}") # Check the optional git variable. # If it's not set, we'll try to find it using the CMake packaging system. diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt index a094c57..adde05e 100644 --- a/doc/CMakeLists.txt +++ b/doc/CMakeLists.txt @@ -107,8 +107,8 @@ file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/man foreach (f ${DOC_FILES}) add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/doc/${f} - COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/doc/${f} ${PROJECT_BINARY_DIR}/doc/ - DEPENDS ${CMAKE_SOURCE_DIR}/doc/${f} + COMMAND ${CMAKE_COMMAND} -E copy ${PROJECT_SOURCE_DIR}/doc/${f} ${PROJECT_BINARY_DIR}/doc/ + DEPENDS ${PROJECT_SOURCE_DIR}/doc/${f} ) set_source_files_properties(${PROJECT_BINARY_DIR}/doc/${f} PROPERTIES GENERATED 1) list(APPEND OUT_DOC_FILES "${PROJECT_BINARY_DIR}/doc/${f}") @@ -116,24 +116,24 @@ endforeach() foreach (f ${DOC_FILES_CHM}) add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/doc/${f} - COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/doc/${f} ${PROJECT_BINARY_DIR}/doc/ - DEPENDS ${CMAKE_SOURCE_DIR}/doc/${f} + COMMAND ${CMAKE_COMMAND} -E copy ${PROJECT_SOURCE_DIR}/doc/${f} ${PROJECT_BINARY_DIR}/doc/ + DEPENDS ${PROJECT_SOURCE_DIR}/doc/${f} ) set_source_files_properties(${PROJECT_BINARY_DIR}/doc/${f} PROPERTIES GENERATED 1) list(APPEND OUT_DOC_CHM_FILES "${PROJECT_BINARY_DIR}/doc/${f}") endforeach() -configure_file(${CMAKE_SOURCE_DIR}/doc/manual.sty ${PROJECT_BINARY_DIR}/doc/manual.sty) -configure_file(${CMAKE_SOURCE_DIR}/doc/doxygen_manual.tex ${PROJECT_BINARY_DIR}/doc/doxygen_manual.tex) -configure_file(${CMAKE_SOURCE_DIR}/doc/doxygen.1 ${PROJECT_BINARY_DIR}/man/doxygen.1) -configure_file(${CMAKE_SOURCE_DIR}/doc/doxywizard.1 ${PROJECT_BINARY_DIR}/man/doxywizard.1) -configure_file(${CMAKE_SOURCE_DIR}/doc/doxysearch.1 ${PROJECT_BINARY_DIR}/man/doxysearch.1) -configure_file(${CMAKE_SOURCE_DIR}/doc/doxyindexer.1 ${PROJECT_BINARY_DIR}/man/doxyindexer.1) +configure_file(${PROJECT_SOURCE_DIR}/doc/manual.sty ${PROJECT_BINARY_DIR}/doc/manual.sty) +configure_file(${PROJECT_SOURCE_DIR}/doc/doxygen_manual.tex ${PROJECT_BINARY_DIR}/doc/doxygen_manual.tex) +configure_file(${PROJECT_SOURCE_DIR}/doc/doxygen.1 ${PROJECT_BINARY_DIR}/man/doxygen.1) +configure_file(${PROJECT_SOURCE_DIR}/doc/doxywizard.1 ${PROJECT_BINARY_DIR}/man/doxywizard.1) +configure_file(${PROJECT_SOURCE_DIR}/doc/doxysearch.1 ${PROJECT_BINARY_DIR}/man/doxysearch.1) +configure_file(${PROJECT_SOURCE_DIR}/doc/doxyindexer.1 ${PROJECT_BINARY_DIR}/man/doxyindexer.1) # doc/language.doc (see tag Doxyfile:INPUT) add_custom_command( - COMMAND ${PYTHON_EXECUTABLE} translator.py ${CMAKE_SOURCE_DIR} - DEPENDS ${CMAKE_SOURCE_DIR}/doc/maintainers.txt ${CMAKE_SOURCE_DIR}/doc/language.tpl ${PROJECT_BINARY_DIR}/doc/translator.py ${LANG_FILES} + COMMAND ${PYTHON_EXECUTABLE} translator.py ${PROJECT_SOURCE_DIR} + DEPENDS ${PROJECT_SOURCE_DIR}/doc/maintainers.txt ${PROJECT_SOURCE_DIR}/doc/language.tpl ${PROJECT_BINARY_DIR}/doc/translator.py ${LANG_FILES} OUTPUT language.doc WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/doc ) @@ -163,7 +163,7 @@ add_custom_target(doxygen_pdf COMMAND ${CMAKE_COMMAND} -E remove refman.tex COMMAND ${CMAKE_COMMAND} -E copy ${PROJECT_BINARY_DIR}/doc/doxygen_manual.tex . COMMAND ${CMAKE_COMMAND} -E copy ${PROJECT_BINARY_DIR}/doc/manual.sty . - COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/doc/doxygen_logo.pdf . + COMMAND ${CMAKE_COMMAND} -E copy ${PROJECT_SOURCE_DIR}/doc/doxygen_logo.pdf . COMMAND ${PDFLATEX} -shell-escape doxygen_manual.tex COMMAND ${MAKEINDEX} doxygen_manual.idx COMMAND ${PDFLATEX} -shell-escape doxygen_manual.tex diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 3f1c79b..f3d51f4 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -1,6 +1,6 @@ file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/examples ${PROJECT_BINARY_DIR}/html/examples) -file(GLOB EXAMPLE_FILES RELATIVE ${CMAKE_SOURCE_DIR}/examples "*") +file(GLOB EXAMPLE_FILES RELATIVE ${PROJECT_SOURCE_DIR}/examples "*") if (DOT) set(DIAGRAM_EXAMPLE ${PROJECT_BINARY_DIR}/html/examples/diagrams/html/index.html) @@ -8,8 +8,8 @@ endif() foreach (f ${EXAMPLE_FILES}) add_custom_command( - COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_SOURCE_DIR}/examples/${f}" "${PROJECT_BINARY_DIR}/examples/" - DEPENDS "${CMAKE_SOURCE_DIR}/examples/${f}" + COMMAND ${CMAKE_COMMAND} -E copy "${PROJECT_SOURCE_DIR}/examples/${f}" "${PROJECT_BINARY_DIR}/examples/" + DEPENDS "${PROJECT_SOURCE_DIR}/examples/${f}" OUTPUT "${PROJECT_BINARY_DIR}/examples/${f}" ) set_source_files_properties("${PROJECT_BINARY_DIR}/examples/${f}" PROPERTIES GENERATED 1) diff --git a/libmscgen/CMakeLists.txt b/libmscgen/CMakeLists.txt index 079fcfc..0a23900 100644 --- a/libmscgen/CMakeLists.txt +++ b/libmscgen/CMakeLists.txt @@ -1,14 +1,14 @@ include_directories( - ${CMAKE_SOURCE_DIR}/liblodepng - ${CMAKE_SOURCE_DIR}/libmscgen + ${PROJECT_SOURCE_DIR}/liblodepng + ${PROJECT_SOURCE_DIR}/libmscgen ${GENERATED_SRC} ) set(LEX_FILES mscgen_lexer) foreach(lex_file ${LEX_FILES}) add_custom_command( - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/src/scan_states.py ${CMAKE_SOURCE_DIR}/libmscgen/${lex_file}.l > ${GENERATED_SRC}/${lex_file}.l.h - DEPENDS ${CMAKE_SOURCE_DIR}/src/scan_states.py ${CMAKE_SOURCE_DIR}/libmscgen/${lex_file}.l + COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_SOURCE_DIR}/src/scan_states.py ${PROJECT_SOURCE_DIR}/libmscgen/${lex_file}.l > ${GENERATED_SRC}/${lex_file}.l.h + DEPENDS ${PROJECT_SOURCE_DIR}/src/scan_states.py ${PROJECT_SOURCE_DIR}/libmscgen/${lex_file}.l OUTPUT ${GENERATED_SRC}/${lex_file}.l.h ) set_source_files_properties(${GENERATED_SRC}/${lex_file}.l.h PROPERTIES GENERATED 1) diff --git a/libversion/CMakeLists.txt b/libversion/CMakeLists.txt index 009c236..9bd87c3 100644 --- a/libversion/CMakeLists.txt +++ b/libversion/CMakeLists.txt @@ -1,16 +1,16 @@ # vim:ts=4:sw=4:expandtab:autoindent: # setup information for doxygen version handling -set(PRE_CONFIGURE_DOXYGEN_VERSION_FILE "${CMAKE_SOURCE_DIR}/libversion/doxyversion.cpp.in") +set(PRE_CONFIGURE_DOXYGEN_VERSION_FILE "${PROJECT_SOURCE_DIR}/libversion/doxyversion.cpp.in") set(POST_CONFIGURE_DOXYGEN_VERSION_FILE "${GENERATED_SRC}/doxyversion.cpp") # setup information for git version handling -set(PRE_CONFIGURE_GIT_VERSION_FILE "${CMAKE_SOURCE_DIR}/libversion/gitversion.cpp.in") +set(PRE_CONFIGURE_GIT_VERSION_FILE "${PROJECT_SOURCE_DIR}/libversion/gitversion.cpp.in") set(POST_CONFIGURE_GIT_VERSION_FILE "${GENERATED_SRC}/gitversion.cpp") set(GIT_STATE_FILE "${GENERATED_SRC}/git_state") -include(${CMAKE_SOURCE_DIR}/cmake/git_watcher.cmake) -include(${CMAKE_SOURCE_DIR}/cmake/doxygen_version.cmake) +include(${PROJECT_SOURCE_DIR}/cmake/git_watcher.cmake) +include(${PROJECT_SOURCE_DIR}/cmake/doxygen_version.cmake) include_directories( . diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index cb28911..067c6cd 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,13 +1,13 @@ # vim:ts=4:sw=4:expandtab:autoindent: include_directories( - ${CMAKE_SOURCE_DIR}/qtools - ${CMAKE_SOURCE_DIR}/libmd5 - ${CMAKE_SOURCE_DIR}/liblodepng - ${CMAKE_SOURCE_DIR}/libmscgen - ${CMAKE_SOURCE_DIR}/libversion - ${CMAKE_SOURCE_DIR}/vhdlparser - ${CMAKE_SOURCE_DIR}/src + ${PROJECT_SOURCE_DIR}/qtools + ${PROJECT_SOURCE_DIR}/libmd5 + ${PROJECT_SOURCE_DIR}/liblodepng + ${PROJECT_SOURCE_DIR}/libmscgen + ${PROJECT_SOURCE_DIR}/libversion + ${PROJECT_SOURCE_DIR}/vhdlparser + ${PROJECT_SOURCE_DIR}/src ${CLANG_INCLUDEDIR} ${GENERATED_SRC} ) @@ -78,7 +78,7 @@ set_source_files_properties(${GENERATED_SRC}/ce_parse.h PROPERTIES GENERATED 1) # lang_cfg.h add_custom_command( COMMENT "Generating ${GENERATED_SRC}/lang_cfg.h" - COMMAND ${CMAKE_COMMAND} -P ${CMAKE_SOURCE_DIR}/cmake/lang_cfg.cmake ${GENERATED_SRC}/lang_cfg.h ${LANG_CODES} + COMMAND ${CMAKE_COMMAND} -P ${PROJECT_SOURCE_DIR}/cmake/lang_cfg.cmake ${GENERATED_SRC}/lang_cfg.h ${LANG_CODES} DEPENDS ${LANGUAGE_FILES} OUTPUT ${GENERATED_SRC}/lang_cfg.h ) @@ -86,15 +86,15 @@ set_source_files_properties(${GENERATED_SRC}/lang_cfg.h PROPERTIES GENERATED 1) # all resource files if (${CMAKE_VERSION} VERSION_EQUAL "3.11.0" OR ${CMAKE_VERSION} VERSION_GREATER "3.11.0") - file(GLOB RESOURCES CONFIGURE_DEPENDS ${CMAKE_SOURCE_DIR}/templates/*/*) + file(GLOB RESOURCES CONFIGURE_DEPENDS ${PROJECT_SOURCE_DIR}/templates/*/*) else() - file(GLOB RESOURCES ${CMAKE_SOURCE_DIR}/templates/*/*) + file(GLOB RESOURCES ${PROJECT_SOURCE_DIR}/templates/*/*) endif() # resources.cpp add_custom_command( COMMENT "Generating ${GENERATED_SRC}/resources.cpp" - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_LIST_DIR}/res2cc_cmd.py ${CMAKE_SOURCE_DIR}/templates ${GENERATED_SRC}/resources.cpp + COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_LIST_DIR}/res2cc_cmd.py ${PROJECT_SOURCE_DIR}/templates ${GENERATED_SRC}/resources.cpp DEPENDS ${RESOURCES} ${CMAKE_CURRENT_LIST_DIR}/res2cc_cmd.py OUTPUT ${GENERATED_SRC}/resources.cpp ) @@ -138,9 +138,9 @@ foreach(lex_file ${LEX_FILES}) set_source_files_properties(${GENERATED_SRC}/${lex_file}.l.h PROPERTIES GENERATED 1) # for code coverage we need the flex sources in the build src directory add_custom_command( - COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/src/${lex_file}.l ${CMAKE_BINARY_DIR}/src/${lex_file}.l - DEPENDS ${CMAKE_SOURCE_DIR}/src/${lex_file}.l - OUTPUT ${CMAKE_BINARY_DIR}/src/${lex_file}.l + COMMAND ${CMAKE_COMMAND} -E copy ${PROJECT_SOURCE_DIR}/src/${lex_file}.l ${PROJECT_BINARY_DIR}/src/${lex_file}.l + DEPENDS ${PROJECT_SOURCE_DIR}/src/${lex_file}.l + OUTPUT ${PROJECT_BINARY_DIR}/src/${lex_file}.l ) FLEX_TARGET(${lex_file} @@ -156,9 +156,9 @@ BISON_TARGET(constexp COMPILE_FLAGS "${YACC_FLAGS}") add_custom_command( - COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/src/constexp.y ${CMAKE_BINARY_DIR}/src - DEPENDS ${CMAKE_SOURCE_DIR}/src/constexp.y - OUTPUT ${CMAKE_BINARY_DIR}/src/constexp.y + COMMAND ${CMAKE_COMMAND} -E copy ${PROJECT_SOURCE_DIR}/src/constexp.y ${PROJECT_BINARY_DIR}/src + DEPENDS ${PROJECT_SOURCE_DIR}/src/constexp.y + OUTPUT ${PROJECT_BINARY_DIR}/src/constexp.y ) add_library(doxycfg STATIC diff --git a/testing/CMakeLists.txt b/testing/CMakeLists.txt index b354e78..fd6912e 100644 --- a/testing/CMakeLists.txt +++ b/testing/CMakeLists.txt @@ -1,7 +1,7 @@ # run all tests sequentially (keep for backward compatibility) add_custom_target(tests COMMENT "Running doxygen tests..." - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/testing/runtests.py --doxygen ${PROJECT_BINARY_DIR}/bin/doxygen --inputdir ${CMAKE_SOURCE_DIR}/testing --outputdir ${PROJECT_BINARY_DIR}/testing + COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_SOURCE_DIR}/testing/runtests.py --doxygen ${PROJECT_BINARY_DIR}/bin/doxygen --inputdir ${PROJECT_SOURCE_DIR}/testing --outputdir ${PROJECT_BINARY_DIR}/testing DEPENDS doxygen ) @@ -19,6 +19,6 @@ foreach(TEST_FILE ${TEST_FILES}) string(REGEX REPLACE "^.*/([0-9][0-9][0-9]*).*$" "\\1" TEST_ID "${TEST_FILE}") # add a test target for each test add_test(NAME ${TEST_NAME} - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/testing/runtests.py --id ${TEST_ID} --doxygen $ --inputdir ${CMAKE_SOURCE_DIR}/testing --outputdir ${PROJECT_BINARY_DIR}/testing + COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_SOURCE_DIR}/testing/runtests.py --id ${TEST_ID} --doxygen $ --inputdir ${PROJECT_SOURCE_DIR}/testing --outputdir ${PROJECT_BINARY_DIR}/testing ) endforeach() diff --git a/vhdlparser/CMakeLists.txt b/vhdlparser/CMakeLists.txt index 53983f5..25e8442 100644 --- a/vhdlparser/CMakeLists.txt +++ b/vhdlparser/CMakeLists.txt @@ -21,15 +21,15 @@ if (JAVACC_FOUND) else() add_custom_command( - COMMAND ${JAVACC_EXECUTABLE} ${JAVACC_FLAGS} -OUTPUT_DIRECTORY=${CMAKE_SOURCE_DIR}/vhdlparser ${CMAKE_SOURCE_DIR}/vhdlparser/vhdlparser.jj - DEPENDS ${CMAKE_SOURCE_DIR}/vhdlparser/vhdlparser.jj - OUTPUT ${CMAKE_SOURCE_DIR}/vhdlparser/CharStream.cc ${CMAKE_SOURCE_DIR}/vhdlparser/CharStream.h ${CMAKE_SOURCE_DIR}/vhdlparser/ErrorHandler.h ${CMAKE_SOURCE_DIR}/vhdlparser/ParseException.cc ${CMAKE_SOURCE_DIR}/vhdlparser/ParseException.h ${CMAKE_SOURCE_DIR}/vhdlparser/Token.cc ${CMAKE_SOURCE_DIR}/vhdlparser/Token.h ${CMAKE_SOURCE_DIR}/vhdlparser/TokenManager.h ${CMAKE_SOURCE_DIR}/vhdlparser/TokenMgrError.cc ${CMAKE_SOURCE_DIR}/vhdlparser/TokenMgrError.h ${CMAKE_SOURCE_DIR}/vhdlparser/VhdlParser.cc ${CMAKE_SOURCE_DIR}/vhdlparser/VhdlParser.h ${CMAKE_SOURCE_DIR}/vhdlparser/VhdlParserConstants.h ${CMAKE_SOURCE_DIR}/vhdlparser/VhdlParserTokenManager.cc ${CMAKE_SOURCE_DIR}/vhdlparser/VhdlParserTokenManager.h + COMMAND ${JAVACC_EXECUTABLE} ${JAVACC_FLAGS} -OUTPUT_DIRECTORY=${PROJECT_SOURCE_DIR}/vhdlparser ${PROJECT_SOURCE_DIR}/vhdlparser/vhdlparser.jj + DEPENDS ${PROJECT_SOURCE_DIR}/vhdlparser/vhdlparser.jj + OUTPUT ${PROJECT_SOURCE_DIR}/vhdlparser/CharStream.cc ${PROJECT_SOURCE_DIR}/vhdlparser/CharStream.h ${PROJECT_SOURCE_DIR}/vhdlparser/ErrorHandler.h ${PROJECT_SOURCE_DIR}/vhdlparser/ParseException.cc ${PROJECT_SOURCE_DIR}/vhdlparser/ParseException.h ${PROJECT_SOURCE_DIR}/vhdlparser/Token.cc ${PROJECT_SOURCE_DIR}/vhdlparser/Token.h ${PROJECT_SOURCE_DIR}/vhdlparser/TokenManager.h ${PROJECT_SOURCE_DIR}/vhdlparser/TokenMgrError.cc ${PROJECT_SOURCE_DIR}/vhdlparser/TokenMgrError.h ${PROJECT_SOURCE_DIR}/vhdlparser/VhdlParser.cc ${PROJECT_SOURCE_DIR}/vhdlparser/VhdlParser.h ${PROJECT_SOURCE_DIR}/vhdlparser/VhdlParserConstants.h ${PROJECT_SOURCE_DIR}/vhdlparser/VhdlParserTokenManager.cc ${PROJECT_SOURCE_DIR}/vhdlparser/VhdlParserTokenManager.h ) endif() endif() -include_directories(${CMAKE_SOURCE_DIR}/src ${CMAKE_SOURCE_DIR}/qtools ${GENERATED_SRC}) +include_directories(${PROJECT_SOURCE_DIR}/src ${PROJECT_SOURCE_DIR}/qtools ${GENERATED_SRC}) add_library(vhdlparser STATIC CharStream.cc ParseException.cc -- cgit v0.12