From 41f284b678d0247b03af4612b32fb64bd8f783d0 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Tue, 11 Aug 2015 08:43:40 +0000 Subject: [PATCH] Moved FIND_PACKAGE(Boost) to within the individual Find scripts that actually need it rather in the root CMakeLists.txt. git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@15093 16af8721-9629-0410-8352-f15c8da7e697 --- CMakeLists.txt | 1 - CMakeModules/FindAsio.cmake | 12 +++++++----- CMakeModules/FindLIBLAS.cmake | 8 ++++++-- src/osgPlugins/CMakeLists.txt | 2 +- 4 files changed, 14 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index de6357ad3..d9647fff8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -682,7 +682,6 @@ ELSE() ENDIF() FIND_PACKAGE(ZeroConf) - FIND_PACKAGE(Boost) # used by LIBLAS FIND_PACKAGE(LIBLAS) IF (NOT(OSG_USE_LOCAL_LUA_SOURCE)) diff --git a/CMakeModules/FindAsio.cmake b/CMakeModules/FindAsio.cmake index 29b255e26..433d5c73c 100644 --- a/CMakeModules/FindAsio.cmake +++ b/CMakeModules/FindAsio.cmake @@ -1,9 +1,9 @@ # Locate ASIO-headers (http://think-async.com/Asio) # This module defines -# ASIO_FOUND, if false, do not try to link to gdal +# ASIO_FOUND, if false, do not try to link to gdal # ASIO_INCLUDE_DIR, where to find the headers # -# Created by Stephan Maximilian Huber +# Created by Stephan Maximilian Huber FIND_PATH(ASIO_INCLUDE_DIR NAMES @@ -14,7 +14,9 @@ FIND_PATH(ASIO_INCLUDE_DIR ) SET(ASIO_FOUND "NO") -FIND_PACKAGE( Boost 1.37 ) -IF(Boost_FOUND AND ASIO_INCLUDE_DIR) - SET(ASIO_FOUND "YES") +IF(ASIO_INCLUDE_DIR) + FIND_PACKAGE( Boost 1.37 ) + IF(Boost_FOUND) + SET(ASIO_FOUND "YES") + ENDIF() ENDIF() diff --git a/CMakeModules/FindLIBLAS.cmake b/CMakeModules/FindLIBLAS.cmake index e293e2e78..1715057bc 100644 --- a/CMakeModules/FindLIBLAS.cmake +++ b/CMakeModules/FindLIBLAS.cmake @@ -98,6 +98,10 @@ FIND_LIBLAS_LIBRARY(LIBLASC_LIBRARY las_c) set(LIBLAS_FOUND "NO") if(LIBLAS_LIBRARY AND LIBLASC_LIBRARY AND LIBLAS_INCLUDE_DIR) - set(LIBLAS_LIBRARIES ${LIBLAS_LIBRARY} ${LIBLASC_LIBRARY} ) - set(LIBLAS_FOUND "YES") + + FIND_PACKAGE(Boost) # used by LIBLAS + if(Boost_FOUND) + set(LIBLAS_LIBRARIES ${LIBLAS_LIBRARY} ${LIBLASC_LIBRARY} ) + set(LIBLAS_FOUND "YES") + endif() endif() diff --git a/src/osgPlugins/CMakeLists.txt b/src/osgPlugins/CMakeLists.txt index 151f49b0e..f2ca656c3 100644 --- a/src/osgPlugins/CMakeLists.txt +++ b/src/osgPlugins/CMakeLists.txt @@ -266,7 +266,7 @@ ADD_SUBDIRECTORY(osc) ADD_SUBDIRECTORY(trk) ADD_SUBDIRECTORY(tf) -IF(Boost_INCLUDE_DIR AND LIBLAS_FOUND) +IF(LIBLAS_FOUND) ADD_SUBDIRECTORY(las) ENDIF()