From: maier Date: Thu, 3 Oct 2013 23:17:06 +0000 (+0000) Subject: Bugfix: resolve issue 105 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3ef2ed12a8dc122422d438fc1e6082d140137eb1;p=dealii-svn.git Bugfix: resolve issue 105 git-svn-id: https://svn.dealii.org/trunk@31109 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/CMakeLists.txt b/deal.II/CMakeLists.txt index 714613a8c7..239be6ea18 100644 --- a/deal.II/CMakeLists.txt +++ b/deal.II/CMakeLists.txt @@ -117,6 +117,7 @@ ENDFOREACH() # # Finalize the configuration: # +INCLUDE(setup_custom_targets) INCLUDE(setup_finalize) diff --git a/deal.II/cmake/scripts/CMakeLists.txt b/deal.II/cmake/scripts/CMakeLists.txt index 96539b7835..299cc0257c 100644 --- a/deal.II/cmake/scripts/CMakeLists.txt +++ b/deal.II/cmake/scripts/CMakeLists.txt @@ -79,14 +79,10 @@ IF(DEAL_II_COMPONENT_COMPAT_FILES) ) ENDIF() - # - # A custom target with the same name as the component: - # - ADD_CUSTOM_TARGET(compat_files - DEPENDS - expand_instantiations - make_dependencies - report_features + ADD_DEPENDENCIES(compat_files + expand_instantiations + make_dependencies + report_features ) IF(NOT CMAKE_CROSSCOMPILING) diff --git a/deal.II/cmake/setup_custom_targets.cmake b/deal.II/cmake/setup_custom_targets.cmake new file mode 100644 index 0000000000..3781d4ccd7 --- /dev/null +++ b/deal.II/cmake/setup_custom_targets.cmake @@ -0,0 +1,51 @@ +## --------------------------------------------------------------------- +## $Id$ +## +## Copyright (C) 2013 by the deal.II authors +## +## This file is part of the deal.II library. +## +## The deal.II library is free software; you can use it, redistribute +## it, and/or modify it under the terms of the GNU Lesser General +## Public License as published by the Free Software Foundation; either +## version 2.1 of the License, or (at your option) any later version. +## The full text of the license can be found in the file LICENSE at +## the top level of the deal.II distribution. +## +## --------------------------------------------------------------------- + +# +# Add convenience targets that build and install only a specific component: +# + +FOREACH(_component library examples) + ADD_CUSTOM_TARGET(${_component} + COMMAND ${CMAKE_COMMAND} + -DCOMPONENT="${_component}" -P cmake_install.cmake + COMMENT "Build and install component \"${_component}\"." + WORKING_DIRECTORY ${CMAKE_BINARY_DIR} + ) +ENDFOREACH() + +FOREACH(_component compat_files documentation mesh_converter parameter_gui) + STRING(TOUPPER "${_component}" _component_uppercase) + IF(DEAL_II_COMPONENT_${_component_uppercase}) + + ADD_CUSTOM_TARGET(${_component} + COMMAND ${CMAKE_COMMAND} + -DCOMPONENT="${_component}" -P cmake_install.cmake + COMMENT "Build and install component \"${_component}\"." + WORKING_DIRECTORY ${CMAKE_BINARY_DIR} + ) + + ELSE() + + ADD_CUSTOM_TARGET(${_component} + COMMAND ${CMAKE_COMMAND} -E echo "Error: Could not build and install disabled component \"${_component}\"." + && ${CMAKE_COMMAND} -E echo "Please reconfigure with -DDEAL_II_COMPONENT_${_component}=yes" + && false + ) + + ENDIF() +ENDFOREACH() + diff --git a/deal.II/cmake/setup_finalize.cmake b/deal.II/cmake/setup_finalize.cmake index 0584cc7696..bcb40185ee 100644 --- a/deal.II/cmake/setup_finalize.cmake +++ b/deal.II/cmake/setup_finalize.cmake @@ -258,7 +258,7 @@ FOREACH(_var ${_components}) ENDFOREACH() _summary( - "#\n# Detailed information (compiler flags, feature configuration) can be found in detailed.log\n" + "#\n# Detailed information (compiler flags, feature configuration) can be found in detailed.log\n" ) _both("#\n###") diff --git a/deal.II/contrib/CMakeLists.txt b/deal.II/contrib/CMakeLists.txt index f507b519eb..6e92950efa 100644 --- a/deal.II/contrib/CMakeLists.txt +++ b/deal.II/contrib/CMakeLists.txt @@ -22,5 +22,3 @@ IF(DEAL_II_COMPONENT_PARAMETER_GUI) ADD_SUBDIRECTORY(parameter_gui) ENDIF() -#ADD_SUBDIRECTORY(test_affinity) - diff --git a/deal.II/contrib/mesh_conversion/CMakeLists.txt b/deal.II/contrib/mesh_conversion/CMakeLists.txt index 2c8dbc4c8f..72e26ef2c4 100644 --- a/deal.II/contrib/mesh_conversion/CMakeLists.txt +++ b/deal.II/contrib/mesh_conversion/CMakeLists.txt @@ -17,18 +17,22 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.8) #PROJECT(mesh_converter) -ADD_EXECUTABLE(mesh_converter +ADD_EXECUTABLE(mesh_converter_exe Main.cc MeshConversion.cc ) +SET_TARGET_PROPERTIES(mesh_converter_exe + PROPERTIES OUTPUT_NAME mesh_converter + ) + +ADD_DEPENDENCIES(mesh_converter mesh_converter_exe) IF("${DEAL_II_EXECUTABLE_RELDIR}" STREQUAL "") SET(DEAL_II_EXECUTABLE_RELDIR "bin") ENDIF() -INSTALL(TARGETS mesh_converter +INSTALL(TARGETS mesh_converter_exe RUNTIME DESTINATION ${DEAL_II_EXECUTABLE_RELDIR} COMPONENT mesh_converter ) - diff --git a/deal.II/contrib/parameter_gui/CMakeLists.txt b/deal.II/contrib/parameter_gui/CMakeLists.txt index 542b9a5766..7ff3f24f7e 100644 --- a/deal.II/contrib/parameter_gui/CMakeLists.txt +++ b/deal.II/contrib/parameter_gui/CMakeLists.txt @@ -35,7 +35,7 @@ QT4_ADD_RESOURCES(SOURCE_RCC application.qrc ) -ADD_EXECUTABLE(parameter_gui +ADD_EXECUTABLE(parameter_gui_exe browse_lineedit.cpp info_message.cpp main.cpp @@ -46,16 +46,17 @@ ADD_EXECUTABLE(parameter_gui ${SOURCE_MOC} ${SOURCE_RCC} ) +SET_TARGET_PROPERTIES(parameter_gui_exe PROPERTIES OUTPUT_NAME parameter_gui) +TARGET_LINK_LIBRARIES(parameter_gui_exe ${QT_LIBRARIES}) -TARGET_LINK_LIBRARIES(parameter_gui ${QT_LIBRARIES}) +ADD_DEPENDENCIES(parameter_gui parameter_gui_exe) IF("${DEAL_II_EXECUTABLE_RELDIR}" STREQUAL "") SET(DEAL_II_EXECUTABLE_RELDIR "bin") ENDIF() -INSTALL(TARGETS parameter_gui - RUNTIME - DESTINATION ${DEAL_II_EXECUTABLE_RELDIR} +INSTALL(TARGETS parameter_gui_exe + RUNTIME DESTINATION ${DEAL_II_EXECUTABLE_RELDIR} COMPONENT parameter_gui ) diff --git a/deal.II/doc/CMakeLists.txt b/deal.II/doc/CMakeLists.txt index 8e63586481..35613026ca 100644 --- a/deal.II/doc/CMakeLists.txt +++ b/deal.II/doc/CMakeLists.txt @@ -50,7 +50,7 @@ IF(DEAL_II_COMPONENT_DOCUMENTATION) # # A custom target with the same name as the component: # - ADD_CUSTOM_TARGET(documentation DEPENDS doxygen) + ADD_DEPENDENCIES(documentation doxygen) # # Install the static elements of the html documentation: diff --git a/deal.II/source/CMakeLists.txt b/deal.II/source/CMakeLists.txt index 5b21083aac..aa94d1d8ec 100644 --- a/deal.II/source/CMakeLists.txt +++ b/deal.II/source/CMakeLists.txt @@ -49,9 +49,6 @@ ADD_SUBDIRECTORY(integrators) ADD_SUBDIRECTORY(matrix_free) ADD_SUBDIRECTORY(meshworker) - -ADD_CUSTOM_TARGET(library) - FOREACH(build ${DEAL_II_BUILD_TYPES}) STRING(TOLOWER ${build} build_lowercase)