diff options
author | Josh Blum | 2011-10-31 23:18:11 -0700 |
---|---|---|
committer | Josh Blum | 2011-11-03 18:16:44 -0700 |
commit | 56fcd5f9b22af33976f9413d3a9d0aec41a7b556 (patch) | |
tree | 9f379c5602e3e12dad41f804f14098436aab274c /cmake | |
parent | ea013f3566f8277ed3742e8e17a8c9b9f60939da (diff) | |
download | gnuradio-56fcd5f9b22af33976f9413d3a9d0aec41a7b556.tar.gz gnuradio-56fcd5f9b22af33976f9413d3a9d0aec41a7b556.tar.bz2 gnuradio-56fcd5f9b22af33976f9413d3a9d0aec41a7b556.zip |
cmake: created macro for libtool gen and disabled by default
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/Modules/GrMiscUtils.cmake | 30 | ||||
-rw-r--r-- | cmake/Modules/GrSwig.cmake | 9 |
2 files changed, 29 insertions, 10 deletions
diff --git a/cmake/Modules/GrMiscUtils.cmake b/cmake/Modules/GrMiscUtils.cmake index 22bfc8324..f96dbee74 100644 --- a/cmake/Modules/GrMiscUtils.cmake +++ b/cmake/Modules/GrMiscUtils.cmake @@ -99,6 +99,30 @@ macro(GR_ADD_CXX_COMPILER_FLAG_IF_AVAILABLE flag have) endmacro(GR_ADD_CXX_COMPILER_FLAG_IF_AVAILABLE) ######################################################################## +# Generates the .la libtool file +# This appears to generate libtool files that cannot be used by auto*. +# Usage GR_LIBTOOL(TARGET [target] DESTINATION [dest]) +# Notice: there is not COMPONENT option, these will not get distributed. +######################################################################## +function(GR_LIBTOOL) + if(NOT DEFINED GENERATE_LIBTOOL) + set(GENERATE_LIBTOOL OFF) #disabled by default + endif() + + if(GENERATE_LIBTOOL) + include(CMakeParseArgumentsCopy) + CMAKE_PARSE_ARGUMENTS(GR_LIBTOOL "" "TARGET;DESTINATION" "" ${ARGN}) + + find_program(LIBTOOL libtool) + if(LIBTOOL) + include(CMakeMacroLibtoolFile) + CREATE_LIBTOOL_FILE(${GR_LIBTOOL_TARGET} /${GR_LIBTOOL_DESTINATION}) + endif(LIBTOOL) + endif(GENERATE_LIBTOOL) + +endfunction(GR_LIBTOOL) + +######################################################################## # Do standard things to the library target # - set target properties # - make install rules @@ -128,11 +152,7 @@ function(GR_LIBRARY_FOO target) if(LIBRARY_EXTRAS) #create .la file before changing props - find_program(LIBTOOL libtool) - if(LIBTOOL) - include(CMakeMacroLibtoolFile) - CREATE_LIBTOOL_FILE(${target} /${GR_LIBRARY_DIR}) - endif(LIBTOOL) + GR_LIBTOOL(TARGET ${target} DESTINATION ${GR_LIBRARY_DIR}) #give the library a special name with ultra-zero soversion set_target_properties(${target} PROPERTIES LIBRARY_OUTPUT_NAME ${target}-${LIBVER} SOVERSION "0.0.0") diff --git a/cmake/Modules/GrSwig.cmake b/cmake/Modules/GrSwig.cmake index 6055c6356..d554f78d1 100644 --- a/cmake/Modules/GrSwig.cmake +++ b/cmake/Modules/GrSwig.cmake @@ -98,11 +98,10 @@ macro(GR_SWIG_INSTALL) COMPONENT ${GR_SWIG_INSTALL_COMPONENT} ) - find_program(LIBTOOL libtool) - if(LIBTOOL) - include(CMakeMacroLibtoolFile) - CREATE_LIBTOOL_FILE(${SWIG_MODULE_${name}_REAL_NAME} /${GR_SWIG_INSTALL_DESTINATION}) - endif(LIBTOOL) + GR_LIBTOOL( + TARGET ${SWIG_MODULE_${name}_REAL_NAME} + DESTINATION ${GR_SWIG_INSTALL_DESTINATION} + ) endforeach(name) |