few improvements in compilation on mac

This commit is contained in:
filux
2015-10-26 20:56:55 +01:00
parent 75077c4a50
commit 9932920712
6 changed files with 50 additions and 33 deletions

View File

@@ -129,6 +129,11 @@ find_path(LUA_INCLUDE_DIR lua.h
) )
unset(_lua_include_subdirs) unset(_lua_include_subdirs)
IF(STATIC_LUA AND APPLE)
# at least in mac ports, static lib is without numbers in name
SET(_lua_library_names lua.a liblua.a ${_lua_library_names})
ENDIF()
find_library(LUA_LIBRARY find_library(LUA_LIBRARY
NAMES ${_lua_library_names} lua NAMES ${_lua_library_names} lua
HINTS HINTS

View File

@@ -41,9 +41,10 @@ SET(MINIUPNPC_DIR_SEARCH $ENV{MINIUPNPC_ROOT})
# PATH_SUFFIXES miniupnpc) # PATH_SUFFIXES miniupnpc)
FIND_PATH(MINIUPNP_INCLUDE_DIR miniupnpc.h FIND_PATH(MINIUPNP_INCLUDE_DIR miniupnpc.h
${MINIUPNPC_DIR_SEARCH}/include/miniupnpc PATHS ${MINIUPNPC_DIR_SEARCH}/include
/usr/include/miniupnpc /usr/include
/usr/local/include/miniupnpc) /usr/local/include
PATH_SUFFIXES miniupnpc)
#message(STATUS "Finding miniupnpc.h result: ${MINIUPNP_INCLUDE_DIR}") #message(STATUS "Finding miniupnpc.h result: ${MINIUPNP_INCLUDE_DIR}")
@@ -58,13 +59,12 @@ FIND_LIBRARY(MINIUPNP_LIBRARY NAMES ${MINIUPNPC_LIBRARY_NAMES})
#message(STATUS "Finding miniupnpc lib result: ${MINIUPNP_LIBRARY}") #message(STATUS "Finding miniupnpc lib result: ${MINIUPNP_LIBRARY}")
if (MINIUPNP_INCLUDE_DIR AND MINIUPNP_LIBRARY) include(FindPackageHandleStandardArgs)
set (MINIUPNP_FOUND TRUE) FIND_PACKAGE_HANDLE_STANDARD_ARGS(MINIUPNP REQUIRED_VARS MINIUPNP_LIBRARY MINIUPNP_INCLUDE_DIR)
endif ()
if (MINIUPNP_FOUND) if (MINIUPNP_FOUND)
if (NOT MINIUPNP_FIND_QUIETLY) if (NOT MINIUPNP_FIND_QUIETLY)
message (STATUS "Found the miniupnpc libraries at ${MINIUPNP_LIBRARY}") #message (STATUS "Found the miniupnpc libraries at ${MINIUPNP_LIBRARY}")
message (STATUS "Found the miniupnpc headers at ${MINIUPNP_INCLUDE_DIR}") message (STATUS "Found the miniupnpc headers at ${MINIUPNP_INCLUDE_DIR}")
endif (NOT MINIUPNP_FIND_QUIETLY) endif (NOT MINIUPNP_FIND_QUIETLY)

View File

@@ -145,14 +145,18 @@ detect_system
echo 'We have detected the following system:' echo 'We have detected the following system:'
echo ' [ '"$distribution"' ] [ '"$release"' ] [ '"$codename"' ] [ '"$architecture"' ]' echo ' [ '"$distribution"' ] [ '"$release"' ] [ '"$codename"' ] [ '"$architecture"' ]'
EXTRA_CMAKE_OPTIONS="${EXTRA_CMAKE_OPTIONS} -DSTATIC_FONTCONFIG=OFF" if [ "$WANT_STATIC_LIBS" = "-DWANT_STATIC_LIBS=ON" ]; then
EXTRA_CMAKE_OPTIONS="${EXTRA_CMAKE_OPTIONS} -DSTATIC_FONTCONFIG=OFF"
fi
case $distribution in case $distribution in
Debian) Debian)
case $release in case $release in
6.*|7.*) ;; 6.*|7.*) ;;
*) *)
echo 'Turning ON dynamic FTGL, LUA, JPEG, PNG ... and forcing use the embedded IRCCLIENT' if [ "$WANT_STATIC_LIBS" = "-DWANT_STATIC_LIBS=ON" ]; then
EXTRA_CMAKE_OPTIONS="${EXTRA_CMAKE_OPTIONS} -DSTATIC_FTGL=OFF -DSTATIC_LUA=OFF -DSTATIC_JPEG=OFF -DSTATIC_PNG=OFF -DSTATIC_OGG=OFF -DFORCE_USE_EMBEDDED_Ircclient=ON" echo 'Turning ON dynamic FTGL, LUA, JPEG, PNG ... and forcing use the embedded IRCCLIENT'
EXTRA_CMAKE_OPTIONS="${EXTRA_CMAKE_OPTIONS} -DSTATIC_FTGL=OFF -DSTATIC_LUA=OFF -DSTATIC_JPEG=OFF -DSTATIC_PNG=OFF -DSTATIC_OGG=OFF -DFORCE_USE_EMBEDDED_Ircclient=ON"
fi
if [ $CLANG_FORCED = 1 ]; then BUILD_MEGAGLEST_TESTS="OFF"; fi if [ $CLANG_FORCED = 1 ]; then BUILD_MEGAGLEST_TESTS="OFF"; fi
;; ;;
esac esac
@@ -162,9 +166,10 @@ case $distribution in
case $release in case $release in
10.*|11.*|12.*|13.*|14.*) ;; 10.*|11.*|12.*|13.*|14.*) ;;
*) *)
echo 'Turning ON dynamic FTGL, LUA, JPEG, PNG ... and forcing use the embedded IRCCLIENT' if [ "$WANT_STATIC_LIBS" = "-DWANT_STATIC_LIBS=ON" ]; then
EXTRA_CMAKE_OPTIONS="${EXTRA_CMAKE_OPTIONS} -DSTATIC_FTGL=OFF -DSTATIC_LUA=OFF -DSTATIC_JPEG=OFF -DSTATIC_PNG=OFF -DSTATIC_OGG=OFF -DFORCE_USE_EMBEDDED_Ircclient=ON" echo 'Turning ON dynamic FTGL, LUA, JPEG, PNG ... and forcing use the embedded IRCCLIENT'
;; EXTRA_CMAKE_OPTIONS="${EXTRA_CMAKE_OPTIONS} -DSTATIC_FTGL=OFF -DSTATIC_LUA=OFF -DSTATIC_JPEG=OFF -DSTATIC_PNG=OFF -DSTATIC_OGG=OFF -DFORCE_USE_EMBEDDED_Ircclient=ON"
fi;;
esac esac
;; ;;
@@ -172,33 +177,36 @@ case $distribution in
case $release in case $release in
13|13.*|14|15|16|17|17.*) ;; 13|13.*|14|15|16|17|17.*) ;;
*) *)
echo 'Turning ON dynamic FTGL, LUA, JPEG, PNG ... and forcing use the embedded IRCCLIENT' if [ "$WANT_STATIC_LIBS" = "-DWANT_STATIC_LIBS=ON" ]; then
EXTRA_CMAKE_OPTIONS="${EXTRA_CMAKE_OPTIONS} -DSTATIC_FTGL=OFF -DSTATIC_LUA=OFF -DSTATIC_JPEG=OFF -DSTATIC_PNG=OFF -DSTATIC_OGG=OFF -DFORCE_USE_EMBEDDED_Ircclient=ON" echo 'Turning ON dynamic FTGL, LUA, JPEG, PNG ... and forcing use the embedded IRCCLIENT'
;; EXTRA_CMAKE_OPTIONS="${EXTRA_CMAKE_OPTIONS} -DSTATIC_FTGL=OFF -DSTATIC_LUA=OFF -DSTATIC_JPEG=OFF -DSTATIC_PNG=OFF -DSTATIC_OGG=OFF -DFORCE_USE_EMBEDDED_Ircclient=ON"
fi;;
esac esac
;; ;;
SuSE|SUSE?LINUX|Opensuse) SuSE|SUSE?LINUX|Opensuse)
case $release in case $release in
*) *)
echo 'Turning ON dynamic CURL ...' if [ "$WANT_STATIC_LIBS" = "-DWANT_STATIC_LIBS=ON" ]; then
EXTRA_CMAKE_OPTIONS="${EXTRA_CMAKE_OPTIONS} -DSTATIC_CURL=OFF" echo 'Turning ON dynamic CURL ...'
;; EXTRA_CMAKE_OPTIONS="${EXTRA_CMAKE_OPTIONS} -DSTATIC_CURL=OFF"
fi;;
esac esac
;; ;;
Fedora) Fedora)
case $release in case $release in
*) *)
echo 'Turning ON dynamic CURL ...' if [ "$WANT_STATIC_LIBS" = "-DWANT_STATIC_LIBS=ON" ]; then
EXTRA_CMAKE_OPTIONS="${EXTRA_CMAKE_OPTIONS} -DSTATIC_CURL=OFF" echo 'Turning ON dynamic CURL ...'
;; EXTRA_CMAKE_OPTIONS="${EXTRA_CMAKE_OPTIONS} -DSTATIC_CURL=OFF"
fi;;
esac esac
;; ;;
Arch) Arch)
echo 'Turning ON dynamic LIBS ...' echo 'Turning ON dynamic LIBS ...'
EXTRA_CMAKE_OPTIONS="${EXTRA_CMAKE_OPTIONS} -DWANT_STATIC_LIBS=OFF" WANT_STATIC_LIBS="-DWANT_STATIC_LIBS=OFF"
;; ;;
esac esac

