Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- moved some options (e.g., PDAL_BUILD_STATIC) to pdal_options.cmake - created (really borrowed from PCL) macros for adding libraries and executables: PDAL_ADD_LIBRARY, PDAL_ADD_EXECUTABLE - library linkage (i.e., PUBLIC/PRIVATE) determined at the top level in pdal_options.cmake - embedded boost lib name does not need quotes, in fact, we lose the correct path on Windows if they're there - install commands (mostly) moved inside the PDAL_ADD_* macros
- Loading branch information
Showing
7 changed files
with
169 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
########################################################################## | ||
# These macros were taken from the Point Cloud Library (pointclouds.org) # | ||
# and have been modified for PDAL. License details follow. # | ||
########################################################################## | ||
# Software License Agreement (BSD License) # | ||
# # | ||
# Point Cloud Library (PCL) - www.pointclouds.org # | ||
# Copyright (c) 2009-2012, Willow Garage, Inc. # | ||
# Copyright (c) 2012-, Open Perception, Inc. # | ||
# Copyright (c) XXX, respective authors. # | ||
# # | ||
# All rights reserved. # | ||
# # | ||
# Redistribution and use in source and binary forms, with or without # | ||
# modification, are permitted provided that the following conditions # | ||
# are met: # | ||
# # | ||
# * Redistributions of source code must retain the above copyright # | ||
# notice, this list of conditions and the following disclaimer. # | ||
# * Redistributions in binary form must reproduce the above # | ||
# copyright notice, this list of conditions and the following # | ||
# disclaimer in the documentation and/or other materials provided # | ||
# with the distribution. # | ||
# * Neither the name of the copyright holder(s) nor the names of its # | ||
# contributors may be used to endorse or promote products derived # | ||
# from this software without specific prior written permission. # | ||
# # | ||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS # | ||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT # | ||
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS # | ||
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE # | ||
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, # | ||
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, # | ||
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; # | ||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER # | ||
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT # | ||
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN # | ||
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # | ||
# POSSIBILITY OF SUCH DAMAGE. # | ||
########################################################################## | ||
|
||
# Options for building PDAL. | ||
|
||
# Build shared libraries by default. | ||
option(PDAL_BUILD_STATIC "Build PDAL as a static library" OFF) | ||
if(NOT PDAL_BUILD_STATIC) | ||
set(PDAL_LIB_PREFIX ${CMAKE_SHARED_LIBRARY_PREFIX}) | ||
set(PDAL_LIB_SUFFIX ${CMAKE_SHARED_LIBRARY_SUFFIX}) | ||
set(PDAL_LIB_TYPE "SHARED") | ||
# set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_SHARED_LIBRARY_SUFFIX}) | ||
if(WIN32) | ||
set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_IMPORT_LIBRARY_SUFFIX}) | ||
endif(WIN32) | ||
else(NOT PDAL_BUILD_STATIC) | ||
set(PDAL_LIB_PREFIX ${CMAKE_STATIC_LIBRARY_PREFIX}) | ||
set(PDAL_LIB_SUFFIX ${CMAKE_STATIC_LIBRARY_SUFFIX}) | ||
set(PDAL_LIB_TYPE "STATIC") | ||
set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_STATIC_LIBRARY_SUFFIX}) | ||
endif(NOT PDAL_BUILD_STATIC) | ||
mark_as_advanced(PDAL_BUILD_STATIC) | ||
|
||
if (CMAKE_VERSION VERSION_GREATER 2.8.10) | ||
set(PDAL_LINKAGE "PUBLIC;general") | ||
set(BOOST_LINKAGE "LINK_PRIVATE;general") | ||
else() | ||
set(PDAL_LINKAGE "") | ||
set(BOOST_LINKAGE "") | ||
endif() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
########################################################################## | ||
# These macros were taken from the Point Cloud Library (pointclouds.org) # | ||
# and have been modified for PDAL. License details follow. # | ||
########################################################################## | ||
# Software License Agreement (BSD License) # | ||
# # | ||
# Point Cloud Library (PCL) - www.pointclouds.org # | ||
# Copyright (c) 2009-2012, Willow Garage, Inc. # | ||
# Copyright (c) 2012-, Open Perception, Inc. # | ||
# Copyright (c) XXX, respective authors. # | ||
# # | ||
# All rights reserved. # | ||
# # | ||
# Redistribution and use in source and binary forms, with or without # | ||
# modification, are permitted provided that the following conditions # | ||
# are met: # | ||
# # | ||
# * Redistributions of source code must retain the above copyright # | ||
# notice, this list of conditions and the following disclaimer. # | ||
# * Redistributions in binary form must reproduce the above # | ||
# copyright notice, this list of conditions and the following # | ||
# disclaimer in the documentation and/or other materials provided # | ||
# with the distribution. # | ||
# * Neither the name of the copyright holder(s) nor the names of its # | ||
# contributors may be used to endorse or promote products derived # | ||
# from this software without specific prior written permission. # | ||
# # | ||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS # | ||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT # | ||
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS # | ||
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE # | ||
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, # | ||
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, # | ||
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; # | ||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER # | ||
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT # | ||
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN # | ||
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # | ||
# POSSIBILITY OF SUCH DAMAGE. # | ||
########################################################################## | ||
|
||
|
||
############################################################################### | ||
# Add a set of include files to install. | ||
# _component The part of PDAL that the install files belong to. | ||
# _subdir The sub-directory for these include files. | ||
# ARGN The include files. | ||
macro(PDAL_ADD_INCLUDES _subdir) | ||
install(FILES ${ARGN} DESTINATION ${PDAL_INCLUDE_DIR}/${_subdir}) | ||
endmacro(PDAL_ADD_INCLUDES) | ||
|
||
|
||
############################################################################### | ||
# Add a library target. | ||
# _name The library name. | ||
# _component The part of PDAL that this library belongs to. | ||
# ARGN The source files for the library. | ||
macro(PDAL_ADD_LIBRARY _name) | ||
add_library(${_name} ${PDAL_LIB_TYPE} ${ARGN}) | ||
|
||
# must link explicitly against boost. | ||
target_link_libraries(${_name} ${BOOST_LINKAGE} ${Boost_LIBRARIES}) | ||
|
||
install(TARGETS ${_name} | ||
RUNTIME DESTINATION ${PDAL_BIN_DIR} | ||
LIBRARY DESTINATION ${PDAL_LIB_DIR} | ||
ARCHIVE DESTINATION ${PDAL_LIB_DIR}) | ||
endmacro(PDAL_ADD_LIBRARY) | ||
|
||
|
||
############################################################################### | ||
# Add an executable target. | ||
# _name The executable name. | ||
# _component The part of PDAL that this library belongs to. | ||
# ARGN the source files for the library. | ||
macro(PDAL_ADD_EXECUTABLE _name) | ||
add_executable(${_name} ${ARGN}) | ||
|
||
# must link explicitly against boost. | ||
target_link_libraries(${_name} ${BOOST_LINKAGE} ${Boost_LIBRARIES}) | ||
|
||
set(PDAL_EXECUTABLES ${PDAL_EXECUTABLES} ${_name}) | ||
install(TARGETS ${_name} RUNTIME DESTINATION ${PDAL_BIN_DIR}) | ||
endmacro(PDAL_ADD_EXECUTABLE) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters