Skip to content

Commit

Permalink
fix various issues with embeddedboost on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
mpgerlek committed Mar 2, 2012
1 parent 99542b0 commit 7695bb1
Show file tree
Hide file tree
Showing 5 changed files with 69 additions and 36 deletions.
6 changes: 4 additions & 2 deletions CMakeLists.txt
Expand Up @@ -237,6 +237,7 @@ if(WITH_GDAL)
include_directories(${GDAL_INCLUDE_DIR})
mark_as_advanced(CLEAR GDAL_INCLUDE_DIR)
mark_as_advanced(CLEAR GDAL_LIBRARY)
message(STATUS "...building with GDAL")
else()
set(GDAL_LIBRARY "")
endif()
Expand Down Expand Up @@ -299,7 +300,7 @@ if(WITH_SWIG_CSHARP OR WITH_SWIG_PYTHON)
if(WITH_SWIG_CSHARP)
add_subdirectory(csharp)
set(PDAL_HAVE_SWIG_CSHARP 1)
message(STATUS "Enabling swig for csharp")
message(STATUS "...enabling swig for csharp")
endif()
if(WITH_SWIG_PYTHON)
add_subdirectory(python)
Expand Down Expand Up @@ -345,6 +346,7 @@ if(WITH_ORACLE)
if(ORACLE_FOUND)
include_directories(${ORACLE_INCLUDE_DIR})
set(PDAL_HAVE_ORACLE 1)
message(STATUS "...building with Oracle")
endif()
endif()

Expand Down Expand Up @@ -470,7 +472,7 @@ add_subdirectory(src)
add_subdirectory(apps)

if(WITH_TESTS)
message(STATUS "Enable PDAL unit tests to build - done")
message(STATUS "Building with PDAL unit tests")
enable_testing()

if(ENABLE_CTEST)
Expand Down
14 changes: 13 additions & 1 deletion boost/CMakeLists.txt
Expand Up @@ -6,7 +6,19 @@

include_directories(".")

add_definitions(-DBOOST_TEST_DYN_LINK)
if(WIN32)
#add_definitions(-DBOOST_TEST_DYN_LINK)
#add_definitions(-DBOOST_TEST_NO_MAIN)

# disable compiler warnings
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /w")

else()

add_definitions(-DBOOST_TEST_DYN_LINK)

endif()


