1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-16 18:59:57 +00:00

Merge pull request #963 from kpp/find_unshield

Find unshield
This commit is contained in:
scrawl 2016-06-12 15:17:58 +02:00 committed by GitHub
commit 63784bfb50
3 changed files with 27 additions and 45 deletions

View file

@ -182,6 +182,11 @@ if (WIN32)
add_definitions(-DNOMINMAX -DWIN32_LEAN_AND_MEAN) add_definitions(-DNOMINMAX -DWIN32_LEAN_AND_MEAN)
endif() endif()
if (NOT WIN32 AND BUILD_WIZARD) # windows users can just run the morrowind installer
find_package(LIBUNSHIELD REQUIRED) # required only for non win32 when building openmw-wizard
set(OPENMW_USE_UNSHIELD TRUE)
endif()
option(OPENGL_ES "enable opengl es support" FALSE ) option(OPENGL_ES "enable opengl es support" FALSE )
if (OPENGL_ES) if (OPENGL_ES)

View file

@ -1,13 +1,3 @@
if (WIN32) # windows users can just run the morrowind installer
set(OPENMW_USE_UNSHIELD FALSE)
else()
set(OPENMW_USE_UNSHIELD TRUE)
find_package(LIBUNSHIELD REQUIRED)
if(NOT LIBUNSHIELD_FOUND)
message(FATAL_ERROR "Failed to find Unshield library")
endif(NOT LIBUNSHIELD_FOUND)
endif()
set(WIZARD set(WIZARD
componentselectionpage.cpp componentselectionpage.cpp
@ -103,7 +93,7 @@ endif()
include_directories(${CMAKE_CURRENT_BINARY_DIR}) include_directories(${CMAKE_CURRENT_BINARY_DIR})
if (OPENMW_USE_UNSHIELD) if (OPENMW_USE_UNSHIELD)
include_directories(${LIBUNSHIELD_INCLUDE_DIR}) include_directories(${LIBUNSHIELD_INCLUDE_DIRS})
endif() endif()
add_executable(openmw-wizard add_executable(openmw-wizard
@ -132,7 +122,7 @@ else()
endif() endif()
if (OPENMW_USE_UNSHIELD) if (OPENMW_USE_UNSHIELD)
target_link_libraries(openmw-wizard ${LIBUNSHIELD_LIBRARY}) target_link_libraries(openmw-wizard ${LIBUNSHIELD_LIBRARIES})
endif() endif()

View file

@ -1,8 +1,8 @@
# Locate LIBUNSHIELD # Locate LIBUNSHIELD
# This module defines # This module defines
# LIBUNSHIELD_LIBRARY # LIBUNSHIELD_LIBRARIES
# LIBUNSHIELD_FOUND, if false, do not try to link to LibUnshield # LIBUNSHIELD_FOUND, if false, do not try to link to LibUnshield
# LIBUNSHIELD_INCLUDE_DIR, where to find the headers # LIBUNSHIELD_INCLUDE_DIRS, where to find the headers
# #
# Created by Tom Mason (wheybags) for OpenMW (http://openmw.org), based on FindMPG123.cmake # Created by Tom Mason (wheybags) for OpenMW (http://openmw.org), based on FindMPG123.cmake
# #
@ -12,37 +12,24 @@
# function. Do we really need to repeat this stuff for every single # function. Do we really need to repeat this stuff for every single
# library when they all work the same? </today's rant> # library when they all work the same? </today's rant>
FIND_PATH(LIBUNSHIELD_INCLUDE_DIR libunshield.h include(LibFindMacros)
HINTS
PATHS set(POSSIBLE_LOCATIONS
~/Library/Frameworks ~/Library/Frameworks
/Library/Frameworks /Library/Frameworks
/usr/local /usr/local
/usr /usr
/sw # Fink /sw # Fink
/opt/local # DarwinPorts /opt/local # DarwinPorts
/opt/csw # Blastwave /opt/csw # Blastwave
/opt /opt
/usr/include /usr/include
) )
FIND_LIBRARY(LIBUNSHIELD_LIBRARY libfind_pkg_detect(LIBUNSHIELD libunshield
unshield FIND_PATH libunshield.h
HINTS HINTS ${POSSIBLE_LOCATIONS}
# PATH_SUFFIXES lib64 lib libs64 libs libs/Win32 libs/Win64 FIND_LIBRARY unshield
PATHS HINTS ${POSSIBLE_LOCATIONS}
~/Library/Frameworks
/Library/Frameworks
/usr/local
/usr
/sw
/opt/local
/opt/csw
/opt
/usr/lib
) )
libfind_process(LIBUNSHIELD)
IF(LIBUNSHIELD_LIBRARY AND LIBUNSHIELD_INCLUDE_DIR)
SET(LIBUNSHIELD_FOUND "YES")
ENDIF(LIBUNSHIELD_LIBRARY AND LIBUNSHIELD_INCLUDE_DIR)