From 392e3adebbdbe61261129cc4acda0f360f83cac2 Mon Sep 17 00:00:00 2001 From: vsr Date: Wed, 21 Aug 2013 06:05:41 +0000 Subject: [PATCH] CMake build procedure improvements: - minor general improvements --- CMakeLists.txt | 2 +- doc/docutils/CMakeLists.txt | 2 +- doc/salome/gui/CMakeLists.txt | 11 ++----- doc/salome/gui/doxyfile.in | 36 +++++++++++------------ doc/salome/tui/CMakeLists.txt | 11 ++----- doc/salome/tui/doxyfile.in | 20 ++++++------- salome_adm/CMakeLists.txt | 2 +- salome_adm/cmake_files/SalomeMacros.cmake | 20 +++++++++---- 8 files changed, 50 insertions(+), 54 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b3747b9cc..8cd3236d6 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -174,7 +174,7 @@ ENDIF() # Header configuration # ==================== SALOME_XVERSION(${PROJECT_NAME}) -SALOME_CONFIGURE_FILE(KERNEL_version.h.in ${CMAKE_CURRENT_BINARY_DIR}/KERNEL_version.h INSTALL ${SALOME_INSTALL_HEADERS}) +SALOME_CONFIGURE_FILE(KERNEL_version.h.in KERNEL_version.h INSTALL ${SALOME_INSTALL_HEADERS}) # Configuration export # ==================== diff --git a/doc/docutils/CMakeLists.txt b/doc/docutils/CMakeLists.txt index a87ab4f80..9ceadd855 100755 --- a/doc/docutils/CMakeLists.txt +++ b/doc/docutils/CMakeLists.txt @@ -38,7 +38,7 @@ SET(ALLSPHINXOPTS ${SOURCEDIR} ) -SALOME_CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/conf.py.in" "${CMAKE_CURRENT_BINARY_DIR}/conf.py") +SALOME_CONFIGURE_FILE(conf.py.in conf.py) # Write the shell file preparing the env for the Sphinx run: # This uses the paths to SPHINX, DOCUTILS and SETUPTOOLS: diff --git a/doc/salome/gui/CMakeLists.txt b/doc/salome/gui/CMakeLists.txt index 1eaf1fce5..58027d8d5 100755 --- a/doc/salome/gui/CMakeLists.txt +++ b/doc/salome/gui/CMakeLists.txt @@ -17,15 +17,8 @@ # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # -SET(top_builddir ${PROJECT_BINARY_DIR}) -SET(top_srcdir ${PROJECT_SOURCE_DIR}) -SET(srcdir ${CMAKE_CURRENT_SOURCE_DIR}) -SET(builddir ${CMAKE_CURRENT_BINARY_DIR}) -SET(datadir ${CMAKE_INSTALL_PREFIX}/share) -SET(docdir ${datadir}/doc/salome) - -CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/doxyfile.in ${CMAKE_CURRENT_BINARY_DIR}/doxyfile) -CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/static/header.html.in ${CMAKE_CURRENT_BINARY_DIR}/static/header.html) +SALOME_CONFIGURE_FILE(doxyfile.in doxyfile) +SALOME_CONFIGURE_FILE(static/header.html.in static/header.html) ADD_CUSTOM_TARGET(usr_docs ${DOXYGEN_EXECUTABLE}) diff --git a/doc/salome/gui/doxyfile.in b/doc/salome/gui/doxyfile.in index 35f84be3a..af2f44c69 100644 --- a/doc/salome/gui/doxyfile.in +++ b/doc/salome/gui/doxyfile.in @@ -15,7 +15,7 @@ ABBREVIATE_BRIEF = ALWAYS_DETAILED_SEC = YES INLINE_INHERITED_MEMB = YES FULL_PATH_NAMES = YES -STRIP_FROM_PATH = @top_builddir@ @top_srcdir@ +STRIP_FROM_PATH = @PROJECT_BINARY_DIR@ @PROJECT_SOURCE_DIR@ STRIP_FROM_INC_PATH = SHORT_NAMES = NO JAVADOC_AUTOBRIEF = YES @@ -76,28 +76,28 @@ WARN_LOGFILE = log.txt # configuration options related to the input files #--------------------------------------------------------------------------- INPUT = \ - @top_srcdir@/doc/salome \ - @top_srcdir@/bin \ - @top_srcdir@/idl \ - @top_srcdir@/src/Container \ - @top_srcdir@/src/LifeCycleCORBA \ - @top_srcdir@/src/NamingService \ - @top_srcdir@/src/Notification \ - @top_srcdir@/src/SALOMEDS/SALOME_DriverPy.py \ - @top_srcdir@/src/KERNEL_PY/salome.py \ - @top_srcdir@/src/KERNEL_PY/salome_iapp.py \ - @top_srcdir@/src/Utils \ - @top_srcdir@/src/DSC + @PROJECT_SOURCE_DIR@/doc/salome \ + @PROJECT_SOURCE_DIR@/bin \ + @PROJECT_SOURCE_DIR@/idl \ + @PROJECT_SOURCE_DIR@/src/Container \ + @PROJECT_SOURCE_DIR@/src/LifeCycleCORBA \ + @PROJECT_SOURCE_DIR@/src/NamingService \ + @PROJECT_SOURCE_DIR@/src/Notification \ + @PROJECT_SOURCE_DIR@/src/SALOMEDS/SALOME_DriverPy.py \ + @PROJECT_SOURCE_DIR@/src/KERNEL_PY/salome.py \ + @PROJECT_SOURCE_DIR@/src/KERNEL_PY/salome_iapp.py \ + @PROJECT_SOURCE_DIR@/src/Utils \ + @PROJECT_SOURCE_DIR@/src/DSC FILE_PATTERNS = *.dox *.idl *.hxx *.cxx *.py RECURSIVE = YES EXCLUDE = EXCLUDE_SYMLINKS = NO EXCLUDE_PATTERNS = -EXAMPLE_PATH = @top_srcdir@/doc/salome/examples +EXAMPLE_PATH = @PROJECT_SOURCE_DIR@/doc/salome/examples EXAMPLE_PATTERNS = EXAMPLE_RECURSIVE = NO -IMAGE_PATH = @srcdir@/images +IMAGE_PATH = @CMAKE_CURRENT_SOURCE_DIR@/images INPUT_FILTER = FILTER_PATTERNS = FILTER_SOURCE_FILES = NO @@ -126,9 +126,9 @@ IGNORE_PREFIX = GENERATE_HTML = YES HTML_OUTPUT = . HTML_FILE_EXTENSION = .html -HTML_HEADER = @builddir@/static/header.html -HTML_FOOTER = @srcdir@/static/footer.html -HTML_EXTRA_STYLESHEET = @srcdir@/static/salome_extra.css +HTML_HEADER = @CMAKE_CURRENT_BINARY_DIR@/static/header.html +HTML_FOOTER = @CMAKE_CURRENT_SOURCE_DIR@/static/footer.html +HTML_EXTRA_STYLESHEET = @CMAKE_CURRENT_SOURCE_DIR@/static/salome_extra.css HTML_ALIGN_MEMBERS = YES GENERATE_HTMLHELP = NO CHM_FILE = diff --git a/doc/salome/tui/CMakeLists.txt b/doc/salome/tui/CMakeLists.txt index b28d7fd6f..bff14febd 100755 --- a/doc/salome/tui/CMakeLists.txt +++ b/doc/salome/tui/CMakeLists.txt @@ -17,15 +17,8 @@ # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # -SET(top_builddir ${PROJECT_BINARY_DIR}) -SET(top_srcdir ${PROJECT_SOURCE_DIR}) -SET(srcdir ${CMAKE_CURRENT_SOURCE_DIR}) -SET(builddir ${CMAKE_CURRENT_BINARY_DIR}) -SET(datadir ${CMAKE_INSTALL_PREFIX}/share) -SET(docdir ${datadir}/doc/salome) - -CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/doxyfile.in ${CMAKE_CURRENT_BINARY_DIR}/doxyfile) -CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/static/header.html.in ${CMAKE_CURRENT_BINARY_DIR}/static/header.html) +SALOME_CONFIGURE_FILE(doxyfile.in doxyfile) +SALOME_CONFIGURE_FILE(static/header.html.in static/header.html) ADD_CUSTOM_TARGET(dev_docs ${DOXYGEN_EXECUTABLE} -u COMMAND ${DOXYGEN_EXECUTABLE} diff --git a/doc/salome/tui/doxyfile.in b/doc/salome/tui/doxyfile.in index ca1a8ee67..71b1d14d4 100644 --- a/doc/salome/tui/doxyfile.in +++ b/doc/salome/tui/doxyfile.in @@ -35,7 +35,7 @@ ABBREVIATE_BRIEF = ALWAYS_DETAILED_SEC = YES INLINE_INHERITED_MEMB = YES FULL_PATH_NAMES = YES -STRIP_FROM_PATH = @top_srcdir@ @top_builddir@ +STRIP_FROM_PATH = @PROJECT_SOURCE_DIR@ @PROJECT_BINARY_DIR@ STRIP_FROM_INC_PATH = SHORT_NAMES = NO JAVADOC_AUTOBRIEF = YES @@ -96,11 +96,11 @@ WARN_LOGFILE = log.txt #--------------------------------------------------------------------------- # configuration options related to the input files #--------------------------------------------------------------------------- -INPUT = @top_srcdir@/src \ - @top_srcdir@/bin \ - @top_srcdir@/idl \ - @top_builddir@/bin \ - @srcdir@/input +INPUT = @PROJECT_SOURCE_DIR@/src \ + @PROJECT_SOURCE_DIR@/bin \ + @PROJECT_SOURCE_DIR@/idl \ + @PROJECT_BINARY_DIR@/bin \ + @CMAKE_CURRENT_SOURCE_DIR@/input FILE_PATTERNS = *.idl *.hxx *.cxx *.h *.c *.hh *.cc @DOXYGEN_PYTHON_EXTENSION@ *.doc RECURSIVE = YES EXCLUDE = @@ -109,7 +109,7 @@ EXCLUDE_PATTERNS = EXAMPLE_PATH = EXAMPLE_PATTERNS = EXAMPLE_RECURSIVE = NO -IMAGE_PATH = @srcdir@/images +IMAGE_PATH = @CMAKE_CURRENT_SOURCE_DIR@/images INPUT_FILTER = FILTER_PATTERNS = FILTER_SOURCE_FILES = YES @@ -138,9 +138,9 @@ IGNORE_PREFIX = GENERATE_HTML = YES HTML_OUTPUT = . HTML_FILE_EXTENSION = .html -HTML_HEADER = @builddir@/static/header.html -HTML_FOOTER = @srcdir@/static/footer.html -HTML_EXTRA_STYLESHEET = @srcdir@/static/salome_extra.css +HTML_HEADER = @CMAKE_CURRENT_BINARY_DIR@/static/header.html +HTML_FOOTER = @CMAKE_CURRENT_SOURCE_DIR@/static/footer.html +HTML_EXTRA_STYLESHEET = @CMAKE_CURRENT_SOURCE_DIR@/static/salome_extra.css HTML_ALIGN_MEMBERS = YES GENERATE_HTMLHELP = NO CHM_FILE = diff --git a/salome_adm/CMakeLists.txt b/salome_adm/CMakeLists.txt index 3760caf2a..84027d016 100755 --- a/salome_adm/CMakeLists.txt +++ b/salome_adm/CMakeLists.txt @@ -20,5 +20,5 @@ ADD_SUBDIRECTORY(unix) ADD_SUBDIRECTORY(cmake_files) -SALOME_CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/SALOMEconfig.ref.in" "${CMAKE_CURRENT_BINARY_DIR}/SALOMEconfig.h" INSTALL ${SALOME_INSTALL_HEADERS}) +SALOME_CONFIGURE_FILE(SALOMEconfig.ref.in SALOMEconfig.h INSTALL ${SALOME_INSTALL_HEADERS}) INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/SALOMEconfig.ref.in DESTINATION ${SALOME_INSTALL_AMCONFIG} RENAME SALOMEconfig.h.in) \ No newline at end of file diff --git a/salome_adm/cmake_files/SalomeMacros.cmake b/salome_adm/cmake_files/SalomeMacros.cmake index d26725b51..609566acf 100755 --- a/salome_adm/cmake_files/SalomeMacros.cmake +++ b/salome_adm/cmake_files/SalomeMacros.cmake @@ -151,16 +151,26 @@ ENDMACRO(INSTALL_AND_COMPILE_PYTHON_FILE PYFILE2COMPINST PYFILELOC) # USAGE: SALOME_CONFIGURE_FILE(in_file out_file [INSTALL dir]) # # ARGUMENTS: -# in_file: IN : input file with full paths. -# out_file: IN : output file with full paths. +# in_file: IN : input file (if relative path is given, full file path is computed from current source dir). +# out_file: IN : output file (if relative path is given, full file path is computed from current build dir). # If INSTALL is specified, then 'out_file' will be installed to the 'dir' directory. #---------------------------------------------------------------------------- MACRO(SALOME_CONFIGURE_FILE IN_FILE OUT_FILE) - MESSAGE(STATUS "Creation of ${OUT_FILE}") - CONFIGURE_FILE(${IN_FILE} ${OUT_FILE} @ONLY) + IF(IS_ABSOLUTE ${IN_FILE}) + SET(_in_file ${IN_FILE}) + ELSE() + SET(_in_file ${CMAKE_CURRENT_SOURCE_DIR}/${IN_FILE}) + ENDIF() + IF(IS_ABSOLUTE ${OUT_FILE}) + SET(_out_file ${OUT_FILE}) + ELSE() + SET(_out_file ${CMAKE_CURRENT_BINARY_DIR}/${OUT_FILE}) + ENDIF() + MESSAGE(STATUS "Creation of ${_out_file}") + CONFIGURE_FILE(${_in_file} ${_out_file} @ONLY) PARSE_ARGUMENTS(SALOME_CONFIGURE_FILE "INSTALL" "" ${ARGN}) IF(SALOME_CONFIGURE_FILE_INSTALL) - INSTALL(FILES ${OUT_FILE} DESTINATION ${SALOME_CONFIGURE_FILE_INSTALL}) + INSTALL(FILES ${_out_file} DESTINATION ${SALOME_CONFIGURE_FILE_INSTALL}) ENDIF(SALOME_CONFIGURE_FILE_INSTALL) ENDMACRO(SALOME_CONFIGURE_FILE) -- 2.39.2