View File

@@ -139,8 +139,10 @@ architecture="$(uname -m)"
echo 'We have detected the following system:' echo 'We have detected the following system:'
echo " [ $distribution ] [ $release ] [ $architecture ] [ $xcode_ver ]" echo " [ $distribution ] [ $release ] [ $architecture ] [ $xcode_ver ]"
case $release in case $release in
*) echo 'Turning ON dynamic PNG ...' *) if [ "$WANT_STATIC_LIBS" = "-DWANT_STATIC_LIBS=ON" ]; then
EXTRA_CMAKE_OPTIONS="${EXTRA_CMAKE_OPTIONS} -DSTATIC_PNG=OFF";; echo 'Turning ON dynamic PNG ...'
EXTRA_CMAKE_OPTIONS="${EXTRA_CMAKE_OPTIONS} -DSTATIC_PNG=OFF -DWANT_USE_VLC=OFF"
fi;;
esac esac
case $xcode_ver in case $xcode_ver in
# en.wikipedia.org/wiki/Xcode, Version, OS X SDK(s) <- lowest, but not less than 10.4 # en.wikipedia.org/wiki/Xcode, Version, OS X SDK(s) <- lowest, but not less than 10.4
@@ -229,10 +231,10 @@ else
echo 'Mini test:' echo 'Mini test:'
echo '>>> megaglest --version' echo '>>> megaglest --version'
./megaglest --version | head -3 ./megaglest --version | head -3
echo '>>> megaglest_editor --help' #echo '>>> megaglest_editor --help'
./megaglest_editor --help | head -3 #./megaglest_editor --help | head -3
echo '>>> megaglest_g3dviewer --help' #echo '>>> megaglest_g3dviewer --help'
./megaglest_g3dviewer --help | head -3 #./megaglest_g3dviewer --help | head -3
echo 'Dependencies:' echo 'Dependencies:'
otool -L megaglest otool -L megaglest
echo '- - - - - - - - - - - - - - - - - - - -' echo '- - - - - - - - - - - - - - - - - - - -'

