50 lines
1.2 KiB
CMake
Executable File
50 lines
1.2 KiB
CMake
Executable File
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
INCLUDE(FindPackageHandleStandardArgs)
|
|
INCLUDE(FindLibraryWithDebug)
|
|
|
|
# Allow user to supply BGVIEWER_DIR or check ./external/BgViewer by default
|
|
if(NOT DEFINED BGVIEWER_DIR)
|
|
if(DEFINED ENV{EXTERNAL_DIR})
|
|
set(_external_hint "$ENV{EXTERNAL_DIR}")
|
|
else()
|
|
set(_external_hint "${CMAKE_SOURCE_DIR}/external")
|
|
endif()
|
|
set(BGVIEWER_DIR "${_external_hint}/BgViewer" CACHE PATH "BgViewer root directory (optional)")
|
|
endif()
|
|
|
|
# Search in common system locations and in BGVIEWER_DIR
|
|
set(_hints "${BGVIEWER_DIR}/lib" "${BGVIEWER_DIR}/lib/*" "${BGVIEWER_DIR}/lib/*/*")
|
|
|
|
FIND_LIBRARY_WITH_DEBUG(BGVIEWER_DTENTITY_LIBRARY WIN32_DEBUG_POSTFIX d dtEntity HINTS ${_hints})
|
|
FIND_LIBRARY_WITH_DEBUG(BGVIEWER_DTENTITYOSG_LIBRARY WIN32_DEBUG_POSTFIX d dtEntityOSG HINTS ${_hints})
|
|
FIND_PATH(BGVIEWER_INCLUDE_DIR dtEntity/export.h HINTS "${BGVIEWER_DIR}/include" "${BGVIEWER_DIR}/include/dtEntity" ${_hints} )
|
|
|
|
FIND_PACKAGE_HANDLE_STANDARD_ARGS(BgViewer DEFAULT_MSG
|
|
BGVIEWER_DTENTITY_LIBRARY
|
|
BGVIEWER_DTENTITYOSG_LIBRARY
|
|
BGVIEWER_INCLUDE_DIR)
|
|
SET(BGVIEWER_LIBRARIES ${BGVIEWER_DTENTITYOSG_LIBRARY}
|
|
${BGVIEWER_DTENTITY_LIBRARY})
|