diff options
author | Andrej Rode <mail@andrejro.de> | 2019-03-02 19:59:00 +0100 |
---|---|---|
committer | Marcus Müller <marcus.mueller@ettus.com> | 2019-03-04 22:30:37 +0100 |
commit | ab2fb35677e38a384df3f9503d1f45f64bbc0374 (patch) | |
tree | c59965a71d4951e9bcae9efcf9a6005df2f340a1 /cmake/Modules/CMakeMacroLibtoolFile.cmake | |
parent | 4e777f1c0ee28011255e3b6b703463cef0f207e0 (diff) |
cmake: Update to modern CMake usage
This includes using target based setting of includes
and link libraries. This will transitively add the includes
and linking flags to dependent targets.
This is still a work in progress since only the dynamic
libraries have been touched and not all of include_directories
directives are gone yet.
cmake: remove GR_INCLUDE_SUBDIRECTORY macro
Previously this macro was used to inject subdirectories in the
current CMake namespace. This is generally undesired and pollutes the
current context.
previously GNU Radio CMake had a non-default option ENABLE_STATIC_LIBS
to build both, shared libraries and static libraries.
This seems to be a construction taken over from autotools and serves
no purpuose in CMake and complicates the library building.
cmake: remove GR_LIBTOOL and la generation support
This looks like it was primarily used to support projects using
autotools, but comments state that the generated .la files aren't
compatible with autotools anyway.
cmake: Bump required CMake version to 3.8
UseSWIG cmake uses syntax which requires at least CMake 3.8 and is non-trivial
to change
Diffstat (limited to 'cmake/Modules/CMakeMacroLibtoolFile.cmake')
-rw-r--r-- | cmake/Modules/CMakeMacroLibtoolFile.cmake | 61 |
1 files changed, 0 insertions, 61 deletions
diff --git a/cmake/Modules/CMakeMacroLibtoolFile.cmake b/cmake/Modules/CMakeMacroLibtoolFile.cmake deleted file mode 100644 index 5e0841716b..0000000000 --- a/cmake/Modules/CMakeMacroLibtoolFile.cmake +++ /dev/null @@ -1,61 +0,0 @@ -#http://www.vtk.org/Wiki/CMakeMacroLibtoolFile -#This macro creates a libtool .la file for shared libraries or plugins. The first parameter is the target name of the library, the second parameter is the directory where it will be installed to. E.g. for a KDE 3.x module named "kfoo" the usage would be as follows: - -#The macro GET_TARGET_PROPERTY_WITH_DEFAULT is helpful to handle properties with default values. - -#ADD_LIBRARY(foo SHARED kfoo1.cpp kfoo2.cpp) -#CREATE_LIBTOOL_FILE(foo /lib/kde3) - -if(DEFINED __INCLUDED_CREATE_LIBTOOL_FILE) - return() -endif() -set(__INCLUDED_CREATE_LIBTOOL_FILE TRUE) - - MACRO(GET_TARGET_PROPERTY_WITH_DEFAULT _variable _target _property _default_value) - GET_TARGET_PROPERTY (${_variable} ${_target} ${_property}) - IF (${_variable} MATCHES NOTFOUND) - SET (${_variable} ${_default_value}) - ENDIF (${_variable} MATCHES NOTFOUND) - ENDMACRO (GET_TARGET_PROPERTY_WITH_DEFAULT) - - MACRO(CREATE_LIBTOOL_FILE _target _install_DIR) - GET_TARGET_PROPERTY_WITH_DEFAULT(_target_static_lib ${_target} STATIC_LIB "") - GET_TARGET_PROPERTY_WITH_DEFAULT(_target_dependency_libs ${_target} LT_DEPENDENCY_LIBS "") - GET_TARGET_PROPERTY_WITH_DEFAULT(_target_current ${_target} LT_VERSION_CURRENT 0) - GET_TARGET_PROPERTY_WITH_DEFAULT(_target_age ${_target} LT_VERSION_AGE 0) - GET_TARGET_PROPERTY_WITH_DEFAULT(_target_revision ${_target} LT_VERSION_REVISION 0) - GET_TARGET_PROPERTY_WITH_DEFAULT(_target_installed ${_target} LT_INSTALLED yes) - GET_TARGET_PROPERTY_WITH_DEFAULT(_target_shouldnotlink ${_target} LT_SHOULDNOTLINK yes) - GET_TARGET_PROPERTY_WITH_DEFAULT(_target_dlopen ${_target} LT_DLOPEN "") - GET_TARGET_PROPERTY_WITH_DEFAULT(_target_dlpreopen ${_target} LT_DLPREOPEN "") - GET_FILENAME_COMPONENT(_laname $<TARGET_FILE:$_target> NAME_WE) - GET_FILENAME_COMPONENT(_soname $<TARGET_FILE:$_target> NAME) - SET(_laname ${CMAKE_CURRENT_BINARY_DIR}/${_laname}.la) - FILE(WRITE ${_laname} "# ${_laname} - a libtool library file\n") - FILE(WRITE ${_laname} "# Generated by CMake ${CMAKE_VERSION} (like GNU libtool)\n") - FILE(WRITE ${_laname} "\n# Please DO NOT delete this file!\n# It is necessary for linking the library with libtool.\n\n" ) - FILE(APPEND ${_laname} "# The name that we can dlopen(3).\n") - FILE(APPEND ${_laname} "dlname='${_soname}'\n\n") - FILE(APPEND ${_laname} "# Names of this library.\n") - FILE(APPEND ${_laname} "library_names='${_soname}.${_target_current}.${_target_age}.${_target_revision} ${_soname}.${_target_current} ${_soname}'\n\n") - FILE(APPEND ${_laname} "# The name of the static archive.\n") - FILE(APPEND ${_laname} "old_library='${_target_static_lib}'\n\n") - FILE(APPEND ${_laname} "# Libraries that this one depends upon.\n") - FILE(APPEND ${_laname} "dependency_libs='${_target_dependency_libs}'\n\n") - FILE(APPEND ${_laname} "# Names of additional weak libraries provided by this library\n") - FILE(APPEND ${_laname} "weak_library_names=\n\n") - FILE(APPEND ${_laname} "# Version information for ${_laname}.\n") - FILE(APPEND ${_laname} "current=${_target_current}\n") - FILE(APPEND ${_laname} "age=${_target_age}\n") - FILE(APPEND ${_laname} "revision=${_target_revision}\n\n") - FILE(APPEND ${_laname} "# Is this an already installed library?\n") - FILE(APPEND ${_laname} "installed=${_target_installed}\n\n") - FILE(APPEND ${_laname} "# Should we warn about portability when linking against -modules?\n") - FILE(APPEND ${_laname} "shouldnotlink=${_target_shouldnotlink}\n\n") - FILE(APPEND ${_laname} "# Files to dlopen/dlpreopen\n") - FILE(APPEND ${_laname} "dlopen='${_target_dlopen}'\n") - FILE(APPEND ${_laname} "dlpreopen='${_target_dlpreopen}'\n\n") - FILE(APPEND ${_laname} "# Directory that this library needs to be installed in:\n") - FILE(APPEND ${_laname} "libdir='${CMAKE_INSTALL_PREFIX}${_install_DIR}'\n") - INSTALL( FILES ${_laname} DESTINATION ${CMAKE_INSTALL_PREFIX}${_install_DIR}) - ENDMACRO(CREATE_LIBTOOL_FILE) |