set(PDALBOOST_SOURCES
./libs/date_time/src/gregorian/date_generators.cpp
Expand Down
33 changes: 18 additions & 15 deletions config.bat
@@ -1,28 +1,28 @@
@echo off

:: This configure script is designed for the default Windows world, which means
:: you have OSGeo4W installed, including Oracle and GDAL and LASzip.

:: This configure script expects to be run from the PDAL root directory.

:: Pick your CMake GENERATOR. (NMake will pick up architecture (x32, x64) from your environment)
rem set GENERATOR="NMake Makefiles"
rem set GENERATOR="Visual Studio 10 Win64"
set GENERATOR="Visual Studio 10 Win64"
set GENERATOR="Visual Studio 10"

:: Pick your build type
set BUILD_TYPE=Release
rem set BUILD_TYPE=Debug
set BUILD_TYPE=Debug

:: Where is your PDAL build tree?
set PDAL_DIR=.
rem set PDAL_DIR=c:\dev\pdal

:: Where is your OSGeo4W installed (recommended basic way to satisfy dependent libs)
set OSGEO4W_DIR=C:\OSGeo4W

:: Advanced users may want to use this as part of the dependency paths below
set DEV_DIR=c:\dev

:: Where is boost installed?
rem set BOOST_DIR=%PDAL_DIR%\boost
set BOOST_DIR=c:\utils\boost_1_48_0
rem set BOOST_DIR=c:\utils\boost_1_48_0
set BOOST_DIR=%PDAL_DIR%\boost

:: GDAL
set GDAL_ENABLED=ON
Expand All @@ -41,8 +41,8 @@ set GEOTIFF_LIBRARY=%OSGEO4W_DIR%\lib\geotiff_i.lib

:: LASZIP
set LASZIP_ENABLED=ON
set LASZIP_LIBRARY=%DEV_DIR%\laszip\bin\Debug\laszip.lib
set LASZIP_INCLUDE_DIR=%DEV_DIR%\laszip\include
set LASZIP_INCLUDE_DIR=%OSGEO4W_DIR%\include
set LASZIP_LIBRARY=%OSGEO4W_DIR%\lib\laszip.lib

:: Oracle
set ORACLE_ENABLED=ON
Expand All @@ -60,21 +60,20 @@ set ICONV_ENABLED=ON
set ICONV_INCLUDE_DIR=%OSGEO4W_DIR%\include
set ICONV_LIBRARY=%OSGEO4W_DIR%\lib\iconv.lib

:: Set this if you are building SWIG bindings for C#. Visual Studio
:: Set this if you are building SWIG bindings for C#. Visual Studio
:: needs to use this env var to find where boost lives.
set PDAL_SWIG_ENABLED=ON
set PDAL_SWIG_BOOST_HOME=%BOOST_DIR%

if EXIST CMakeCache.txt del CMakeCache.txt
rem if EXIST CMakeCache.txt del CMakeCache.txt
cmake -G %GENERATOR% ^
-DBOOST_INCLUDEDIR=%BOOST_DIR% ^
-DWITH_GDAL=%GDAL_ENABLED% ^
-DWITH_GEOTIFF=%GEOTIFF_ENABLED% ^
-DWITH_ORACLE=%ORACLE_ENABLED% ^
-DWITH_LASZIP=%LASZIP_ENABLED% ^
-DWITH_LIBXML2=%LIBXML2_ENABLED% ^
-DWITH_SWIG_CSHARP=%PDAL_SWIG_ENABLED% ^
-DWITH_PLANG=ON ^
-DWITH_ICONV=%ICONV_ENABLED% ^
-DTIFF_INCLUDE_DIR=%TIFF_INCLUDE_DIR% ^
-DTIFF_LIBRARY=%TIFF_LIBRARY% ^
-DGEOTIFF_INCLUDE_DIR=%GEOTIFF_INCLUDE_DIR% ^
Expand All @@ -91,4 +90,8 @@ cmake -G %GENERATOR% ^
-DICONV_INCLUDE_DIR=%ICONV_INCLUDE_DIR% ^
-DCMAKE_BUILD_TYPE=%BUILD_TYPE% ^
-DCMAKE_VERBOSE_MAKEFILE=OFF ^
%PDAL_DIR%
%PDAL_DIR%


rem -DWITH_PLANG=ON ^
rem -DBOOST_INCLUDEDIR=%BOOST_DIR% ^
48 changes: 32 additions & 16 deletions src/CMakeLists.txt
Expand Up @@ -463,26 +463,42 @@ endif()

add_library(${PDAL_LIB_NAME} SHARED ${PDAL_SOURCES})

target_link_libraries(${APPS_CPP_DEPENDENCIES}
${PDAL_LIB_NAME}
${TIFF_LIBRARY}
${ORACLE_LIBRARY}
${MRSID_LIBRARY}
${GEOTIFF_LIBRARY}
${GDAL_LIBRARY}
${LASZIP_LIBRARY}
${LIBXML2_LIBRARIES}
${P2G_LIBRARY})

message(STATUS "boost libs: ${Boost_LIBRARIES}")
if (WIN32)
target_link_libraries(${APPS_CPP_DEPENDENCIES} LINK_PUBLIC general
${PDAL_LIB_NAME}
${TIFF_LIBRARY}
${ORACLE_LIBRARY}
${MRSID_LIBRARY}
${GEOTIFF_LIBRARY}
${GDAL_LIBRARY}
${LASZIP_LIBRARY}
${LIBXML2_LIBRARIES}
${P2G_LIBRARY})
else()
target_link_libraries(${APPS_CPP_DEPENDENCIES}
${PDAL_LIB_NAME}
${TIFF_LIBRARY}
${ORACLE_LIBRARY}
${MRSID_LIBRARY}
${GEOTIFF_LIBRARY}
${GDAL_LIBRARY}
${LASZIP_LIBRARY}
${LIBXML2_LIBRARIES}
${P2G_LIBRARY})
endif()

message(STATUS "Using boost lib: ${Boost_LIBRARIES}")

if (WIN32)
if (CMAKE_VERSION VERSION_GREATER 2.8.7)
target_link_libraries(${APPS_CPP_DEPENDENCIES}
if (CMAKE_VERSION VERSION_GREATER 2.8.6)
target_link_libraries(${APPS_CPP_DEPENDENCIES}
LINK_PRIVATE general ${Boost_LIBRARIES})
endif(CMAKE_VERSION VERSION_GREATER 2.8.7)
else()
target_link_libraries(${APPS_CPP_DEPENDENCIES}
${Boost_LIBRARIES})
endif()
else()
target_link_libraries(${APPS_CPP_DEPENDENCIES}
target_link_libraries(${APPS_CPP_DEPENDENCIES}
${Boost_LIBRARIES})

endif(WIN32)
Expand Down
4 changes: 2 additions & 2 deletions test/unit/CMakeLists.txt
Expand Up @@ -154,15 +154,15 @@ if(LIBLAS_FOUND)
${TIFF_LIBRARY}
${GEOTIFF_LIBRARY}
${GDAL_LIBRARY}
${SPATIALINDEX_LIBRARY})
${SPATIALINDEX_LIBRARY} ${Boost_LIBRARIES})
else()
TARGET_LINK_LIBRARIES(${PDAL_UNIT_TEST}
${PDAL_LIB_NAME}
${ZLIB_LIBRARIES}
${TIFF_LIBRARY}
${GEOTIFF_LIBRARY}
${GDAL_LIBRARY}
${SPATIALINDEX_LIBRARY})
${SPATIALINDEX_LIBRARY} ${Boost_LIBRARIES})
endif()

ADD_TEST(pdal_test ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/pdal_test ${PROJECT_SOURCE_DIR}/test/data)

0 comments on commit 7695bb1

Please sign in to comment.