View File

@@ -159,7 +159,8 @@ IF(BUILD_MEGAGLEST_MODEL_VIEWER)
TARGET_LINK_LIBRARIES(${TARGET_NAME} libmegaglest) TARGET_LINK_LIBRARIES(${TARGET_NAME} libmegaglest)
TARGET_LINK_LIBRARIES(${TARGET_NAME} ${EXTERNAL_LIBS}) TARGET_LINK_LIBRARIES(${TARGET_NAME} ${EXTERNAL_LIBS})
IF(EXISTS ${HELP2MAN}) IF(EXISTS ${HELP2MAN} AND NOT APPLE)
# on mac <> --help sometimes hangs, so we need "NOT APPLE" ^ or some timeout here for now
MESSAGE(STATUS "***-- Found help2man: ${HELP2MAN} about to build manpage in [${HELP2MAN_OUT_PATH}${TARGET_NAME_MANPAGE}]") MESSAGE(STATUS "***-- Found help2man: ${HELP2MAN} about to build manpage in [${HELP2MAN_OUT_PATH}${TARGET_NAME_MANPAGE}]")
SET(MG_MANPAGE_DESCRIPTION "G3D Model editor for the popular 3D realtime strategy game") SET(MG_MANPAGE_DESCRIPTION "G3D Model editor for the popular 3D realtime strategy game")
@@ -184,7 +185,7 @@ IF(BUILD_MEGAGLEST_MODEL_VIEWER)
${TARGET_NAME} ${TARGET_NAME}
DESTINATION ${MEGAGLEST_BIN_INSTALL_PATH}) DESTINATION ${MEGAGLEST_BIN_INSTALL_PATH})
IF(EXISTS ${HELP2MAN}) IF(EXISTS ${HELP2MAN} AND EXISTS ${HELP2MAN_OUT_PATH}${TARGET_NAME_MANPAGE})
MESSAGE(STATUS "**NOTE: Will Install manpage [${TARGET_NAME_MANPAGE}] to [${MEGAGLEST_MANPAGE_INSTALL_PATH}]") MESSAGE(STATUS "**NOTE: Will Install manpage [${TARGET_NAME_MANPAGE}] to [${MEGAGLEST_MANPAGE_INSTALL_PATH}]")
# Installation of the program manpage file # Installation of the program manpage file

