From 39cd7c10d030f0f4ebded909c64b0c20065015e9 Mon Sep 17 00:00:00 2001 From: maier Date: Wed, 19 Sep 2012 14:07:10 +0000 Subject: [PATCH] Add an install functionality git-svn-id: https://svn.dealii.org/branches/branch_cmake@26508 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/CMakeLists.txt | 11 ++++-- deal.II/examples/CMakeLists.txt | 70 +++++++++++++++++++++++++++++++++ deal.II/include/CMakeLists.txt | 23 +++++++++++ deal.II/source/CMakeLists.txt | 18 +++++++-- 4 files changed, 115 insertions(+), 7 deletions(-) create mode 100644 deal.II/examples/CMakeLists.txt diff --git a/deal.II/CMakeLists.txt b/deal.II/CMakeLists.txt index 9b099086eb..2b9d7b4a20 100644 --- a/deal.II/CMakeLists.txt +++ b/deal.II/CMakeLists.txt @@ -302,7 +302,7 @@ INCLUDE(setup_finalize) ########################################################################### # # -# Compile the library: # +# Compile and install the library: # # # ########################################################################### @@ -310,14 +310,19 @@ INCLUDE(setup_finalize) # # Build the toolchain and prepare the includes: # - ADD_SUBDIRECTORY(contrib/config) ADD_SUBDIRECTORY(contrib/expand_instantiations) ADD_SUBDIRECTORY(include) + # -# Compile the library: +# Prepare the examples: # +ADD_SUBDIRECTORY(examples) + +# +# Compile the library: +# ADD_SUBDIRECTORY(source) diff --git a/deal.II/examples/CMakeLists.txt b/deal.II/examples/CMakeLists.txt new file mode 100644 index 0000000000..bb4f969dc6 --- /dev/null +++ b/deal.II/examples/CMakeLists.txt @@ -0,0 +1,70 @@ +# +# Generate the documentation via doxygen: +# + + +# TODO + + +# +# Add a rule on how to install the examples: +# + +SET(deal_ii_examples + step-1 + step-2 + step-3 + step-4 + step-5 + step-6 + step-7 + step-8 + step-9 + step-10 + step-11 + step-12 + step-13 + step-14 + step-15 + step-16 + step-17 + step-18 + step-19 + step-20 + step-21 + step-22 + step-23 + step-24 + step-25 + step-26 + step-27 + step-28 + step-29 + step-30 + step-31 + step-32 + step-33 + step-34 + step-35 + step-36 + step-37 + step-38 + step-39 + step-40 + step-41 + step-42 + step-43 + step-44 + step-45 + step-46 + step-47 + step-48 + ) + +FOREACH(step ${deal_ii_examples}) + INSTALL(DIRECTORY ${step} + DESTINATION usr/share/doc/deal.II/examples + COMPONENT examples + PATTERN "doc" EXCLUDE + ) +ENDFOREACH() diff --git a/deal.II/include/CMakeLists.txt b/deal.II/include/CMakeLists.txt index af7adfa2a5..64c8037412 100644 --- a/deal.II/include/CMakeLists.txt +++ b/deal.II/include/CMakeLists.txt @@ -1,8 +1,12 @@ +# +# Configure config.h +# CONFIGURE_FILE( ${CMAKE_CURRENT_SOURCE_DIR}/deal.II/base/config.h.in ${CMAKE_CURRENT_BINARY_DIR}/deal.II/base/config.h ) + # #TODO: This perl script has to die...: # @@ -21,3 +25,22 @@ ADD_CUSTOM_TARGET(lapack_templates ALL ADD_DEPENDENCIES(deal_ii_target_dependencies lapack_templates) + +# +# Add a rule on how to install the header files: +# + +INSTALL(DIRECTORY deal.II + DESTINATION include + COMPONENT library + FILES_MATCHING PATTERN "*.h" + ) + +# +# and don't forget to install all generated header files, too: +# +INSTALL(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/deal.II + DESTINATION include + COMPONENT library + FILES_MATCHING PATTERN "*.h" + ) diff --git a/deal.II/source/CMakeLists.txt b/deal.II/source/CMakeLists.txt index a9378efece..0000f2d04f 100644 --- a/deal.II/source/CMakeLists.txt +++ b/deal.II/source/CMakeLists.txt @@ -2,13 +2,11 @@ # Compile the deal.II library # - INCLUDE_DIRECTORIES( ${CMAKE_SOURCE_DIR}/include/ ${CMAKE_BINARY_DIR}/include/ ) - # # Each subdirectory specifies an OBJECT target: # @@ -22,8 +20,10 @@ ADD_SUBDIRECTORY(lac) ADD_SUBDIRECTORY(multigrid) ADD_SUBDIRECTORY(numerics) - -ADD_LIBRARY(deal_II #whether SHARED or STATIC is set by BUILD_SHARED_LIBS# +# +# Combine all OBJECT targets to a library: +# +ADD_LIBRARY(deal_II $ $ $ @@ -54,3 +54,13 @@ SET_TARGET_PROPERTIES(deal_II PROPERTIES ) TARGET_LINK_LIBRARIES(deal_II ${deal_ii_external_libraries}) + + +# +# Finally, add a rule how to install the library: +# +INSTALL(TARGETS deal_II + LIBRARY + DESTINATION lib${LIB_SUFFIX} + COMPONENT library + ) -- 2.39.5