From 112a6d92f4a82815f67c3558324373618657905e Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Tue, 25 Oct 2011 11:25:54 -0700 Subject: cmake: only make libtool file when libtool found --- cmake/Modules/CMakeMacroLibtoolFile.cmake | 5 +++++ cmake/Modules/GrMiscUtils.cmake | 7 +++++-- cmake/Modules/GrSwig.cmake | 7 +++++-- 3 files changed, 15 insertions(+), 4 deletions(-) (limited to 'cmake') diff --git a/cmake/Modules/CMakeMacroLibtoolFile.cmake b/cmake/Modules/CMakeMacroLibtoolFile.cmake index a9e7f4bcb..2ec791207 100644 --- a/cmake/Modules/CMakeMacroLibtoolFile.cmake +++ b/cmake/Modules/CMakeMacroLibtoolFile.cmake @@ -6,6 +6,11 @@ #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) diff --git a/cmake/Modules/GrMiscUtils.cmake b/cmake/Modules/GrMiscUtils.cmake index 9d947e9a5..22bfc8324 100644 --- a/cmake/Modules/GrMiscUtils.cmake +++ b/cmake/Modules/GrMiscUtils.cmake @@ -128,8 +128,11 @@ function(GR_LIBRARY_FOO target) if(LIBRARY_EXTRAS) #create .la file before changing props - include(CMakeMacroLibtoolFile) - CREATE_LIBTOOL_FILE(${target} /${GR_LIBRARY_DIR}) + find_program(LIBTOOL libtool) + if(LIBTOOL) + include(CMakeMacroLibtoolFile) + CREATE_LIBTOOL_FILE(${target} /${GR_LIBRARY_DIR}) + endif(LIBTOOL) #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 7f2018b53..6055c6356 100644 --- a/cmake/Modules/GrSwig.cmake +++ b/cmake/Modules/GrSwig.cmake @@ -83,7 +83,6 @@ endmacro(GR_SWIG_MAKE) ######################################################################## macro(GR_SWIG_INSTALL) - include(CMakeMacroLibtoolFile) include(CMakeParseArgumentsCopy) CMAKE_PARSE_ARGUMENTS(GR_SWIG_INSTALL "" "DESTINATION;COMPONENT" "TARGETS" ${ARGN}) @@ -99,7 +98,11 @@ macro(GR_SWIG_INSTALL) COMPONENT ${GR_SWIG_INSTALL_COMPONENT} ) - CREATE_LIBTOOL_FILE(${SWIG_MODULE_${name}_REAL_NAME} /${GR_SWIG_INSTALL_DESTINATION}) + find_program(LIBTOOL libtool) + if(LIBTOOL) + include(CMakeMacroLibtoolFile) + CREATE_LIBTOOL_FILE(${SWIG_MODULE_${name}_REAL_NAME} /${GR_SWIG_INSTALL_DESTINATION}) + endif(LIBTOOL) endforeach(name) -- cgit