mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-29 17:15:32 +00:00
cmake for system libunshield
This commit is contained in:
parent
d3748cd5bb
commit
865a7c63df
3 changed files with 56 additions and 4 deletions
|
@ -499,7 +499,6 @@ endif(WIN32)
|
|||
add_subdirectory (extern/shiny)
|
||||
add_subdirectory (extern/oics)
|
||||
add_subdirectory (extern/sdl4ogre)
|
||||
add_subdirectory (extern/unshield)
|
||||
|
||||
# Components
|
||||
add_subdirectory (components)
|
||||
|
@ -516,6 +515,13 @@ if (BUILD_ESMTOOL)
|
|||
endif()
|
||||
|
||||
if (BUILD_LAUNCHER)
|
||||
if(NOT WIN32)
|
||||
find_package(LIBUNSHIELD REQUIRED)
|
||||
if(NOT LIBUNSHIELD_FOUND)
|
||||
message(SEND_ERROR "Failed to find libunshield")
|
||||
endif(NOT LIBUNSHIELD_FOUND)
|
||||
endif(NOT WIN32)
|
||||
|
||||
add_subdirectory( apps/launcher )
|
||||
endif()
|
||||
|
||||
|
|
|
@ -71,8 +71,6 @@ QT4_WRAP_CPP(MOC_SRCS ${LAUNCHER_HEADER_MOC})
|
|||
QT4_WRAP_UI(UI_HDRS ${LAUNCHER_UI})
|
||||
|
||||
|
||||
message(STATUS "hello ${LIBUNSHIELD_INCLUDE}")
|
||||
|
||||
include(${QT_USE_FILE})
|
||||
include_directories(${CMAKE_CURRENT_BINARY_DIR} ${LIBUNSHIELD_INCLUDE})
|
||||
|
||||
|
@ -102,7 +100,7 @@ target_link_libraries(omwlauncher
|
|||
${SDL2_LIBRARY}
|
||||
${QT_LIBRARIES}
|
||||
components
|
||||
libunshield
|
||||
${LIBUNSHIELD_LIBRARY}
|
||||
)
|
||||
|
||||
|
||||
|
|
48
cmake/FindLibUnshield.cmake
Normal file
48
cmake/FindLibUnshield.cmake
Normal file
|
@ -0,0 +1,48 @@
|
|||
# Locate LIBUNSHIELD
|
||||
# This module defines
|
||||
# LIBUNSHIELD_LIBRARY
|
||||
# LIBUNSHIELD_FOUND, if false, do not try to link to LibUnshield
|
||||
# LIBUNSHIELD_INCLUDE_DIR, where to find the headers
|
||||
#
|
||||
# Created by Tom Mason (wheybags) for OpenMW (http://openmw.com), based on FindMPG123.cmake
|
||||
#
|
||||
# Ripped off from other sources. In fact, this file is so generic (I
|
||||
# just did a search and replace on another file) that I wonder why the
|
||||
# CMake guys haven't wrapped this entire thing in a single
|
||||
# function. Do we really need to repeat this stuff for every single
|
||||
# library when they all work the same? </today's rant>
|
||||
|
||||
FIND_PATH(LIBUNSHIELD_INCLUDE_DIR libunshield.h
|
||||
HINTS
|
||||
PATHS
|
||||
~/Library/Frameworks
|
||||
/Library/Frameworks
|
||||
/usr/local
|
||||
/usr
|
||||
/sw # Fink
|
||||
/opt/local # DarwinPorts
|
||||
/opt/csw # Blastwave
|
||||
/opt
|
||||
/usr/include
|
||||
)
|
||||
|
||||
FIND_LIBRARY(LIBUNSHIELD_LIBRARY
|
||||
unshield
|
||||
HINTS
|
||||
# PATH_SUFFIXES lib64 lib libs64 libs libs/Win32 libs/Win64
|
||||
PATHS
|
||||
~/Library/Frameworks
|
||||
/Library/Frameworks
|
||||
/usr/local
|
||||
/usr
|
||||
/sw
|
||||
/opt/local
|
||||
/opt/csw
|
||||
/opt
|
||||
/usr/lib
|
||||
)
|
||||
|
||||
IF(LIBUNSHIELD_LIBRARY AND LIBUNSHIELD_INCLUDE_DIR)
|
||||
SET(LIBUNSHIELD_FOUND "YES")
|
||||
ENDIF(LIBUNSHIELD_LIBRARY AND LIBUNSHIELD_INCLUDE_DIR)
|
||||
|
Loading…
Reference in a new issue