Skip to content

Commit

Permalink
Merge pull request ossimlabs#266 from tclarke/dev
Browse files Browse the repository at this point in the history
Fix some bugs found while building with Visual Studio 2017.
  • Loading branch information
gpotts authored Feb 8, 2021
2 parents f3abf12 + 3ee21b0 commit 8dd4d1d
Show file tree
Hide file tree
Showing 8 changed files with 52 additions and 27 deletions.
21 changes: 19 additions & 2 deletions cmake/CMakeModules/FindFreetype.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ find_path(FREETYPE_INCLUDE_DIR_freetype2
freetype2
)

find_library(FREETYPE_LIBRARY
find_library(FREETYPE_LIBRARY_RELEASE
NAMES
freetype
libfreetype
Expand All @@ -100,13 +100,30 @@ find_library(FREETYPE_LIBRARY
lib
lib64
)
find_library(FREETYPE_LIBRARY_DEBUG
NAMES
freetyped
libfreetyped
freetype219d
HINTS
ENV FREETYPE_DIR
PATHS
/usr/freeware
ENV GTKMM_BASEPATH
[HKEY_CURRENT_USER\\SOFTWARE\\gtkmm\\2.4;Path]
[HKEY_LOCAL_MACHINE\\SOFTWARE\\gtkmm\\2.4;Path]
PATH_SUFFIXES
lib
lib64
)
include(SelectLibraryConfigurations)
select_library_configurations(FREETYPE)

# set the user variables
if(FREETYPE_INCLUDE_DIR_ft2build AND FREETYPE_INCLUDE_DIR_freetype2)
set(FREETYPE_INCLUDE_DIRS "${FREETYPE_INCLUDE_DIR_ft2build};${FREETYPE_INCLUDE_DIR_freetype2}")
list(REMOVE_DUPLICATES FREETYPE_INCLUDE_DIRS)
endif()
set(FREETYPE_LIBRARIES "${FREETYPE_LIBRARY}")

if(EXISTS "${FREETYPE_INCLUDE_DIR_freetype2}/freetype/freetype.h")
set(FREETYPE_H "${FREETYPE_INCLUDE_DIR_freetype2}/freetype/freetype.h")
Expand Down
19 changes: 8 additions & 11 deletions cmake/CMakeModules/FindGEOS.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -34,23 +34,20 @@ find_path( GEOS_INCLUDE_DIR geos_c.h
/usr/local/include)

# Find GEOS library:
find_library( GEOS_LIB NAMES geos_c
find_library( GEOS_LIBRARY_RELEASE NAMES geos_c
PATHS
$ENV{GEOS_DIR}/lib
${GEOS_DIR}/lib
/usr/local/lib
/usr/local/lib64)

# Find GEOS C library:
find_library( GEOS_C_LIB NAMES geos_c
PATHS
find_library( GEOS_LIBRARY_DEBUG NAMES geos_cd
PATHS
$ENV{GEOS_DIR}/lib
${GEOS_DIR}/lib)

# Set the GEOS_LIBRARY:
if( GEOS_LIB AND GEOS_C_LIB )
set( GEOS_LIBRARY ${GEOS_LIB} ${GEOS_C_LIB} CACHE STRING INTERNAL )
endif(GEOS_LIB AND GEOS_C_LIB )
${GEOS_DIR}/lib
/usr/local/lib
/usr/local/lib64)
include(SelectLibraryConfigurations)
select_library_configurations(GEOS)

#---
# This function sets GEOS_FOUND if variables are valid.
Expand Down
20 changes: 13 additions & 7 deletions cmake/CMakeModules/FindGEOTIFF.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,26 @@ FIND_PATH(GEOTIFF_INCLUDE_DIR geotiff.h
/usr/local/include/libgeotiff
/usr/local/include/geotiff)

SET(GEOTIFF_NAMES ${GEOTIFF_NAMES} geotiff_i geotiff libgeotiff_i libgeotiff)
FIND_LIBRARY(GEOTIFF_LIBRARY
NAMES ${GEOTIFF_NAMES}
SET(GEOTIFF_RELEASE_NAMES ${GEOTIFF_NAMES} geotiff_i geotiff libgeotiff_i libgeotiff)
SET(GEOTIFF_DEBUG_NAMES geotiff_d_i geotiff_d libgeotiff_d_i libgeotiff_d)
FIND_LIBRARY(GEOTIFF_LIBRARY_RELEASE
NAMES ${GEOTIFF_RELEASE_NAMES}
PATHS
$ENV{GEOTIFF_DIR}/lib
$ENV{GEOTIFF_DIR}/lib64)
FIND_LIBRARY(GEOTIFF_LIBRARY_DEBUG
NAMES ${GEOTIFF_DEBUG_NAMES}
PATHS
$ENV{GEOTIFF_DIR}/debug/lib
$ENV{GEOTIFF_DIR}/debug/lib64)

INCLUDE(SelectLibraryConfigurations)
select_library_configurations(GEOTIFF)
set(GEOTIFF_LIBRARIES ${GEOTIFF_LIBRARY})

# handle the QUIETLY and REQUIRED arguments and set GEOTIFF_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(GEOTIFF DEFAULT_MSG GEOTIFF_LIBRARY GEOTIFF_INCLUDE_DIR)

IF(GEOTIFF_FOUND)
SET( GEOTIFF_LIBRARIES ${GEOTIFF_LIBRARY} )
ENDIF(GEOTIFF_FOUND)

MARK_AS_ADVANCED(GEOTIFF_INCLUDE_DIR GEOTIFF_LIBRARY)
11 changes: 8 additions & 3 deletions cmake/CMakeModules/FindJPEG.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,15 @@

FIND_PATH(JPEG_INCLUDE_DIR jpeglib.h)

SET(JPEG_NAMES ${JPEG_NAMES} jpeg libjpeg)
SET(JPEG_RELEASE_NAMES ${JPEG_NAMES} jpeg libjpeg)
SET(JPEG_DEBUG_NAMES ${JPEG_NAMES} jpegd libjpegd)

# Added x86_64-linux-gnu path for Ubuntu install
FIND_LIBRARY(JPEG_LIBRARY NAMES ${JPEG_NAMES})
FIND_LIBRARY(JPEG_LIBRARY_RELEASE NAMES ${JPEG_RELEASE_NAMES})
FIND_LIBRARY(JPEG_LIBRARY_DEBUG NAMES ${JPEG_DEBUG_NAMES})

include(SelectLibraryConfigurations)
select_library_configurations(JPEG)

# handle the QUIETLY and REQUIRED arguments and set JPEG_FOUND to TRUE if
# all listed variables are TRUE
Expand All @@ -39,7 +44,7 @@ ENDIF(JPEG_FOUND)
# Deprecated declarations.
SET (NATIVE_JPEG_INCLUDE_PATH ${JPEG_INCLUDE_DIR} )
IF(JPEG_LIBRARY)
GET_FILENAME_COMPONENT (NATIVE_JPEG_LIB_PATH ${JPEG_LIBRARY} PATH)
GET_FILENAME_COMPONENT (NATIVE_JPEG_LIB_PATH ${JPEG_LIBRARY_RELEASE} PATH)
ENDIF(JPEG_LIBRARY)

MARK_AS_ADVANCED(JPEG_LIBRARY JPEG_INCLUDE_DIR )
2 changes: 1 addition & 1 deletion src/base/ossimFilename.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1129,7 +1129,7 @@ bool ossimFilename::createDirectory( bool recurseFlag,
}
#endif

if(current != OSSIM_FILENAME_PATH_SEPARATOR)
if(current != (const char*)OSSIM_FILENAME_PATH_SEPARATOR)
{
if(!ossimFilename(current).exists())
{
Expand Down
2 changes: 1 addition & 1 deletion src/imaging/ossimImageFileWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ ossimImageFileWriter::ossimImageFileWriter(const ossimFilename& file,
ossimNotify(ossimNotifyLevel_DEBUG)
<< "ossimImageFileWriter::ossimImageFileWriter entered..."
<< std::endl;
#ifdef OSSIM_ID_ENABLED
#if OSSIM_ID_ENABLED == 1
ossimNotify(ossimNotifyLevel_DEBUG)
<< "OSSIM_ID: " << OSSIM_ID << std::endl;
#endif
Expand Down
2 changes: 1 addition & 1 deletion src/parallel/ossimMpi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ ossimMpi::ossimMpi()
ossimNotify(ossimNotifyLevel_DEBUG)
<< "ossimMpi::ossimMpi entered..."
<< std::endl;
#ifdef OSSIM_ID_ENABLED
#if OSSIM_ID_ENABLED == 1
ossimNotify(ossimNotifyLevel_DEBUG)
<< "OSSIM_ID = " << OSSIM_ID << std::endl;
#endif
Expand Down
2 changes: 1 addition & 1 deletion src/support_data/ossimNitfRsmecbTag.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ void ossimNitfRsmecbTag::parseStream(std::istream &in)
in.read(m_noffx, FLOAT21_SIZE);
in.read(m_noffy, FLOAT21_SIZE);
in.read(m_noffz, FLOAT21_SIZE);
if (getLocalCoordinateSystemType().upcase() == 'R')
if (getLocalCoordinateSystemType().upcase() == "R")
{
in.read(m_xuol, FLOAT21_SIZE);
in.read(m_yuol, FLOAT21_SIZE);
Expand Down

0 comments on commit 8dd4d1d

Please sign in to comment.