View File

@@ -152,7 +152,8 @@ IF(BUILD_MEGAGLEST_MAP_EDITOR)
TARGET_LINK_LIBRARIES(${TARGET_NAME} libmegaglest) TARGET_LINK_LIBRARIES(${TARGET_NAME} libmegaglest)
TARGET_LINK_LIBRARIES(${TARGET_NAME} ${EXTERNAL_LIBS}) TARGET_LINK_LIBRARIES(${TARGET_NAME} ${EXTERNAL_LIBS})
IF(EXISTS ${HELP2MAN}) IF(EXISTS ${HELP2MAN} AND NOT APPLE)
# on mac <> --help sometimes hangs, so we need "NOT APPLE" ^ or some timeout here for now
MESSAGE(STATUS "***-- Found help2man: ${HELP2MAN} about to build manpage in [${HELP2MAN_OUT_PATH}${TARGET_NAME_MANPAGE}]") MESSAGE(STATUS "***-- Found help2man: ${HELP2MAN} about to build manpage in [${HELP2MAN_OUT_PATH}${TARGET_NAME_MANPAGE}]")
SET(MG_MANPAGE_DESCRIPTION "Map editor for the popular 3D realtime strategy game") SET(MG_MANPAGE_DESCRIPTION "Map editor for the popular 3D realtime strategy game")
@@ -177,7 +178,7 @@ IF(BUILD_MEGAGLEST_MAP_EDITOR)
${TARGET_NAME} ${TARGET_NAME}
DESTINATION ${MEGAGLEST_BIN_INSTALL_PATH}) DESTINATION ${MEGAGLEST_BIN_INSTALL_PATH})
IF(EXISTS ${HELP2MAN}) IF(EXISTS ${HELP2MAN} AND EXISTS ${HELP2MAN_OUT_PATH}${TARGET_NAME_MANPAGE})
MESSAGE(STATUS "**NOTE: Will Install manpage [${TARGET_NAME_MANPAGE}] to [${MEGAGLEST_MANPAGE_INSTALL_PATH}]") MESSAGE(STATUS "**NOTE: Will Install manpage [${TARGET_NAME_MANPAGE}] to [${MEGAGLEST_MANPAGE_INSTALL_PATH}]")
# Installation of the program manpage file # Installation of the program manpage file