Skip to content

Commit

Permalink
Merge pull request #153 from Kitware/fix-fletch-root-dir-install
Browse files Browse the repository at this point in the history
Fix fletch root dir install
  • Loading branch information
dstoup authored Jul 18, 2017
2 parents e9a29a4 + 1c3f123 commit a7873c4
Show file tree
Hide file tree
Showing 33 changed files with 91 additions and 49 deletions.
2 changes: 1 addition & 1 deletion CMake/External_Boost.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ endif()
set(Boost_ADDITIONAL_VERSIONS @Boost_version@)
set(Boost_NO_SYSTEM_PATHS ON)
set(Boost_NO_BOOST_CMAKE ON)
set(BOOST_ROOT @BOOST_ROOT@)
set(BOOST_ROOT \$\{fletch_ROOT\})
set(fletch_ENABLED_Boost TRUE)
")
2 changes: 1 addition & 1 deletion CMake/External_Caffe.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -281,5 +281,5 @@ file(APPEND ${fletch_CONFIG_INPUT} "
########################################
# Caffe
########################################
set(Caffe_ROOT @Caffe_ROOT@)
set(Caffe_ROOT \$\{fletch_ROOT\})
")
9 changes: 7 additions & 2 deletions CMake/External_Ceres.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,12 @@ file(APPEND ${fletch_CONFIG_INPUT} "
########################################
# Ceres
########################################
set(Ceres_ROOT @Ceres_ROOT@)
set(Ceres_DIR @Ceres_DIR@)
set(Ceres_ROOT \$\{fletch_ROOT\})
if(WIN32)
set(Ceres_DIR \$\{fletch_ROOT\}/CMake)
else()
set(Ceres_DIR \$\{fletch_ROOT\}/share/Ceres)
endif()
set(fletch_ENABLED_Ceres TRUE)
")
8 changes: 4 additions & 4 deletions CMake/External_Eigen.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ file(APPEND ${fletch_CONFIG_INPUT} "
########################################
# EIGEN
########################################
set(EIGEN_ROOT @EIGEN_ROOT@)
set(EIGEN3_ROOT @EIGEN_ROOT@)
set(EIGEN_INCLUDE_DIR @EIGEN_INCLUDE_DIR@)
set(EIGEN3_INCLUDE_DIR @EIGEN_INCLUDE_DIR@)
set(EIGEN_ROOT \$\{fletch_ROOT\})
set(EIGEN3_ROOT \$\{fletch_ROOT\})
set(EIGEN_INCLUDE_DIR \$\{fletch_ROOT\}/include/eigen3)
set(EIGEN3_INCLUDE_DIR \$\{fletch_ROOT\}/include/eigen3)
set(fletch_ENABLED_Eigen TRUE)
")
3 changes: 1 addition & 2 deletions CMake/External_FFmpeg.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

if (WIN32)
# On windows, FFMPEG relies on prebuilt binaries. These binaries come in two
# archives, dev and shared. An external project is added for each of them just
Expand Down Expand Up @@ -85,5 +84,5 @@ file(APPEND ${fletch_CONFIG_INPUT} "
#######################################
# FFmpeg
#######################################
set(FFmpeg_ROOT @FFmpeg_ROOT@)
set(FFmpeg_ROOT \$\{fletch_ROOT\})
")
2 changes: 1 addition & 1 deletion CMake/External_GFlags.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@ file(APPEND ${fletch_CONFIG_INPUT} "
#######################################
# GFlags
#######################################
set(GFlags_ROOT @GFlags_ROOT@)
set(GFlags_ROOT \$\{fletch_ROOT\})
")
2 changes: 1 addition & 1 deletion CMake/External_GLog.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,5 @@ file(APPEND ${fletch_CONFIG_INPUT} "
#######################################
# GLog
#######################################
set(GLog_ROOT @GLog_ROOT@)
set(GLog_ROOT \$\{fletch_ROOT\})
")
2 changes: 1 addition & 1 deletion CMake/External_GeographicLib.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ file(APPEND ${fletch_CONFIG_INPUT} "
########################################
# GeographicLib
########################################
set(GeographicLib_ROOT @GeographicLib_ROOT@)
set(GeographicLib_ROOT \$\{fletch_ROOT\})
set(fletch_ENABLED_GeographicLib TRUE)
")
2 changes: 1 addition & 1 deletion CMake/External_HDF5.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,5 @@ file(APPEND ${fletch_CONFIG_INPUT} "
#######################################
# HDF5
#######################################
set(HDF5_ROOT @HDF5_ROOT@)
set(HDF5_ROOT \$\{fletch_ROOT\})
")
4 changes: 2 additions & 2 deletions CMake/External_ITK.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ file(APPEND ${fletch_CONFIG_INPUT} "
########################################
# ITK
########################################
set(ITK_ROOT @ITK_ROOT@)
set(ITK_DIR @ITK_DIR@)
set(ITK_ROOT \$\{fletch_ROOT\})
set(ITK_DIR \$\{fletch_ROOT\}/lib/cmake/vtk-${ITK_version})
set(fletch_ENABLED_ITK TRUE)
")
3 changes: 1 addition & 2 deletions CMake/External_LMDB.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

if (WIN32)

# Build option for windows not yet generated
Expand Down Expand Up @@ -34,5 +33,5 @@ file(APPEND ${fletch_CONFIG_INPUT} "
########################################
# LMDB
########################################
set(LMDB_ROOT @LMDB_ROOT@)
set(LMDB_ROOT \$\{fletch_ROOT\})
")
2 changes: 1 addition & 1 deletion CMake/External_LevelDB.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,5 @@ file(APPEND ${fletch_CONFIG_INPUT} "
########################################
# LevelDB
########################################
set(LevelDB_ROOT @LevelDB_ROOT@)
set(LevelDB_ROOT \$\{fletch_ROOT\})
")
2 changes: 1 addition & 1 deletion CMake/External_OpenBLAS.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,5 @@ file(APPEND ${fletch_CONFIG_INPUT} "
########################################
# OpenBLAS
########################################
set(OpenBLAS_ROOT @OpenBLAS_ROOT@)
set(OpenBLAS_ROOT \$\{fletch_ROOT\})
")
8 changes: 6 additions & 2 deletions CMake/External_OpenCV.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -218,8 +218,12 @@ file(APPEND ${fletch_CONFIG_INPUT} "
########################################
# OpenCV
########################################
set(OpenCV_ROOT @OpenCV_ROOT@)
set(OpenCV_DIR @OpenCV_DIR@)
set(OpenCV_ROOT \$\{fletch_ROOT\})
if(WIN32)
set(OpenCV_DIR \$\{OpenCV_ROOT\})
else()
set(OpenCV_DIR \$\{OpenCV_ROOT\}/share/OpenCV)
endif()
set(fletch_ENABLED_OpenCV TRUE)
")
2 changes: 1 addition & 1 deletion CMake/External_PNG.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ file(APPEND ${fletch_CONFIG_INPUT} "
################################
# PNG
################################
set(PNG_ROOT @PNG_ROOT@)
set(PNG_ROOT \$\{fletch_ROOT\})
set(fletch_ENABLED_PNG TRUE)
")
6 changes: 3 additions & 3 deletions CMake/External_PROJ4.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ file(APPEND ${fletch_CONFIG_INPUT} "
########################################
# PROJ4
########################################
set(PROJ4_ROOT @PROJ4_ROOT@)
set(PROJ4_INCLUDE_DIR @PROJ4_INCLUDE_DIR@)
set(PROJ_INCLUDE_DIR @PROJ4_INCLUDE_DIR@)
set(PROJ4_ROOT \$\{fletch_ROOT\})
set(PROJ4_INCLUDE_DIR \$\{fletch_ROOT\}/include)
set(PROJ_INCLUDE_DIR \$\{fletch_ROOT\}/include)
set(fletch_ENABLED_PROJ4 TRUE)
")
2 changes: 1 addition & 1 deletion CMake/External_Protobuf.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ file(APPEND ${fletch_CONFIG_INPUT} "
#######################################
# Google Protobuf
#######################################
set(Protobuf_ROOT @Protobuf_ROOT@)
set(Protobuf_ROOT \$\{fletch_ROOT\})
")

2 changes: 1 addition & 1 deletion CMake/External_Qt.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ file(APPEND ${fletch_CONFIG_INPUT} "
########################################
# Qt
########################################
set(QT_QMAKE_EXECUTABLE @QT_QMAKE_EXECUTABLE@)
set(QT_QMAKE_EXECUTABLE \$\{fletch_ROOT\}/bin/qmake)
set(fletch_ENABLED_Qt TRUE)
")
Expand Down
2 changes: 1 addition & 1 deletion CMake/External_Snappy.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@ file(APPEND ${fletch_CONFIG_INPUT} "
########################################
# Snappy
########################################
set(SNAPPY_ROOT @SNAPPY_ROOT@)
set(SNAPPY_ROOT \$\{fletch_ROOT\})
")
4 changes: 2 additions & 2 deletions CMake/External_SuiteSparse.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ file(APPEND ${fletch_CONFIG_INPUT} "
########################################
# SuiteSparse
########################################
set(SuiteSparse_ROOT @SuiteSparse_ROOT@)
set(SuiteSparse_INCLUDE_DIR @SuiteSparse_INCLUDE_DIR@)
set(SuiteSparse_ROOT \$\{fletch_ROOT\})
set(SuiteSparse_INCLUDE_DIR \$\{fletch_ROOT\}/include)
set(fletch_ENABLED_SuiteSparse TRUE)
")
2 changes: 1 addition & 1 deletion CMake/External_TinyXML.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ file(APPEND ${fletch_CONFIG_INPUT} "
########################################
# TinyXML
########################################
set(TinyXML_ROOT @TinyXML_ROOT@)
set(TinyXML_ROOT \$\{fletch_ROOT\})
set(fletch_ENABLED_TinyXML TRUE)
")
4 changes: 2 additions & 2 deletions CMake/External_VTK.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,8 @@ file(APPEND ${fletch_CONFIG_INPUT} "
########################################
# VTK
########################################
set(VTK_ROOT @VTK_ROOT@)
set(VTK_DIR @VTK_DIR@)
set(VTK_ROOT \$\{fletch_ROOT\})
set(VTK_DIR \$\{fletch_ROOT\}/lib/cmake/vtk-${VTK_version})
set(fletch_ENABLED_VTK TRUE)
")
4 changes: 2 additions & 2 deletions CMake/External_VXL.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,8 @@ file(APPEND ${fletch_CONFIG_INPUT} "
################################
# VXL
################################
set(VXL_ROOT @VXL_ROOT@)
set(VXL_DIR @VXL_DIR@)
set(VXL_ROOT \$\{fletch_ROOT\})
set(VXL_DIR \$\{fletch_ROOT\}/share/vxl/cmake)
set(fletch_ENABLED_VXL TRUE)
")
2 changes: 1 addition & 1 deletion CMake/External_ZLib.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ file(APPEND ${fletch_CONFIG_INPUT} "
########################################
# ZLib
########################################
set(ZLIB_ROOT @ZLIB_ROOT@)
set(ZLIB_ROOT \$\{fletch_ROOT\})
set(fletch_ENABLED_ZLib TRUE)
")
2 changes: 1 addition & 1 deletion CMake/External_libjpeg-turbo.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ file(APPEND ${fletch_CONFIG_INPUT} "
################################
# libjpeg-turbo
################################
set(libjpeg-turbo_ROOT @libjpeg-turbo_ROOT@)
set(libjpeg-turbo_ROOT \$\{fletch_ROOT\})
set(fletch_ENABLED_libjpeg-turbo TRUE)
Expand Down
2 changes: 1 addition & 1 deletion CMake/External_libjson.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ file(APPEND ${fletch_CONFIG_INPUT} "
########################################
# libjson
########################################
set(LIBJSON_ROOT @LIBJSON_ROOT@)
set(LIBJSON_ROOT \$\{fletch_ROOT\})
set(LIBJSON_LIBNAME @LIBJSON_LIBNAME@)
set(fletch_ENABLED_libjson TRUE)
Expand Down
4 changes: 2 additions & 2 deletions CMake/External_libkml.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ file(APPEND ${fletch_CONFIG_INPUT} "
########################################
# libkml
########################################
set(LIBKML_ROOT @LIBKML_ROOT@)
set(LIBKML_DIR @LIBKML_DIR@)
set(LIBKML_ROOT \$\{fletch_ROOT\})
set(LIBKML_DIR \$\{fletch_ROOT\}/lib/cmake)
set(LIBKML_LIBNAME @LIBKML_LIBNAME@)
set(fletch_ENABLED_libkml TRUE)
Expand Down
2 changes: 1 addition & 1 deletion CMake/External_libtiff.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ file(APPEND ${fletch_CONFIG_INPUT} "
################################
# libtiff
################################
set(libtiff_ROOT @libtiff_ROOT@)
set(libtiff_ROOT \$\{fletch_ROOT\})
set(fletch_ENABLED_libtiff TRUE)
")
2 changes: 1 addition & 1 deletion CMake/External_libxml2.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ file(APPEND ${fletch_CONFIG_INPUT} "
########################################
# libxml2
########################################
set(LIBXML2_ROOT @LIBXML2_ROOT@)
set(LIBXML2_ROOT \$\{fletch_ROOT\})
set(LIBXML2_LIBNAME @LIBXML2_LIBNAME@)
set(fletch_ENABLED_libxml2 TRUE)
Expand Down
4 changes: 2 additions & 2 deletions CMake/External_log4cplus.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ file(APPEND ${fletch_CONFIG_INPUT} "
########################################
# log4cplus
########################################
set(log4cplus_ROOT @log4cplus_ROOT@)
set(log4cplus_DIR @log4cplus_ROOT@/lib/cmake/log4cplus)
set(log4cplus_ROOT \$\{fletch_ROOT\})
set(log4cplus_DIR \$\{fletch_ROOT\}/lib/cmake/log4cplus)
set(fletch_ENABLED_log4cplus TRUE)
")
2 changes: 1 addition & 1 deletion CMake/External_shapelib.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ file(APPEND ${fletch_CONFIG_INPUT} "
########################################
# shapelib
########################################
set(SHAPELIB_ROOT @SHAPELIB_ROOT@)
set(SHAPELIB_ROOT \$\{fletch_ROOT\})
set(SHAPELIB_LIBNAME @SHAPELIB_LIBNAME@)
set(fletch_ENABLED_shapelib TRUE)
Expand Down
29 changes: 28 additions & 1 deletion CMake/fletch-install.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,32 @@

install(DIRECTORY ${fletch_BUILD_INSTALL_PREFIX}/ DESTINATION ${CMAKE_INSTALL_PREFIX})


set(fletch_INSTALL_BUILD_DIR ${CMAKE_INSTALL_PREFIX})
set(fletch_CONFIG_OUTPUT ${CMAKE_INSTALL_PREFIX}/lib/cmake/fletch/fletchConfig.cmake )
# Also install the Config file so it can be found.
install(FILES ${fletch_CONFIG_OUTPUT} DESTINATION ${CMAKE_INSTALL_PREFIX})


# We need to configure the 'install' version of the config into an 'export' directory, then install it.
# The export directory was chosen because it make sense semantically as is not likely to confuse users.
#
configure_file(
${fletch_CONFIG_INPUT} ${fletch_BUILD_PREFIX}/config/export/fletchConfig_install.cmake
@ONLY
)

install(
FILES
${fletch_BUILD_PREFIX}/config/export/fletchConfig_install.cmake
DESTINATION
${CMAKE_INSTALL_PREFIX}/lib/cmake/fletch/
RENAME
fletchConfig.cmake
)

install(
FILES
${fletch_BUILD_DIR}/fletchConfig-version.cmake
DESTINATION
${CMAKE_INSTALL_PREFIX}/lib/cmake/fletch/
)
12 changes: 10 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,19 @@ option(fletch_ENABLE_ALL_PACKAGES "Enable all available packages" FALSE)
# allow the configuring package to set the install prefix.
if (NOT fletch_BUILD_INSTALL_PREFIX)
set(fletch_BUILD_INSTALL_PREFIX ${CMAKE_CURRENT_BINARY_DIR}/install)
# If building fletch from inside, change config out directory to the build directory
set(fletch_CONFIG_OUTPUT ${fletch_BINARY_DIR}/fletchConfig.cmake )
else()
set(fletch_CONFIG_OUTPUT ${fletch_BUILD_INSTALL_PREFIX}/fletchConfig.cmake )
endif()

#
# Create a CMake Version file
#
set(fletch_BUILD_DIR ${CMAKE_CURRENT_BINARY_DIR})
configure_file(
${fletch_SOURCE_DIR}/fletchConfig-version.cmake.in
${fletch_BUILD_INSTALL_PREFIX}/fletchConfig-version.cmake
${fletch_BUILD_DIR}/fletchConfig-version.cmake
@ONLY IMMEDIATE)

#+
Expand All @@ -97,7 +102,6 @@ configure_file(
#-

set(fletch_CONFIG_INPUT ${fletch_BINARY_DIR}/fletchConfig.cmake.in )
set(fletch_CONFIG_OUTPUT ${fletch_BUILD_INSTALL_PREFIX}/fletchConfig.cmake )
set(fletch_BUILD_PREFIX ${CMAKE_CURRENT_BINARY_DIR}/build)


Expand All @@ -108,9 +112,13 @@ set(fletch_BUILD_PREFIX ${CMAKE_CURRENT_BINARY_DIR}/build)
# DESTINATION ${fletch_BUILD_INSTALL_SHARE_CMAKE_PREFIX} )


# We are using fletch_INSTALL_BUILD_DIR to define where Fletch_ROOT is at configure time
# If installed, it is set to CMAKE_PREFIX before configure, otherwise, set to fletch_ROOT
set(fletch_INSTALL_BUILD_DIR ${fletch_BUILD_INSTALL_PREFIX})
file(WRITE ${fletch_CONFIG_INPUT} "
# Configuration file for the fletch build
set(fletch_VERSION ${fletch_VERSION})
set(fletch_ROOT @fletch_INSTALL_BUILD_DIR@)
set(fletch_WITH_PYTHON ${fletch_BUILD_WITH_PYTHON})
")

Expand Down

0 comments on commit a7873c4

Please sign in to comment.