Skip to content

Commit

Permalink
Improve GHOST finder.
Browse files Browse the repository at this point in the history
  • Loading branch information
rpavlik committed Mar 16, 2012
1 parent b922e06 commit feb11f6
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 16 deletions.
37 changes: 22 additions & 15 deletions FindGHOST.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -40,27 +40,35 @@ find_path(GHOST_INCLUDE_DIR

find_library(GHOST_LIBRARY
GHOST40
GHOST31
PATHS
${_dirs}
HINTS
"${GHOST_ROOT_DIR}"
PATH_SUFFIXES
lib)

if(MSVC_VERSION GREATER 1300)
# .NET and newer: fake the STL headers
get_filename_component(_moddir "${CMAKE_CURRENT_LIST_FILE}" PATH)
set(GHOST_STL_INCLUDE_DIR "${_moddir}/ghost-fake-stl")
if(MSVC)
if(MSVC_VERSION GREATER 1300)
# .NET and newer: fake the STL headers
get_filename_component(_moddir "${CMAKE_CURRENT_LIST_FILE}" PATH)
set(GHOST_STL_INCLUDE_DIR "${_moddir}/ghost-fake-stl")
else()
# 6.0 and earlier - use GHOST-provided STL
find_path(GHOST_STL_INCLUDE_DIR
vector.h
PATHS
${_dirs}
HINTS
"${GHOST_ROOT_DIR}"
"${GHOST_INCLUDE_DIR}"
PATH_SUFFIXES
external/stl
stl)
endif()
set(_deps_check GHOST_STL_INCLUDE_DIR)
else()
# 6.0 and earlier - use GHOST-provided STL
find_path(GHOST_STL_INCLUDE_DIR
vector.h
PATHS
${_dirs}
HINTS
"${GHOST_ROOT_DIR}"
PATH_SUFFIXES
external/stl)
set(_deps_check)
endif()

# handle the QUIETLY and REQUIRED arguments and set xxx_FOUND to TRUE if
Expand All @@ -69,13 +77,12 @@ include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(GHOST
DEFAULT_MSG
GHOST_LIBRARY
GHOST_STL_INCLUDE_DIR
${_deps_check}
GHOST_INCLUDE_DIR)

if(GHOST_FOUND)
set(GHOST_LIBRARIES "${GHOST_LIBRARY}")
set(GHOST_INCLUDE_DIRS
"${GHOST_STL_INCLUDE_DIR}"
"${GHOST_INCLUDE_DIR}")

mark_as_advanced(GHOST_ROOT_DIR)
Expand Down
4 changes: 3 additions & 1 deletion ghost-fake-stl/set.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,6 @@
#pragma once

#include <set>
using std::set;
#include <functional>
using std::set;
using std::less;

0 comments on commit feb11f6

Please sign in to comment.