Skip to content
Snippets Groups Projects
Commit 3cb196db authored by Christoph Grüninger's avatar Christoph Grüninger
Browse files

[CMake][release] White space changes.

Replace tabs by spaces.
parent 58d2e446
No related branches found
No related tags found
No related merge requests found
......@@ -89,9 +89,9 @@ endmacro(dune_module_to_uppercase _upper _module)
macro(find_dune_package module)
if(NOT ${module}_FOUND)
if(NOT (${module}_DIR OR ${module}_ROOT OR
"${CMAKE_PREFIX_PATH}" MATCHES ".*${module}.*"))
"${CMAKE_PREFIX_PATH}" MATCHES ".*${module}.*"))
string(REPLACE ${ProjectName} ${module} ${module}_DIR
${PROJECT_BINARY_DIR})
${PROJECT_BINARY_DIR})
endif()
find_package(${ARGV} NO_CMAKE_PACKAGE_REGISTRY)
endif(NOT ${module}_FOUND)
......@@ -101,41 +101,41 @@ macro(find_dune_package module)
unset(${module}_FOUND)
# use pkg-config
find_package(PkgConfig REQUIRED)
pkg_check_modules (${module} ${module})
pkg_check_modules (${module} ${module})
if(NOT ${module}_FOUND)
message(FATAL_ERROR "Could not find module ${module}.")
message(FATAL_ERROR "Could not find module ${module}.")
endif()
# compute the path to the libraries
if(${module}_LIBRARIES)
unset(_module_lib)
foreach(lib ${${module}_LIBRARIES})
foreach(libdir ${${module}_LIBRARY_DIRS})
if(EXISTS ${libdir}/lib${lib}.a)
set(_module_lib ${libdir}/lib${lib}.a)
set(_module_lib_static "STATIC")
endif()
if(EXISTS ${libdir}/lib${lib}.so)
set(_module_lib ${libdir}/lib${lib}.so)
set(_module_lib_static "")
endif()
if(_module_lib)
#import library
add_library(${lib} ${_module_lib_static} IMPORTED)
set_property(TARGET ${lib} APPEND PROPERTY IMPORTED_CONFIGURATIONS NOCONFIG)
set_target_properties(${lib} PROPERTIES
IMPORTED_LINK_INTERFACE_LANGUAGES_NOCONFIG "CXX"
IMPORTED_LOCATION_NOCONFIG "${_module_lib}")
break()
endif(_module_lib)
endforeach(libdir ${${module}_LIBRARY_DIRS})
foreach(libdir ${${module}_LIBRARY_DIRS})
if(EXISTS ${libdir}/lib${lib}.a)
set(_module_lib ${libdir}/lib${lib}.a)
set(_module_lib_static "STATIC")
endif()
if(EXISTS ${libdir}/lib${lib}.so)
set(_module_lib ${libdir}/lib${lib}.so)
set(_module_lib_static "")
endif()
if(_module_lib)
#import library
add_library(${lib} ${_module_lib_static} IMPORTED)
set_property(TARGET ${lib} APPEND PROPERTY IMPORTED_CONFIGURATIONS NOCONFIG)
set_target_properties(${lib} PROPERTIES
IMPORTED_LINK_INTERFACE_LANGUAGES_NOCONFIG "CXX"
IMPORTED_LOCATION_NOCONFIG "${_module_lib}")
break()
endif(_module_lib)
endforeach(libdir ${${module}_LIBRARY_DIRS})
endforeach(lib ${${module}_LIBRARIES})
endif(${module}_LIBRARIES)
if(NOT ${module}_MODULE_PATH)
if(${module}_INCLUDE_DIRS)
list(GET ${module}_INCLUDE_DIRS 0 _dir)
if(EXISTS ${_dir}/../share/dune/cmake/modules)
set(${module}_MODULE_PATH ${_dir}/../share/dune/cmake/modules)
endif(EXISTS ${_dir}/../share/dune/cmake/modules)
list(GET ${module}_INCLUDE_DIRS 0 _dir)
if(EXISTS ${_dir}/../share/dune/cmake/modules)
set(${module}_MODULE_PATH ${_dir}/../share/dune/cmake/modules)
endif(EXISTS ${_dir}/../share/dune/cmake/modules)
endif(${module}_INCLUDE_DIRS)
endif(NOT ${module}_MODULE_PATH)
unset(${module}_FAKE_CMAKE_PKGCONFIG)
......@@ -144,16 +144,16 @@ macro(find_dune_package module)
# parse other module's dune.module file to generate variables for config.h
unset(${module}_dune_module)
foreach(_dune_module_file ${${module}_PREFIX}/dune.module
${${module}_PREFIX}/lib/dunecontrol/${module}/dune.module)
${${module}_PREFIX}/lib/dunecontrol/${module}/dune.module)
if(EXISTS ${_dune_module_file})
get_filename_component(_dune_module_file_path ${_dune_module_file} PATH)
dune_module_information(${_dune_module_file_path})# QUIET)
set(${module}_dune_module 1)
get_filename_component(_dune_module_file_path ${_dune_module_file} PATH)
dune_module_information(${_dune_module_file_path})# QUIET)
set(${module}_dune_module 1)
endif(EXISTS ${_dune_module_file})
endforeach()
if(NOT ${module}_dune_module)
message(FATAL_ERROR "Could not find dune.module file for module ${module} "
"in ${${module}_PREFIX}, ${${module}_PREFIX}/lib/dunecontrol/${module}/")
"in ${${module}_PREFIX}, ${${module}_PREFIX}/lib/dunecontrol/${module}/")
endif(NOT ${module}_dune_module)
endif(${module}_FOUND)
endmacro(find_dune_package module)
......@@ -361,29 +361,29 @@ macro(dune_create_dependency_tree)
list(APPEND NEW_ALL_DEPS ${_mod})
math(EXPR length "${length}-1")
if(length GREATER 0)
foreach(i RANGE ${length} 0 -1)
list(GET ALL_DEPENDENCIES ${i} _mod)
if(NOT ${_mod}_cmake_path_processed)
set(${_mod}_cmake_path_processed 1)
if(${_mod}_MODULE_PATH)
list(INSERT _my_path 0 ${${_mod}_MODULE_PATH})
endif(${_mod}_MODULE_PATH)
list(APPEND NEW_ALL_DEPS ${_mod})
endif(NOT ${_mod}_cmake_path_processed)
endforeach(i RANGE ${length} 0 -1)
foreach(i RANGE ${length} 0 -1)
list(GET ALL_DEPENDENCIES ${i} _mod)
if(NOT ${_mod}_cmake_path_processed)
set(${_mod}_cmake_path_processed 1)
if(${_mod}_MODULE_PATH)
list(INSERT _my_path 0 ${${_mod}_MODULE_PATH})
endif(${_mod}_MODULE_PATH)
list(APPEND NEW_ALL_DEPS ${_mod})
endif(NOT ${_mod}_cmake_path_processed)
endforeach(i RANGE ${length} 0 -1)
endif(length GREATER 0)
list(LENGTH CMAKE_MODULE_PATH length)
math(EXPR length "${length}-1")
if(start EQUAL -1)
list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/modules ${_my_path})
list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/modules ${_my_path})
else(start EQUAL -1)
if(start EQUAL ${length})
list(APPEND CMAKE_MODULE_PATH ${_my_path})
else(start EQUAL ${length})
if(_my_path)
list(INSERT CMAKE_MODULE_PATH ${start} ${_my_path})
endif(_my_path)
endif(start EQUAL ${length})
if(start EQUAL ${length})
list(APPEND CMAKE_MODULE_PATH ${_my_path})
else(start EQUAL ${length})
if(_my_path)
list(INSERT CMAKE_MODULE_PATH ${start} ${_my_path})
endif(_my_path)
endif(start EQUAL ${length})
endif(start EQUAL -1)
endif(length GREATER 0)
set(ALL_DEPENDENCIES ${NEW_ALL_DEPS})
......
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