Skip to content
Snippets Groups Projects
Commit 4d3a82d9 authored by Markus Blatt's avatar Markus Blatt
Browse files

- Got rid off debugging output.

- Removed dependency on cmake version 2.8.9
  Object libraries can now be created with dune_add_library(<target>
  OBJECT <sources>). It will create a GLOBAL property
  _DUNE_TARGET_OBJECTS:<target>_ that records the full path to the
  source files. Theses can later be referenced by providing
  _DUNE_TARGET_OBJECTS:<target>_ as one of the sources to dune_add_library

[[Imported from SVN: r6987]]
parent 36048e87
No related branches found
No related tags found
No related merge requests found
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
project("dune-common" C CXX) project("dune-common" C CXX)
# general stuff # general stuff
cmake_minimum_required(VERSION 2.8.8) cmake_minimum_required(VERSION 2.8)
# make sure our own modules are found # make sure our own modules are found
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/modules") set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/modules")
......
...@@ -52,10 +52,8 @@ MACRO(create_doc_install filename targetdir) ...@@ -52,10 +52,8 @@ MACRO(create_doc_install filename targetdir)
get_filename_component(targetfile ${filename} NAME) get_filename_component(targetfile ${filename} NAME)
set(install_command ${CMAKE_COMMAND} -D FILES=${filename} -D DIR=${CMAKE_INSTALL_PREFIX}/${targetdir} -P ${SCRIPT_DIR}/InstallFile.cmake) set(install_command ${CMAKE_COMMAND} -D FILES=${filename} -D DIR=${CMAKE_INSTALL_PREFIX}/${targetdir} -P ${SCRIPT_DIR}/InstallFile.cmake)
# create a custom target for the installation # create a custom target for the installation
message("cdi ${filename}, ${ARGC}, ${ARGV2} ")
if("${ARGC}" EQUAL "3") if("${ARGC}" EQUAL "3")
set(_depends ${ARGV2}) set(_depends ${ARGV2})
message("_depends=${_depends}")
else("${ARGC}" EQUAL "3") else("${ARGC}" EQUAL "3")
set(_depends ${filename}) set(_depends ${filename})
endif("${ARGC}" EQUAL "3") endif("${ARGC}" EQUAL "3")
......
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
# #
# #
# dune_add_library(<basename> [NO_EXPORT] [ADD_LIBS <lib1> [<lib2> ...]] # dune_add_library(<basename> [NO_EXPORT] [ADD_LIBS <lib1> [<lib2> ...]]
# SOURCES <source1> [<source2> ...] [COMPILE_FLGS <flags>]) # [OBJECT] SOURCES <source1> [<source2> ...] [COMPILE_FLAGS <flags>])
# #
# Creates shared and static libraries with the same basename. # Creates shared and static libraries with the same basename.
# <basename> is the basename of the library. # <basename> is the basename of the library.
...@@ -56,6 +56,11 @@ ...@@ -56,6 +56,11 @@
# If the option NO_EXPORT is omitted the library is exported # If the option NO_EXPORT is omitted the library is exported
# for usage in other modules. # for usage in other modules.
# #
# Object libraries can now be created with dune_add_library(<target>
# OBJECT <sources>). It will create a GLOBAL property
# _DUNE_TARGET_OBJECTS:<target>_ that records the full path to the
# source files. Theses can later be referenced by providing
# _DUNE_TARGET_OBJECTS:<target>_ as one of the sources to dune_add_library
# #
# finalize_dune_project() # finalize_dune_project()
# #
...@@ -163,7 +168,7 @@ macro(dune_module_information MODULE_DIR) ...@@ -163,7 +168,7 @@ macro(dune_module_information MODULE_DIR)
set(${_mod}_REQUIRED REQUIRED) set(${_mod}_REQUIRED REQUIRED)
endforeach(_mod ${DUNE_DEPENDS}) endforeach(_mod ${DUNE_DEPENDS})
convert_deps_to_list(DUNE_DEPENDS) convert_deps_to_list(DUNE_DEPENDS)
message("Dependencies: ${DEPENDS_MODULE} (versions: ${DEPENDS_VERSIONS}) DUNE_DEPENDS=${DUNE_DEPENDS}") message(STATUS "Dependencies: ${DEPENDS_MODULE} (versions: ${DEPENDS_VERSIONS}) DUNE_DEPENDS=${DUNE_DEPENDS}")
endif(DUNE_DEPENDS) endif(DUNE_DEPENDS)
# 4. Check for line starting with Suggests # 4. Check for line starting with Suggests
...@@ -171,7 +176,7 @@ macro(dune_module_information MODULE_DIR) ...@@ -171,7 +176,7 @@ macro(dune_module_information MODULE_DIR)
if(DUNE_SUGGESTS) if(DUNE_SUGGESTS)
split_module_version(${DUNE_SUGGESTS} SUGGESTS_MODULE SUGGESTS_VERSION) split_module_version(${DUNE_SUGGESTS} SUGGESTS_MODULE SUGGESTS_VERSION)
convert_deps_to_list(DUNE_SUGGESTS) convert_deps_to_list(DUNE_SUGGESTS)
message("Suggestions: ${SUGGESTS_MODULE} (versions: ${SUGGESTS_VERSIONS}) DUNE_SUGGESTS=${DUNE_SUGGESTS}") message(STATUS "Suggestions: ${SUGGESTS_MODULE} (versions: ${SUGGESTS_VERSIONS}) DUNE_SUGGESTS=${DUNE_SUGGESTS}")
endif(DUNE_SUGGESTS) endif(DUNE_SUGGESTS)
dune_module_to_uppercase(DUNE_MOD_NAME_UPPERCASE ${DUNE_MOD_NAME}) dune_module_to_uppercase(DUNE_MOD_NAME_UPPERCASE ${DUNE_MOD_NAME})
...@@ -185,7 +190,6 @@ endmacro(dune_module_information) ...@@ -185,7 +190,6 @@ endmacro(dune_module_information)
macro(dune_process_dependency_leafs modules versions is_required next_level_deps macro(dune_process_dependency_leafs modules versions is_required next_level_deps
next_level_sugs) next_level_sugs)
message("dune_process_dependency_leafs modules=${modules}| versions=${versions} is_required=${is_required}| ${next_level_deps} ${next_level_sugs}")
# modules is not a real variable, make it one # modules is not a real variable, make it one
set(mmodules ${modules}) set(mmodules ${modules})
list(LENGTH mmodules mlength) list(LENGTH mmodules mlength)
...@@ -207,16 +211,12 @@ macro(dune_process_dependency_leafs modules versions is_required next_level_deps ...@@ -207,16 +211,12 @@ macro(dune_process_dependency_leafs modules versions is_required next_level_deps
endmacro(dune_process_dependency_leafs) endmacro(dune_process_dependency_leafs)
function(remove_processed_modules modules versions is_required) function(remove_processed_modules modules versions is_required)
message("remove_processed_modules \"${${modules}}\" \"${${versions}}\"")
list(LENGTH ${modules} mlength) list(LENGTH ${modules} mlength)
if(mlength GREATER 0) if(mlength GREATER 0)
math(EXPR length "${mlength}-1") math(EXPR length "${mlength}-1")
foreach(i RANGE ${length} 0 -1) foreach(i RANGE ${length} 0 -1)
list(GET ${modules} ${i} _mod) list(GET ${modules} ${i} _mod)
message("${_mod}_SEARCHED=${${_mod}_SEARCHED}")
if(${_mod}_SEARCHED) if(${_mod}_SEARCHED)
message("will remove ${i}")
message("removing ${i}")
list(REMOVE_AT ${modules} ${i}) list(REMOVE_AT ${modules} ${i})
list(REMOVE_AT ${versions} ${i}) list(REMOVE_AT ${versions} ${i})
if(is_required AND NOT ${_mod}_REQUIRED AND NOT ${_mod}_FOUND) if(is_required AND NOT ${_mod}_REQUIRED AND NOT ${_mod}_FOUND)
...@@ -225,17 +225,12 @@ function(remove_processed_modules modules versions is_required) ...@@ -225,17 +225,12 @@ function(remove_processed_modules modules versions is_required)
endif(${_mod}_SEARCHED) endif(${_mod}_SEARCHED)
endforeach(i RANGE 0 ${length}) endforeach(i RANGE 0 ${length})
endif(mlength GREATER 0) endif(mlength GREATER 0)
message("end remove_processed_modules \"${${modules}}\" \"${${versions}}\"")
set(${modules} ${${modules}} PARENT_SCOPE) set(${modules} ${${modules}} PARENT_SCOPE)
set(${versions} ${${versions}} PARENT_SCOPE) set(${versions} ${${versions}} PARENT_SCOPE)
endfunction(remove_processed_modules modules versions is_required) endfunction(remove_processed_modules modules versions is_required)
macro(dune_create_dependency_leafs depends depends_versions suggests suggests_versions macro(dune_create_dependency_leafs depends depends_versions suggests suggests_versions
global_depends global_suggests) global_depends global_suggests)
message("dune_create_dependency_leafs depends=${depends} versions=${depends_versions}")
message("suggests=${suggests} versions=${suggests_versions}")
message("${global_depends}=${${global_depends}}")
message("${global_suggests}=${${global_suggests}}")
set(deps "") set(deps "")
set(sugs "") set(sugs "")
#Process dependencies #Process dependencies
...@@ -252,12 +247,8 @@ macro(dune_create_dependency_leafs depends depends_versions suggests suggests_ve ...@@ -252,12 +247,8 @@ macro(dune_create_dependency_leafs depends depends_versions suggests suggests_ve
split_module_version("${sugs}" next_mod_suggests next_suggests_versions) split_module_version("${sugs}" next_mod_suggests next_suggests_versions)
#remove_processed_modules(next_mod_suggests next_suggests_versions "") #remove_processed_modules(next_mod_suggests next_suggests_versions "")
set(${global_suggests} "${${global_suggests}}" ${next_mod_suggests}) set(${global_suggests} "${${global_suggests}}" ${next_mod_suggests})
message("${global_depends}=${${global_depends}}")
message("${global_suggests}=${${global_suggests}}")
# Move to next level # Move to next level
if(next_mod_suggests OR next_mod_depends) if(next_mod_suggests OR next_mod_depends)
message("deps=${deps} sugs=${sugs}")
message("Going to next level deps=${next_mod_depends} sugs=${next_mod_suggests}")
dune_create_dependency_leafs("${next_mod_depends}" "${next_depends_versions}" dune_create_dependency_leafs("${next_mod_depends}" "${next_depends_versions}"
"${next_mod_suggests}" "${next_suggests_versions}" global_depends global_suggests) "${next_mod_suggests}" "${next_suggests_versions}" global_depends global_suggests)
endif(next_mod_suggests OR next_mod_depends) endif(next_mod_suggests OR next_mod_depends)
...@@ -276,22 +267,14 @@ macro(dune_create_dependency_tree) ...@@ -276,22 +267,14 @@ macro(dune_create_dependency_tree)
find_package(${_mod}) find_package(${_mod})
set(${_mod}_REQUIRED ON) set(${_mod}_REQUIRED ON)
endforeach(_mod ${SUGGESTS_MODULE}) endforeach(_mod ${SUGGESTS_MODULE})
message("global_depends=${global_depends}")
message("global_suggests=${global_suggests}")
message("DEPENDS_MODULE=${DEPENDS_MODULE} DEPENDS_VERSION=${DEPENDS_VERSIONS}
SUGGESTS_MODULE=${SUGGESTS_MODULE} SUGGESTS_VERSION=${SUGGESTS_VERSIONS}")
dune_create_dependency_leafs("${DEPENDS_MODULE}" "${DEPENDS_VERSIONS}" dune_create_dependency_leafs("${DEPENDS_MODULE}" "${DEPENDS_VERSIONS}"
"${SUGGESTS_MODULE}" "${SUGGESTS_VERSIONS}" global_depends "${SUGGESTS_MODULE}" "${SUGGESTS_VERSIONS}" global_depends
global_suggests) global_suggests)
message("global_depends=${global_depends}")
message("global_suggests=${global_suggests}")
set(ALL_DEPENDENCIES "${global_depends}" "${global_suggests}") set(ALL_DEPENDENCIES "${global_depends}" "${global_suggests}")
message("ALL_DEPENDENCIES=${ALL_DEPENDENCIES}")
endif(DEPENDS_MODULE OR SUGGESTS_MODULE) endif(DEPENDS_MODULE OR SUGGESTS_MODULE)
# reverse ALL_DEPENDENCIES # reverse ALL_DEPENDENCIES
list(REVERSE ALL_DEPENDENCIES) list(REVERSE ALL_DEPENDENCIES)
list(REMOVE_DUPLICATES ALL_DEPENDENCIES) list(REMOVE_DUPLICATES ALL_DEPENDENCIES)
message("ALL_DEPENDENCIES=${ALL_DEPENDENCIES}")
endmacro(dune_create_dependency_tree _immediates) endmacro(dune_create_dependency_tree _immediates)
# Converts a module name given by _dune_module into a string _macro_name # Converts a module name given by _dune_module into a string _macro_name
...@@ -321,10 +304,8 @@ endmacro(dune_module_to_macro _macro_name _dune_module) ...@@ -321,10 +304,8 @@ endmacro(dune_module_to_macro _macro_name _dune_module)
macro(dune_process_dependency_tree DEPENDS DVERSIONS SUGGESTS SVERSIONS) macro(dune_process_dependency_tree DEPENDS DVERSIONS SUGGESTS SVERSIONS)
foreach(_mod ${ALL_DEPENDENCIES}) foreach(_mod ${ALL_DEPENDENCIES})
message(STATUS "mod=${_mod} ${_mod}_PROCESSED=${${_mod}_PROCESSED}|")
if(NOT ${_mod}_PROCESSED) if(NOT ${_mod}_PROCESSED)
# module not processed yet # module not processed yet
message(STATUS "Processing dependency ${_mod}")
set(${_mod}_PROCESSED ${_mod}) set(${_mod}_PROCESSED ${_mod})
# Search for a cmake files containing tests and directives # Search for a cmake files containing tests and directives
# specific to this module # specific to this module
...@@ -541,9 +522,8 @@ macro(finalize_dune_project) ...@@ -541,9 +522,8 @@ macro(finalize_dune_project)
#"find_package(${_mod})\n")#include(${_macro}Macros)\n") #"find_package(${_mod})\n")#include(${_macro}Macros)\n")
endforeach(i RANGE 0 ${mlength}) endforeach(i RANGE 0 ${mlength})
endif(mlength GREATER 0) endif(mlength GREATER 0)
message(STATUS "${DUNE_MOD_NAME_CMAKE}_FOUND=${${DUNE_MOD_NAME_CMAKE}_FOUND}|")
if(${DUNE_MOD_NAME_CMAKE}_FOUND) if(${DUNE_MOD_NAME_CMAKE}_FOUND)
message(STATUS "appending")
# This module hast its own tests. # This module hast its own tests.
# Execute them during find_package # Execute them during find_package
#file(APPEND ${PROJECT_BINARY_DIR}/${DUNE_MOD_NAME}-config.cmake #file(APPEND ${PROJECT_BINARY_DIR}/${DUNE_MOD_NAME}-config.cmake
...@@ -613,81 +593,133 @@ macro(dune_common_script_source_dir _script_dir) ...@@ -613,81 +593,133 @@ macro(dune_common_script_source_dir _script_dir)
endif("${CMAKE_PROJECT_NAME}" STREQUAL "dune-common") endif("${CMAKE_PROJECT_NAME}" STREQUAL "dune-common")
endmacro(dune_common_script_source_dir) endmacro(dune_common_script_source_dir)
function(dune_expand_object_libraries _SOURCES_var _ADD_LIBS_var _COMPILE_FLAGS_var)
set(_new_SOURCES "")
set(_new_ADD_LIBS "")
set(_new_COMPILE_FLAGS "")
set(_regex "_DUNE_TARGET_OBJECTS:([a-zA-Z0-9_-]+)_")
foreach(_source ${${_SOURCES_var}})
string(REGEX MATCH ${_regex} _matched "${_source}")
if(_matched)
string(REGEX REPLACE "${_regex}" "\\1" _basename "${_source}")
foreach(var _SOURCES _ADD_LIBS _COMPILE_FLAGS)
get_property(_prop GLOBAL PROPERTY DUNE_LIB_${_basename}${var})
list(APPEND _new${var} "${_prop}")
endforeach(var _SOURCES _ADD_LIBS _COMPILE_FLAGS)
else(_matched)
list(APPEND _new_SOURCES "${_source}")
endif(_matched)
endforeach(_source ${${_SOURCES_var}})
foreach(var _SOURCES _ADD_LIBS _COMPILE_FLAGS)
set(${${var}_var} "${_new${var}}" PARENT_SCOPE)
endforeach(var _SOURCES _ADD_LIBS _COMPILE_FLAGS)
endfunction(dune_expand_object_libraries)
# Creates shared and static libraries with the same basename. # Creates shared and static libraries with the same basename.
# More docu can be found at the top of this file. # More docu can be found at the top of this file.
macro(dune_add_library basename) macro(dune_add_library basename)
include(CMakeParseArguments) include(CMakeParseArguments)
cmake_parse_arguments(DUNE_LIB "NO_EXPORT" "COMPILE_FLAGS" cmake_parse_arguments(DUNE_LIB "NO_EXPORT;OBJECT" "COMPILE_FLAGS"
"ADD_LIBS;SOURCES" ${ARGN}) "ADD_LIBS;SOURCES" ${ARGN})
#create lib if(DUNE_LIB_OBJECT)
add_library(${basename} ${DUNE_SOURCES} ${DUNE_LIB_UNPARSED_ARGUMENTS}) if(DUNE_LIB_${basename}_SOURCES)
# link with specified libraries. message(FATAL_ERROR "There is already a library with the name ${basename}, "
if(DUNE_LIB_ADD_LIBS) "but only one is allowed!")
dune_target_link_libraries(${basename} ${DUNE_LIB_ADD_LIBS}) else(DUNE_LIB_${basename}_SOURCES)
endif(DUNE_LIB_ADD_LIBS) foreach(source ${DUNE_LIB_UNPARSED_ARGUMENTS})
if(DUNE_LIB_COMPILE_FLAGS) list(APPEND full_path_sources ${CMAKE_CURRENT_SOURCE_DIR}/${source})
setproperty(${basename} APPEND_STRING COMPILE_FLAGS endforeach(source ${DUNE_LIB_UNPARSED_ARGUMENTS})
"${DUNE_LIB_COMPILE_FLAGS}") # register sources, libs and flags for building the library later
endif(DUNE_LIB_COMPILE_FLAGS) define_property(GLOBAL PROPERTY DUNE_LIB_${basename}_SOURCES
# Build library in ${PROJECT_BINARY_DIR}/lib BRIEF_DOCS "Convenience property with sources for library ${basename}. DO NOT EDIT!"
set_target_properties(${basename} PROPERTIES FULL_DOCS "Convenience property with sources for library ${basename}. DO NOT EDIT!")
LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/lib" set_property(GLOBAL PROPERTY DUNE_LIB_${basename}_SOURCES
ARCHIVE_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/lib") "${full_path_sources}")
define_property(GLOBAL PROPERTY DUNE_LIB_${basename}_ADD_LIBS
set(_created_libs ${basename}) BRIEF_DOCS "Convenience property with libraries for library ${basename}. DO NOT EDIT!"
FULL_DOCS "Convenience property with libraries for library ${basename}. DO NOT EDIT!")
if(DUNE_BUILD_BOTH_LIBS) set_property(GLOBAL PROPERTY DUNE_LIB_${basename}_ADD_LIBS
if(BUILD_SHARED_LIBS) "${DUNE_LIB_ADD_LIBS}")
#create static lib define_property(GLOBAL PROPERTY DUNE_LIB_${basename}_COMPILE_FLAGS
add_library(${basename}-static STATIC ${ARGN}) BRIEF_DOCS "Convenience property with compile flags for library ${basename}. DO NOT EDIT!"
# make sure both libs have the same name. FULL_DOCS "Convenience property with compile flags for library ${basename}. DO NOT EDIT!")
set_target_properties(${basename}-static PROPERTIES set_property(GLOBAL PROPERTY DUNE_LIB_${basename}_COMPILE_FLAGS
OUTPUT_NAME ${basename} "${DUNE_LIB_COMPILE_FLAGS}")
ARCHIVE_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/lib") endif(DUNE_LIB_${basename}_SOURCES)
list(APPEND _created_libs ${basename}-static) else(DUNE_LIB_OBJECT)
# link with specified libraries. list(APPEND DUNE_LIB_SOURCES ${DUNE_LIB_UNPARSED_ARGUMENTS})
if(DUNE_LIB_ADD_LIBS) dune_expand_object_libraries(DUNE_LIB_SOURCES DUNE_LIB_ADD_LIBS DUNE_LIB_COMPILE_FLAGS)
dune_target_link_libraries(${basename}-static ${DUNE_LIB_ADD_LIBS}) #create lib
endif(DUNE_LIB_ADD_LIBS) add_library(${basename} ${DUNE_LIB_SOURCES})
if(DUNE_LIB_COMPILE_FLAGS) # link with specified libraries.
setproperty(${basename}-static APPEND_STRING COMPILE_FLAGS if(DUNE_LIB_ADD_LIBS)
"${DUNE_LIB_COMPILE_FLAGS}") dune_target_link_libraries(${basename} ${DUNE_LIB_ADD_LIBS})
endif(DUNE_LIB_COMPILE_FLAGS) endif(DUNE_LIB_ADD_LIBS)
else(BUILD_SHARED_LIBS) if(DUNE_LIB_COMPILE_FLAGS)
#create shared libs setproperty(${basename} APPEND_STRING COMPILE_FLAGS
add_library(${basename}-shared SHARED ${ARGN}) "${DUNE_LIB_COMPILE_FLAGS}")
set_target_properties(${basename}-shared PROPERTIES endif(DUNE_LIB_COMPILE_FLAGS)
OUTPUT_NAME ${basename} # Build library in ${PROJECT_BINARY_DIR}/lib
LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/lib") set_target_properties(${basename} PROPERTIES
# link with specified libraries. LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/lib"
if(DUNE_LIB_ADD_LIBS) ARCHIVE_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/lib")
dune_target_link_libraries(${basename}-shared ${DUNE_LIB_ADD_LIBS})
endif(DUNE_LIB_ADD_LIBS) set(_created_libs ${basename})
if(DUNE_LIB_COMPILE_FLAGS)
setproperty(${basename}-shared APPEND_STRING COMPILE_FLAGS if(DUNE_BUILD_BOTH_LIBS)
"${DUNE_LIB_COMPILE_FLAGS}") if(BUILD_SHARED_LIBS)
endif(DUNE_LIB_COMPILE_FLAGS) #create static lib
list(APPEND _created_libs ${basename}-shared) add_library(${basename}-static STATIC ${DUNE_LIB_SOURCES})
endif(BUILD_SHARED_LIBS) # make sure both libs have the same name.
endif(DUNE_BUILD_BOTH_LIBS) set_target_properties(${basename}-static PROPERTIES
OUTPUT_NAME ${basename}
if(NOT DUNE_LIB_NO_EXPORT) ARCHIVE_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/lib")
if(NOT _MODULE_EXPORT_USED) list(APPEND _created_libs ${basename}-static)
set(_MODULE_EXPORT_USED ON) # link with specified libraries.
set(_append "") if(DUNE_LIB_ADD_LIBS)
else(NOT _MODULE_EXPORT_USED) dune_target_link_libraries(${basename}-static ${DUNE_LIB_ADD_LIBS})
set(_append APPEND) endif(DUNE_LIB_ADD_LIBS)
endif(NOT _MODULE_EXPORT_USED) if(DUNE_LIB_COMPILE_FLAGS)
# install targets to use the libraries in other modules. setproperty(${basename}-static APPEND_STRING COMPILE_FLAGS
install(TARGETS ${_created_libs} "${DUNE_LIB_COMPILE_FLAGS}")
EXPORT ${DUNE_MOD_NAME}-targets DESTINATION lib) endif(DUNE_LIB_COMPILE_FLAGS)
install(EXPORT ${DUNE_MOD_NAME}-targets else(BUILD_SHARED_LIBS)
DESTINATION lib/cmake) #create shared libs
add_library(${basename}-shared SHARED ${DUNE_LIB_SOURCES})
# export libraries for use in build tree set_target_properties(${basename}-shared PROPERTIES
export(TARGETS ${_created_libs} ${_append} OUTPUT_NAME ${basename}
FILE ${PROJECT_BINARY_DIR}/${DUNE_MOD_NAME}-targets.cmake) LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/lib")
endif(NOT DUNE_LIB_NO_EXPORT) # link with specified libraries.
if(DUNE_LIB_ADD_LIBS)
dune_target_link_libraries(${basename}-shared ${DUNE_LIB_ADD_LIBS})
endif(DUNE_LIB_ADD_LIBS)
if(DUNE_LIB_COMPILE_FLAGS)
setproperty(${basename}-shared APPEND_STRING COMPILE_FLAGS
"${DUNE_LIB_COMPILE_FLAGS}")
endif(DUNE_LIB_COMPILE_FLAGS)
list(APPEND _created_libs ${basename}-shared)
endif(BUILD_SHARED_LIBS)
endif(DUNE_BUILD_BOTH_LIBS)
if(NOT DUNE_LIB_NO_EXPORT)
if(NOT _MODULE_EXPORT_USED)
set(_MODULE_EXPORT_USED ON)
set(_append "")
else(NOT _MODULE_EXPORT_USED)
set(_append APPEND)
endif(NOT _MODULE_EXPORT_USED)
# install targets to use the libraries in other modules.
install(TARGETS ${_created_libs}
EXPORT ${DUNE_MOD_NAME}-targets DESTINATION lib)
install(EXPORT ${DUNE_MOD_NAME}-targets
DESTINATION lib/cmake)
# export libraries for use in build tree
export(TARGETS ${_created_libs} ${_append}
FILE ${PROJECT_BINARY_DIR}/${DUNE_MOD_NAME}-targets.cmake)
endif(NOT DUNE_LIB_NO_EXPORT)
endif(DUNE_LIB_OBJECT)
endmacro(dune_add_library basename sources) endmacro(dune_add_library basename sources)
macro(replace_properties_for_one) macro(replace_properties_for_one)
...@@ -701,7 +733,6 @@ macro(replace_properties_for_one) ...@@ -701,7 +733,6 @@ macro(replace_properties_for_one)
list(APPEND replacement ${repl}) list(APPEND replacement ${repl})
endforeach(i RANGE 0 ${hlength}) endforeach(i RANGE 0 ${hlength})
list(REMOVE_DUPLICATES replacement) list(REMOVE_DUPLICATES replacement)
message(STATUS "properties not yet set. Setting ${replacement} ...")
set_property(${option_command} ${_target} ${REPLACE_APPEND} set_property(${option_command} ${_target} ${REPLACE_APPEND}
${REPLACE_APPEND_STRING} PROPERTY ${REPLACE_PROPERTY} ${replacement}) ${REPLACE_APPEND_STRING} PROPERTY ${REPLACE_PROPERTY} ${replacement})
else(NOT properties) else(NOT properties)
...@@ -729,7 +760,6 @@ macro(replace_properties_for_one) ...@@ -729,7 +760,6 @@ macro(replace_properties_for_one)
PROPERTY ${REPLACE_PROPERTY} ${new_props}) PROPERTY ${REPLACE_PROPERTY} ${new_props})
endif(NOT properties) endif(NOT properties)
get_property(properties ${option_command} ${_target} PROPERTY ${REPLACE_PROPERTY}) get_property(properties ${option_command} ${_target} PROPERTY ${REPLACE_PROPERTY})
message(STATUS "new properties are ${properties}")
endmacro(replace_properties_for_one) endmacro(replace_properties_for_one)
function(dune_target_link_libraries basename libraries) function(dune_target_link_libraries basename libraries)
......
...@@ -814,7 +814,6 @@ MACRO(PARSE_ADD_LATEX_ARGUMENTS command) ...@@ -814,7 +814,6 @@ MACRO(PARSE_ADD_LATEX_ARGUMENTS command)
${ARGN} ${ARGN}
) )
message("FATHER_TARGET ${LATEX_FATHER_TARGET}")
# The first argument is the target latex file. # The first argument is the target latex file.
IF (LATEX_DEFAULT_ARGS) IF (LATEX_DEFAULT_ARGS)
LATEX_CAR(LATEX_MAIN_INPUT ${LATEX_DEFAULT_ARGS}) LATEX_CAR(LATEX_MAIN_INPUT ${LATEX_DEFAULT_ARGS})
......
#For now we just support appending Doxyfile and Doxylocal #For now we just support appending Doxyfile and Doxylocal
message("Generating Doxyfile.in") message(STATUS "Generating Doxyfile.in")
FILE(READ ${DOXYSTYLE} file_contents) FILE(READ ${DOXYSTYLE} file_contents)
FILE(WRITE Doxyfile.in ${file_contents}) FILE(WRITE Doxyfile.in ${file_contents})
FILE(READ ${DOXYLOCAL} file_contents) FILE(READ ${DOXYLOCAL} file_contents)
FILE(APPEND Doxyfile.in ${file_contents}) FILE(APPEND Doxyfile.in ${file_contents})
message("Generating Doxyfile")
# configure_file does not work as it insists an existing input file, which in our # configure_file does not work as it insists an existing input file, which in our
# needs to be generated first. # needs to be generated first.
# Therfore we read the Doxyfile.in and replace the variables using STRING(CONFIGURE) # Therfore we read the Doxyfile.in and replace the variables using STRING(CONFIGURE)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment