|
|
@ -4,7 +4,7 @@ SET(CMAKE_TRY_COMPILE_CONFIGURATION "Release")
|
|
|
|
# Force Release configuration by default
|
|
|
|
# Force Release configuration by default
|
|
|
|
IF(NOT CMAKE_BUILD_TYPE)
|
|
|
|
IF(NOT CMAKE_BUILD_TYPE)
|
|
|
|
SET(CMAKE_BUILD_TYPE "Release" CACHE STRING "" FORCE)
|
|
|
|
SET(CMAKE_BUILD_TYPE "Release" CACHE STRING "" FORCE)
|
|
|
|
ENDIF(NOT CMAKE_BUILD_TYPE)
|
|
|
|
ENDIF()
|
|
|
|
|
|
|
|
|
|
|
|
# Declare CMAKE_CONFIGURATION_TYPES before PROJECT
|
|
|
|
# Declare CMAKE_CONFIGURATION_TYPES before PROJECT
|
|
|
|
SET(CMAKE_CONFIGURATION_TYPES "Debug;Release" CACHE STRING "" FORCE)
|
|
|
|
SET(CMAKE_CONFIGURATION_TYPES "Debug;Release" CACHE STRING "" FORCE)
|
|
|
@ -17,7 +17,7 @@ MACRO(NL_GEN_PC name)
|
|
|
|
IF(NOT WIN32 AND WITH_INSTALL_LIBRARIES)
|
|
|
|
IF(NOT WIN32 AND WITH_INSTALL_LIBRARIES)
|
|
|
|
CONFIGURE_FILE(${name}.in "${CMAKE_CURRENT_BINARY_DIR}/${name}")
|
|
|
|
CONFIGURE_FILE(${name}.in "${CMAKE_CURRENT_BINARY_DIR}/${name}")
|
|
|
|
INSTALL(FILES "${CMAKE_CURRENT_BINARY_DIR}/${name}" DESTINATION ${NL_LIB_PREFIX}/pkgconfig)
|
|
|
|
INSTALL(FILES "${CMAKE_CURRENT_BINARY_DIR}/${name}" DESTINATION ${NL_LIB_PREFIX}/pkgconfig)
|
|
|
|
ENDIF(NOT WIN32 AND WITH_INSTALL_LIBRARIES)
|
|
|
|
ENDIF()
|
|
|
|
ENDMACRO(NL_GEN_PC)
|
|
|
|
ENDMACRO(NL_GEN_PC)
|
|
|
|
|
|
|
|
|
|
|
|
###
|
|
|
|
###
|
|
|
@ -26,9 +26,9 @@ ENDMACRO(NL_GEN_PC)
|
|
|
|
MACRO(NL_TARGET_LIB name)
|
|
|
|
MACRO(NL_TARGET_LIB name)
|
|
|
|
IF(WITH_STATIC)
|
|
|
|
IF(WITH_STATIC)
|
|
|
|
ADD_LIBRARY(${name} STATIC ${ARGN})
|
|
|
|
ADD_LIBRARY(${name} STATIC ${ARGN})
|
|
|
|
ELSE(WITH_STATIC)
|
|
|
|
ELSE()
|
|
|
|
ADD_LIBRARY(${name} SHARED ${ARGN})
|
|
|
|
ADD_LIBRARY(${name} SHARED ${ARGN})
|
|
|
|
ENDIF(WITH_STATIC)
|
|
|
|
ENDIF()
|
|
|
|
ENDMACRO(NL_TARGET_LIB)
|
|
|
|
ENDMACRO(NL_TARGET_LIB)
|
|
|
|
|
|
|
|
|
|
|
|
###
|
|
|
|
###
|
|
|
@ -37,9 +37,9 @@ ENDMACRO(NL_TARGET_LIB)
|
|
|
|
MACRO(NL_TARGET_DRIVER name)
|
|
|
|
MACRO(NL_TARGET_DRIVER name)
|
|
|
|
IF(WITH_STATIC_DRIVERS)
|
|
|
|
IF(WITH_STATIC_DRIVERS)
|
|
|
|
ADD_LIBRARY(${name} STATIC ${ARGN})
|
|
|
|
ADD_LIBRARY(${name} STATIC ${ARGN})
|
|
|
|
ELSE(WITH_STATIC_DRIVERS)
|
|
|
|
ELSE()
|
|
|
|
ADD_LIBRARY(${name} MODULE ${ARGN})
|
|
|
|
ADD_LIBRARY(${name} MODULE ${ARGN})
|
|
|
|
ENDIF(WITH_STATIC_DRIVERS)
|
|
|
|
ENDIF()
|
|
|
|
ENDMACRO(NL_TARGET_DRIVER)
|
|
|
|
ENDMACRO(NL_TARGET_DRIVER)
|
|
|
|
|
|
|
|
|
|
|
|
###
|
|
|
|
###
|
|
|
@ -64,8 +64,8 @@ MACRO(NL_DEFAULT_PROPS name label)
|
|
|
|
VERSION ${NL_VERSION} SOVERSION ${NL_VERSION_MAJOR})
|
|
|
|
VERSION ${NL_VERSION} SOVERSION ${NL_VERSION_MAJOR})
|
|
|
|
IF(NL_LIB_PREFIX)
|
|
|
|
IF(NL_LIB_PREFIX)
|
|
|
|
SET_TARGET_PROPERTIES(${name} PROPERTIES INSTALL_NAME_DIR ${NL_LIB_PREFIX})
|
|
|
|
SET_TARGET_PROPERTIES(${name} PROPERTIES INSTALL_NAME_DIR ${NL_LIB_PREFIX})
|
|
|
|
ENDIF(NL_LIB_PREFIX)
|
|
|
|
ENDIF()
|
|
|
|
ENDIF(${type} STREQUAL SHARED_LIBRARY)
|
|
|
|
ENDIF()
|
|
|
|
|
|
|
|
|
|
|
|
IF(${type} STREQUAL EXECUTABLE AND WIN32 AND NOT MINGW)
|
|
|
|
IF(${type} STREQUAL EXECUTABLE AND WIN32 AND NOT MINGW)
|
|
|
|
# check if using a GUI
|
|
|
|
# check if using a GUI
|
|
|
@ -92,7 +92,7 @@ MACRO(NL_DEFAULT_PROPS name label)
|
|
|
|
SOVERSION ${NL_VERSION_MAJOR}
|
|
|
|
SOVERSION ${NL_VERSION_MAJOR}
|
|
|
|
COMPILE_FLAGS "/GA"
|
|
|
|
COMPILE_FLAGS "/GA"
|
|
|
|
LINK_FLAGS "/VERSION:${NL_VERSION_MAJOR}.${NL_VERSION_MINOR} /SUBSYSTEM:${_SUBSYSTEM},${_SUBSYSTEM_VERSION}")
|
|
|
|
LINK_FLAGS "/VERSION:${NL_VERSION_MAJOR}.${NL_VERSION_MINOR} /SUBSYSTEM:${_SUBSYSTEM},${_SUBSYSTEM_VERSION}")
|
|
|
|
ENDIF(${type} STREQUAL EXECUTABLE AND WIN32 AND NOT MINGW)
|
|
|
|
ENDIF()
|
|
|
|
ENDMACRO(NL_DEFAULT_PROPS)
|
|
|
|
ENDMACRO(NL_DEFAULT_PROPS)
|
|
|
|
|
|
|
|
|
|
|
|
###
|
|
|
|
###
|
|
|
@ -102,7 +102,7 @@ ENDMACRO(NL_DEFAULT_PROPS)
|
|
|
|
MACRO(NL_ADD_LIB_SUFFIX name)
|
|
|
|
MACRO(NL_ADD_LIB_SUFFIX name)
|
|
|
|
IF(WIN32)
|
|
|
|
IF(WIN32)
|
|
|
|
SET_TARGET_PROPERTIES(${name} PROPERTIES DEBUG_POSTFIX "_d" RELEASE_POSTFIX "_r")
|
|
|
|
SET_TARGET_PROPERTIES(${name} PROPERTIES DEBUG_POSTFIX "_d" RELEASE_POSTFIX "_r")
|
|
|
|
ENDIF(WIN32)
|
|
|
|
ENDIF()
|
|
|
|
ENDMACRO(NL_ADD_LIB_SUFFIX)
|
|
|
|
ENDMACRO(NL_ADD_LIB_SUFFIX)
|
|
|
|
|
|
|
|
|
|
|
|
###
|
|
|
|
###
|
|
|
@ -114,10 +114,10 @@ MACRO(NL_ADD_RUNTIME_FLAGS name)
|
|
|
|
# SET_TARGET_PROPERTIES(${name} PROPERTIES
|
|
|
|
# SET_TARGET_PROPERTIES(${name} PROPERTIES
|
|
|
|
# LINK_FLAGS_DEBUG "${CMAKE_LINK_FLAGS_DEBUG}"
|
|
|
|
# LINK_FLAGS_DEBUG "${CMAKE_LINK_FLAGS_DEBUG}"
|
|
|
|
# LINK_FLAGS_RELEASE "${CMAKE_LINK_FLAGS_RELEASE}")
|
|
|
|
# LINK_FLAGS_RELEASE "${CMAKE_LINK_FLAGS_RELEASE}")
|
|
|
|
ENDIF(WIN32)
|
|
|
|
ENDIF()
|
|
|
|
IF(WITH_STLPORT)
|
|
|
|
IF(WITH_STLPORT)
|
|
|
|
TARGET_LINK_LIBRARIES(${name} ${STLPORT_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
|
|
|
|
TARGET_LINK_LIBRARIES(${name} ${STLPORT_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
|
|
|
|
ENDIF(WITH_STLPORT)
|
|
|
|
ENDIF()
|
|
|
|
ENDMACRO(NL_ADD_RUNTIME_FLAGS)
|
|
|
|
ENDMACRO(NL_ADD_RUNTIME_FLAGS)
|
|
|
|
|
|
|
|
|
|
|
|
MACRO(NL_ADD_STATIC_VID_DRIVERS name)
|
|
|
|
MACRO(NL_ADD_STATIC_VID_DRIVERS name)
|
|
|
@ -125,25 +125,25 @@ MACRO(NL_ADD_STATIC_VID_DRIVERS name)
|
|
|
|
IF(WIN32)
|
|
|
|
IF(WIN32)
|
|
|
|
IF(WITH_DRIVER_DIRECT3D)
|
|
|
|
IF(WITH_DRIVER_DIRECT3D)
|
|
|
|
TARGET_LINK_LIBRARIES(${name} nel_drv_direct3d_win)
|
|
|
|
TARGET_LINK_LIBRARIES(${name} nel_drv_direct3d_win)
|
|
|
|
ENDIF(WITH_DRIVER_DIRECT3D)
|
|
|
|
ENDIF()
|
|
|
|
ENDIF(WIN32)
|
|
|
|
ENDIF()
|
|
|
|
|
|
|
|
|
|
|
|
IF(WITH_DRIVER_OPENGL)
|
|
|
|
IF(WITH_DRIVER_OPENGL)
|
|
|
|
IF(WIN32)
|
|
|
|
IF(WIN32)
|
|
|
|
TARGET_LINK_LIBRARIES(${name} nel_drv_opengl_win)
|
|
|
|
TARGET_LINK_LIBRARIES(${name} nel_drv_opengl_win)
|
|
|
|
ELSE(WIN32)
|
|
|
|
ELSE()
|
|
|
|
TARGET_LINK_LIBRARIES(${name} nel_drv_opengl)
|
|
|
|
TARGET_LINK_LIBRARIES(${name} nel_drv_opengl)
|
|
|
|
ENDIF(WIN32)
|
|
|
|
ENDIF()
|
|
|
|
ENDIF(WITH_DRIVER_OPENGL)
|
|
|
|
ENDIF()
|
|
|
|
|
|
|
|
|
|
|
|
IF(WITH_DRIVER_OPENGLES)
|
|
|
|
IF(WITH_DRIVER_OPENGLES)
|
|
|
|
IF(WIN32)
|
|
|
|
IF(WIN32)
|
|
|
|
TARGET_LINK_LIBRARIES(${name} nel_drv_opengles_win)
|
|
|
|
TARGET_LINK_LIBRARIES(${name} nel_drv_opengles_win)
|
|
|
|
ELSE(WIN32)
|
|
|
|
ELSE()
|
|
|
|
TARGET_LINK_LIBRARIES(${name} nel_drv_opengles)
|
|
|
|
TARGET_LINK_LIBRARIES(${name} nel_drv_opengles)
|
|
|
|
ENDIF(WIN32)
|
|
|
|
ENDIF()
|
|
|
|
ENDIF(WITH_DRIVER_OPENGLES)
|
|
|
|
ENDIF()
|
|
|
|
ENDIF(WITH_STATIC_DRIVERS)
|
|
|
|
ENDIF()
|
|
|
|
ENDMACRO(NL_ADD_STATIC_VID_DRIVERS)
|
|
|
|
ENDMACRO(NL_ADD_STATIC_VID_DRIVERS)
|
|
|
|
|
|
|
|
|
|
|
|
MACRO(NL_ADD_STATIC_SND_DRIVERS name)
|
|
|
|
MACRO(NL_ADD_STATIC_SND_DRIVERS name)
|
|
|
@ -151,30 +151,30 @@ MACRO(NL_ADD_STATIC_SND_DRIVERS name)
|
|
|
|
IF(WIN32)
|
|
|
|
IF(WIN32)
|
|
|
|
IF(WITH_DRIVER_DSOUND)
|
|
|
|
IF(WITH_DRIVER_DSOUND)
|
|
|
|
TARGET_LINK_LIBRARIES(${name} nel_drv_dsound_win)
|
|
|
|
TARGET_LINK_LIBRARIES(${name} nel_drv_dsound_win)
|
|
|
|
ENDIF(WITH_DRIVER_DSOUND)
|
|
|
|
ENDIF()
|
|
|
|
|
|
|
|
|
|
|
|
IF(WITH_DRIVER_XAUDIO2)
|
|
|
|
IF(WITH_DRIVER_XAUDIO2)
|
|
|
|
TARGET_LINK_LIBRARIES(${name} nel_drv_xaudio2_win)
|
|
|
|
TARGET_LINK_LIBRARIES(${name} nel_drv_xaudio2_win)
|
|
|
|
ENDIF(WITH_DRIVER_XAUDIO2)
|
|
|
|
ENDIF()
|
|
|
|
|
|
|
|
|
|
|
|
IF(WITH_DRIVER_OPENAL)
|
|
|
|
IF(WITH_DRIVER_OPENAL)
|
|
|
|
TARGET_LINK_LIBRARIES(${name} nel_drv_openal_win)
|
|
|
|
TARGET_LINK_LIBRARIES(${name} nel_drv_openal_win)
|
|
|
|
ENDIF(WITH_DRIVER_OPENAL)
|
|
|
|
ENDIF()
|
|
|
|
|
|
|
|
|
|
|
|
IF(WITH_DRIVER_FMOD)
|
|
|
|
IF(WITH_DRIVER_FMOD)
|
|
|
|
TARGET_LINK_LIBRARIES(${name} nel_drv_fmod_win)
|
|
|
|
TARGET_LINK_LIBRARIES(${name} nel_drv_fmod_win)
|
|
|
|
ENDIF(WITH_DRIVER_FMOD)
|
|
|
|
ENDIF()
|
|
|
|
ELSE(WIN32)
|
|
|
|
ELSE()
|
|
|
|
IF(WITH_DRIVER_OPENAL)
|
|
|
|
IF(WITH_DRIVER_OPENAL)
|
|
|
|
TARGET_LINK_LIBRARIES(${name} nel_drv_openal)
|
|
|
|
TARGET_LINK_LIBRARIES(${name} nel_drv_openal)
|
|
|
|
ENDIF(WITH_DRIVER_OPENAL)
|
|
|
|
ENDIF()
|
|
|
|
|
|
|
|
|
|
|
|
IF(WITH_DRIVER_FMOD)
|
|
|
|
IF(WITH_DRIVER_FMOD)
|
|
|
|
TARGET_LINK_LIBRARIES(${name} nel_drv_fmod)
|
|
|
|
TARGET_LINK_LIBRARIES(${name} nel_drv_fmod)
|
|
|
|
ENDIF(WITH_DRIVER_FMOD)
|
|
|
|
ENDIF()
|
|
|
|
ENDIF(WIN32)
|
|
|
|
ENDIF()
|
|
|
|
|
|
|
|
|
|
|
|
ENDIF(WITH_STATIC_DRIVERS)
|
|
|
|
ENDIF()
|
|
|
|
ENDMACRO(NL_ADD_STATIC_SND_DRIVERS)
|
|
|
|
ENDMACRO(NL_ADD_STATIC_SND_DRIVERS)
|
|
|
|
|
|
|
|
|
|
|
|
###
|
|
|
|
###
|
|
|
@ -192,14 +192,14 @@ Remove the CMakeCache.txt file and try again from another folder, e.g.:
|
|
|
|
cd cmake
|
|
|
|
cd cmake
|
|
|
|
cmake ..
|
|
|
|
cmake ..
|
|
|
|
")
|
|
|
|
")
|
|
|
|
ENDIF(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
|
|
|
|
ENDIF()
|
|
|
|
|
|
|
|
|
|
|
|
ENDMACRO(CHECK_OUT_OF_SOURCE)
|
|
|
|
ENDMACRO(CHECK_OUT_OF_SOURCE)
|
|
|
|
|
|
|
|
|
|
|
|
MACRO(NL_SETUP_DEFAULT_OPTIONS)
|
|
|
|
MACRO(NL_SETUP_DEFAULT_OPTIONS)
|
|
|
|
IF(WITH_QT)
|
|
|
|
IF(WITH_QT)
|
|
|
|
OPTION(WITH_STUDIO "Build Core Studio" OFF )
|
|
|
|
OPTION(WITH_STUDIO "Build Core Studio" OFF )
|
|
|
|
ENDIF(WITH_QT)
|
|
|
|
ENDIF()
|
|
|
|
|
|
|
|
|
|
|
|
###
|
|
|
|
###
|
|
|
|
# Features
|
|
|
|
# Features
|
|
|
@ -213,30 +213,30 @@ MACRO(NL_SETUP_DEFAULT_OPTIONS)
|
|
|
|
# Default to static building on Windows.
|
|
|
|
# Default to static building on Windows.
|
|
|
|
IF(WIN32)
|
|
|
|
IF(WIN32)
|
|
|
|
OPTION(WITH_STATIC "With static libraries." ON )
|
|
|
|
OPTION(WITH_STATIC "With static libraries." ON )
|
|
|
|
ELSE(WIN32)
|
|
|
|
ELSE()
|
|
|
|
OPTION(WITH_STATIC "With static libraries." OFF)
|
|
|
|
OPTION(WITH_STATIC "With static libraries." OFF)
|
|
|
|
ENDIF(WIN32)
|
|
|
|
ENDIF()
|
|
|
|
IF (WITH_STATIC)
|
|
|
|
IF (WITH_STATIC)
|
|
|
|
OPTION(WITH_STATIC_LIBXML2 "With static libxml2" ON )
|
|
|
|
OPTION(WITH_STATIC_LIBXML2 "With static libxml2" ON )
|
|
|
|
ELSE(WITH_STATIC)
|
|
|
|
ELSE()
|
|
|
|
OPTION(WITH_STATIC_LIBXML2 "With static libxml2" OFF)
|
|
|
|
OPTION(WITH_STATIC_LIBXML2 "With static libxml2" OFF)
|
|
|
|
ENDIF(WITH_STATIC)
|
|
|
|
ENDIF()
|
|
|
|
IF (WITH_STATIC)
|
|
|
|
IF (WITH_STATIC)
|
|
|
|
OPTION(WITH_STATIC_CURL "With static curl" ON )
|
|
|
|
OPTION(WITH_STATIC_CURL "With static curl" ON )
|
|
|
|
ELSE(WITH_STATIC)
|
|
|
|
ELSE()
|
|
|
|
OPTION(WITH_STATIC_CURL "With static curl" OFF)
|
|
|
|
OPTION(WITH_STATIC_CURL "With static curl" OFF)
|
|
|
|
ENDIF(WITH_STATIC)
|
|
|
|
ENDIF()
|
|
|
|
IF(APPLE)
|
|
|
|
IF(APPLE)
|
|
|
|
OPTION(WITH_LIBXML2_ICONV "With libxml2 using iconv" ON )
|
|
|
|
OPTION(WITH_LIBXML2_ICONV "With libxml2 using iconv" ON )
|
|
|
|
ELSE(APPLE)
|
|
|
|
ELSE()
|
|
|
|
OPTION(WITH_LIBXML2_ICONV "With libxml2 using iconv" OFF)
|
|
|
|
OPTION(WITH_LIBXML2_ICONV "With libxml2 using iconv" OFF)
|
|
|
|
ENDIF(APPLE)
|
|
|
|
ENDIF()
|
|
|
|
OPTION(WITH_STATIC_DRIVERS "With static drivers." OFF)
|
|
|
|
OPTION(WITH_STATIC_DRIVERS "With static drivers." OFF)
|
|
|
|
IF(WIN32)
|
|
|
|
IF(WIN32)
|
|
|
|
OPTION(WITH_EXTERNAL "With provided external." ON )
|
|
|
|
OPTION(WITH_EXTERNAL "With provided external." ON )
|
|
|
|
ELSE(WIN32)
|
|
|
|
ELSE()
|
|
|
|
OPTION(WITH_EXTERNAL "With provided external." OFF)
|
|
|
|
OPTION(WITH_EXTERNAL "With provided external." OFF)
|
|
|
|
ENDIF(WIN32)
|
|
|
|
ENDIF()
|
|
|
|
OPTION(WITH_STATIC_EXTERNAL "With static external libraries" OFF)
|
|
|
|
OPTION(WITH_STATIC_EXTERNAL "With static external libraries" OFF)
|
|
|
|
IF(UNIX AND NOT APPLE)
|
|
|
|
IF(UNIX AND NOT APPLE)
|
|
|
|
OPTION(WITH_UNIX_STRUCTURE "Use UNIX structure (bin, include, lib)" ON )
|
|
|
|
OPTION(WITH_UNIX_STRUCTURE "Use UNIX structure (bin, include, lib)" ON )
|
|
|
@ -256,9 +256,9 @@ MACRO(NL_SETUP_DEFAULT_OPTIONS)
|
|
|
|
|
|
|
|
|
|
|
|
IF(WIN32 AND MFC_FOUND)
|
|
|
|
IF(WIN32 AND MFC_FOUND)
|
|
|
|
OPTION(WITH_MFC "With MFC Support" ON )
|
|
|
|
OPTION(WITH_MFC "With MFC Support" ON )
|
|
|
|
ELSE(WIN32 AND MFC_FOUND)
|
|
|
|
ELSE()
|
|
|
|
OPTION(WITH_MFC "With MFC Support" OFF)
|
|
|
|
OPTION(WITH_MFC "With MFC Support" OFF)
|
|
|
|
ENDIF(WIN32 AND MFC_FOUND)
|
|
|
|
ENDIF()
|
|
|
|
|
|
|
|
|
|
|
|
###
|
|
|
|
###
|
|
|
|
# Optional support
|
|
|
|
# Optional support
|
|
|
@ -323,7 +323,7 @@ MACRO(NL_SETUP_NEL_DEFAULT_OPTIONS)
|
|
|
|
|
|
|
|
|
|
|
|
IF(NOT MSVC)
|
|
|
|
IF(NOT MSVC)
|
|
|
|
OPTION(WITH_GCC_FPMATH_BOTH "With GCC -mfpmath=both" OFF)
|
|
|
|
OPTION(WITH_GCC_FPMATH_BOTH "With GCC -mfpmath=both" OFF)
|
|
|
|
ENDIF(NOT MSVC)
|
|
|
|
ENDIF()
|
|
|
|
ENDMACRO(NL_SETUP_NEL_DEFAULT_OPTIONS)
|
|
|
|
ENDMACRO(NL_SETUP_NEL_DEFAULT_OPTIONS)
|
|
|
|
|
|
|
|
|
|
|
|
MACRO(NL_SETUP_NELNS_DEFAULT_OPTIONS)
|
|
|
|
MACRO(NL_SETUP_NELNS_DEFAULT_OPTIONS)
|
|
|
@ -380,15 +380,15 @@ MACRO(NL_SETUP_BUILD)
|
|
|
|
|
|
|
|
|
|
|
|
IF(CMAKE_BUILD_TYPE MATCHES "Debug")
|
|
|
|
IF(CMAKE_BUILD_TYPE MATCHES "Debug")
|
|
|
|
SET(NL_BUILD_MODE "NL_DEBUG")
|
|
|
|
SET(NL_BUILD_MODE "NL_DEBUG")
|
|
|
|
ELSE(CMAKE_BUILD_TYPE MATCHES "Debug")
|
|
|
|
ELSE()
|
|
|
|
IF(CMAKE_BUILD_TYPE MATCHES "Release")
|
|
|
|
IF(CMAKE_BUILD_TYPE MATCHES "Release")
|
|
|
|
SET(NL_BUILD_MODE "NL_RELEASE")
|
|
|
|
SET(NL_BUILD_MODE "NL_RELEASE")
|
|
|
|
ELSE(CMAKE_BUILD_TYPE MATCHES "Release")
|
|
|
|
ELSE()
|
|
|
|
SET(NL_BUILD_MODE "NL_RELEASE")
|
|
|
|
SET(NL_BUILD_MODE "NL_RELEASE")
|
|
|
|
# enforce release mode if it's neither Debug nor Release
|
|
|
|
# enforce release mode if it's neither Debug nor Release
|
|
|
|
SET(CMAKE_BUILD_TYPE "Release" CACHE STRING "" FORCE)
|
|
|
|
SET(CMAKE_BUILD_TYPE "Release" CACHE STRING "" FORCE)
|
|
|
|
ENDIF(CMAKE_BUILD_TYPE MATCHES "Release")
|
|
|
|
ENDIF()
|
|
|
|
ENDIF(CMAKE_BUILD_TYPE MATCHES "Debug")
|
|
|
|
ENDIF()
|
|
|
|
|
|
|
|
|
|
|
|
SET(HOST_CPU ${CMAKE_HOST_SYSTEM_PROCESSOR})
|
|
|
|
SET(HOST_CPU ${CMAKE_HOST_SYSTEM_PROCESSOR})
|
|
|
|
|
|
|
|
|
|
|
@ -396,35 +396,35 @@ MACRO(NL_SETUP_BUILD)
|
|
|
|
SET(HOST_CPU "x86_64")
|
|
|
|
SET(HOST_CPU "x86_64")
|
|
|
|
ELSEIF(HOST_CPU MATCHES "i.86")
|
|
|
|
ELSEIF(HOST_CPU MATCHES "i.86")
|
|
|
|
SET(HOST_CPU "x86")
|
|
|
|
SET(HOST_CPU "x86")
|
|
|
|
ENDIF(HOST_CPU MATCHES "(amd|AMD)64")
|
|
|
|
ENDIF()
|
|
|
|
|
|
|
|
|
|
|
|
# Determine target CPU
|
|
|
|
# Determine target CPU
|
|
|
|
|
|
|
|
|
|
|
|
# If not specified, use the same CPU as host
|
|
|
|
# If not specified, use the same CPU as host
|
|
|
|
IF(NOT TARGET_CPU)
|
|
|
|
IF(NOT TARGET_CPU)
|
|
|
|
SET(TARGET_CPU ${CMAKE_SYSTEM_PROCESSOR})
|
|
|
|
SET(TARGET_CPU ${CMAKE_SYSTEM_PROCESSOR})
|
|
|
|
ENDIF(NOT TARGET_CPU)
|
|
|
|
ENDIF()
|
|
|
|
|
|
|
|
|
|
|
|
IF(TARGET_CPU MATCHES "(amd|AMD)64")
|
|
|
|
IF(TARGET_CPU MATCHES "(amd|AMD)64")
|
|
|
|
SET(TARGET_CPU "x86_64")
|
|
|
|
SET(TARGET_CPU "x86_64")
|
|
|
|
ELSEIF(TARGET_CPU MATCHES "i.86")
|
|
|
|
ELSEIF(TARGET_CPU MATCHES "i.86")
|
|
|
|
SET(TARGET_CPU "x86")
|
|
|
|
SET(TARGET_CPU "x86")
|
|
|
|
ENDIF(TARGET_CPU MATCHES "(amd|AMD)64")
|
|
|
|
ENDIF()
|
|
|
|
|
|
|
|
|
|
|
|
IF(${CMAKE_CXX_COMPILER_ID} MATCHES "Clang")
|
|
|
|
IF(${CMAKE_CXX_COMPILER_ID} MATCHES "Clang")
|
|
|
|
SET(CLANG ON)
|
|
|
|
SET(CLANG ON)
|
|
|
|
MESSAGE(STATUS "Using Clang compiler")
|
|
|
|
MESSAGE(STATUS "Using Clang compiler")
|
|
|
|
ENDIF(${CMAKE_CXX_COMPILER_ID} MATCHES "Clang")
|
|
|
|
ENDIF()
|
|
|
|
|
|
|
|
|
|
|
|
IF(CMAKE_GENERATOR MATCHES "Xcode")
|
|
|
|
IF(CMAKE_GENERATOR MATCHES "Xcode")
|
|
|
|
SET(XCODE ON)
|
|
|
|
SET(XCODE ON)
|
|
|
|
MESSAGE(STATUS "Generating Xcode project")
|
|
|
|
MESSAGE(STATUS "Generating Xcode project")
|
|
|
|
ENDIF(CMAKE_GENERATOR MATCHES "Xcode")
|
|
|
|
ENDIF()
|
|
|
|
|
|
|
|
|
|
|
|
IF(CMAKE_GENERATOR MATCHES "NMake")
|
|
|
|
IF(CMAKE_GENERATOR MATCHES "NMake")
|
|
|
|
SET(NMAKE ON)
|
|
|
|
SET(NMAKE ON)
|
|
|
|
MESSAGE(STATUS "Generating NMake project")
|
|
|
|
MESSAGE(STATUS "Generating NMake project")
|
|
|
|
ENDIF(CMAKE_GENERATOR MATCHES "NMake")
|
|
|
|
ENDIF()
|
|
|
|
|
|
|
|
|
|
|
|
# If target and host CPU are the same
|
|
|
|
# If target and host CPU are the same
|
|
|
|
IF("${HOST_CPU}" STREQUAL "${TARGET_CPU}" AND NOT CMAKE_CROSSCOMPILING)
|
|
|
|
IF("${HOST_CPU}" STREQUAL "${TARGET_CPU}" AND NOT CMAKE_CROSSCOMPILING)
|
|
|
@ -433,24 +433,24 @@ MACRO(NL_SETUP_BUILD)
|
|
|
|
IF(NOT CMAKE_SIZEOF_VOID_P)
|
|
|
|
IF(NOT CMAKE_SIZEOF_VOID_P)
|
|
|
|
INCLUDE (CheckTypeSize)
|
|
|
|
INCLUDE (CheckTypeSize)
|
|
|
|
CHECK_TYPE_SIZE("void*" CMAKE_SIZEOF_VOID_P)
|
|
|
|
CHECK_TYPE_SIZE("void*" CMAKE_SIZEOF_VOID_P)
|
|
|
|
ENDIF(NOT CMAKE_SIZEOF_VOID_P)
|
|
|
|
ENDIF()
|
|
|
|
|
|
|
|
|
|
|
|
# Using 32 or 64 bits libraries
|
|
|
|
# Using 32 or 64 bits libraries
|
|
|
|
IF(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
|
|
|
IF(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
|
|
|
SET(TARGET_CPU "x86_64")
|
|
|
|
SET(TARGET_CPU "x86_64")
|
|
|
|
ELSE(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
|
|
|
ELSE()
|
|
|
|
SET(TARGET_CPU "x86")
|
|
|
|
SET(TARGET_CPU "x86")
|
|
|
|
ENDIF(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
|
|
|
ENDIF()
|
|
|
|
ELSEIF(HOST_CPU MATCHES "arm")
|
|
|
|
ELSEIF(HOST_CPU MATCHES "arm")
|
|
|
|
SET(TARGET_CPU "arm")
|
|
|
|
SET(TARGET_CPU "arm")
|
|
|
|
ELSE(HOST_CPU MATCHES "x86")
|
|
|
|
ELSE()
|
|
|
|
SET(TARGET_CPU "unknown")
|
|
|
|
SET(TARGET_CPU "unknown")
|
|
|
|
MESSAGE(STATUS "Unknown architecture: ${HOST_CPU}")
|
|
|
|
MESSAGE(STATUS "Unknown architecture: ${HOST_CPU}")
|
|
|
|
ENDIF(HOST_CPU MATCHES "x86")
|
|
|
|
ENDIF()
|
|
|
|
# TODO: add checks for PPC
|
|
|
|
# TODO: add checks for PPC
|
|
|
|
ELSE("${HOST_CPU}" STREQUAL "${TARGET_CPU}" AND NOT CMAKE_CROSSCOMPILING)
|
|
|
|
ELSE()
|
|
|
|
MESSAGE(STATUS "Compiling on ${HOST_CPU} for ${TARGET_CPU}")
|
|
|
|
MESSAGE(STATUS "Compiling on ${HOST_CPU} for ${TARGET_CPU}")
|
|
|
|
ENDIF("${HOST_CPU}" STREQUAL "${TARGET_CPU}" AND NOT CMAKE_CROSSCOMPILING)
|
|
|
|
ENDIF()
|
|
|
|
|
|
|
|
|
|
|
|
# Use values from environment variables
|
|
|
|
# Use values from environment variables
|
|
|
|
SET(PLATFORM_CFLAGS "$ENV{CFLAGS} $ENV{CPPFLAGS} ${PLATFORM_CFLAGS}")
|
|
|
|
SET(PLATFORM_CFLAGS "$ENV{CFLAGS} $ENV{CPPFLAGS} ${PLATFORM_CFLAGS}")
|
|
|
@ -490,36 +490,36 @@ MACRO(NL_SETUP_BUILD)
|
|
|
|
SET(TARGET_ARM 1)
|
|
|
|
SET(TARGET_ARM 1)
|
|
|
|
ELSEIF(TARGET_CPU STREQUAL "mips")
|
|
|
|
ELSEIF(TARGET_CPU STREQUAL "mips")
|
|
|
|
SET(TARGET_MIPS 1)
|
|
|
|
SET(TARGET_MIPS 1)
|
|
|
|
ENDIF(TARGET_CPU STREQUAL "x86_64")
|
|
|
|
ENDIF()
|
|
|
|
|
|
|
|
|
|
|
|
IF(TARGET_ARM)
|
|
|
|
IF(TARGET_ARM)
|
|
|
|
IF(TARGET_ARMV7S)
|
|
|
|
IF(TARGET_ARMV7S)
|
|
|
|
ADD_PLATFORM_FLAGS("-DHAVE_ARMV7S")
|
|
|
|
ADD_PLATFORM_FLAGS("-DHAVE_ARMV7S")
|
|
|
|
ENDIF(TARGET_ARMV7S)
|
|
|
|
ENDIF()
|
|
|
|
|
|
|
|
|
|
|
|
IF(TARGET_ARMV7)
|
|
|
|
IF(TARGET_ARMV7)
|
|
|
|
ADD_PLATFORM_FLAGS("-DHAVE_ARMV7")
|
|
|
|
ADD_PLATFORM_FLAGS("-DHAVE_ARMV7")
|
|
|
|
ENDIF(TARGET_ARMV7)
|
|
|
|
ENDIF()
|
|
|
|
|
|
|
|
|
|
|
|
IF(TARGET_ARMV6)
|
|
|
|
IF(TARGET_ARMV6)
|
|
|
|
ADD_PLATFORM_FLAGS("-HAVE_ARMV6")
|
|
|
|
ADD_PLATFORM_FLAGS("-HAVE_ARMV6")
|
|
|
|
ENDIF(TARGET_ARMV6)
|
|
|
|
ENDIF()
|
|
|
|
|
|
|
|
|
|
|
|
ADD_PLATFORM_FLAGS("-DHAVE_ARM")
|
|
|
|
ADD_PLATFORM_FLAGS("-DHAVE_ARM")
|
|
|
|
ENDIF(TARGET_ARM)
|
|
|
|
ENDIF()
|
|
|
|
|
|
|
|
|
|
|
|
IF(TARGET_X86)
|
|
|
|
IF(TARGET_X86)
|
|
|
|
ADD_PLATFORM_FLAGS("-DHAVE_X86")
|
|
|
|
ADD_PLATFORM_FLAGS("-DHAVE_X86")
|
|
|
|
ENDIF(TARGET_X86)
|
|
|
|
ENDIF()
|
|
|
|
|
|
|
|
|
|
|
|
IF(TARGET_X64)
|
|
|
|
IF(TARGET_X64)
|
|
|
|
ADD_PLATFORM_FLAGS("-DHAVE_X64 -DHAVE_X86_64")
|
|
|
|
ADD_PLATFORM_FLAGS("-DHAVE_X64 -DHAVE_X86_64")
|
|
|
|
ENDIF(TARGET_X64)
|
|
|
|
ENDIF()
|
|
|
|
|
|
|
|
|
|
|
|
IF(TARGET_MIPS)
|
|
|
|
IF(TARGET_MIPS)
|
|
|
|
ADD_PLATFORM_FLAGS("-DHAVE_MIPS")
|
|
|
|
ADD_PLATFORM_FLAGS("-DHAVE_MIPS")
|
|
|
|
ENDIF(TARGET_MIPS)
|
|
|
|
ENDIF()
|
|
|
|
ENDIF(NOT CMAKE_OSX_ARCHITECTURES)
|
|
|
|
ENDIF()
|
|
|
|
|
|
|
|
|
|
|
|
# Fix library paths suffixes for Debian MultiArch
|
|
|
|
# Fix library paths suffixes for Debian MultiArch
|
|
|
|
IF(LIBRARY_ARCHITECTURE)
|
|
|
|
IF(LIBRARY_ARCHITECTURE)
|
|
|
@ -528,22 +528,22 @@ MACRO(NL_SETUP_BUILD)
|
|
|
|
SET(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} /lib64 /usr/lib64)
|
|
|
|
SET(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} /lib64 /usr/lib64)
|
|
|
|
ELSEIF(TARGET_X86)
|
|
|
|
ELSEIF(TARGET_X86)
|
|
|
|
SET(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} /lib32 /usr/lib32)
|
|
|
|
SET(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} /lib32 /usr/lib32)
|
|
|
|
ENDIF(TARGET_X64)
|
|
|
|
ENDIF()
|
|
|
|
ENDIF(LIBRARY_ARCHITECTURE)
|
|
|
|
ENDIF()
|
|
|
|
|
|
|
|
|
|
|
|
IF(APPLE AND NOT IOS)
|
|
|
|
IF(APPLE AND NOT IOS)
|
|
|
|
SET(CMAKE_INCLUDE_PATH /opt/local/include ${CMAKE_INCLUDE_PATH})
|
|
|
|
SET(CMAKE_INCLUDE_PATH /opt/local/include ${CMAKE_INCLUDE_PATH})
|
|
|
|
SET(CMAKE_LIBRARY_PATH /opt/local/lib ${CMAKE_LIBRARY_PATH})
|
|
|
|
SET(CMAKE_LIBRARY_PATH /opt/local/lib ${CMAKE_LIBRARY_PATH})
|
|
|
|
ENDIF(APPLE AND NOT IOS)
|
|
|
|
ENDIF()
|
|
|
|
|
|
|
|
|
|
|
|
IF(WITH_LOGGING)
|
|
|
|
IF(WITH_LOGGING)
|
|
|
|
ADD_PLATFORM_FLAGS("-DENABLE_LOGS")
|
|
|
|
ADD_PLATFORM_FLAGS("-DENABLE_LOGS")
|
|
|
|
ENDIF(WITH_LOGGING)
|
|
|
|
ENDIF()
|
|
|
|
|
|
|
|
|
|
|
|
IF(MSVC)
|
|
|
|
IF(MSVC)
|
|
|
|
IF(MSVC_VERSION EQUAL "1700" AND NOT MSVC11)
|
|
|
|
IF(MSVC_VERSION EQUAL "1700" AND NOT MSVC11)
|
|
|
|
SET(MSVC11 ON)
|
|
|
|
SET(MSVC11 ON)
|
|
|
|
ENDIF(MSVC_VERSION EQUAL "1700" AND NOT MSVC11)
|
|
|
|
ENDIF()
|
|
|
|
|
|
|
|
|
|
|
|
# Ignore default include paths
|
|
|
|
# Ignore default include paths
|
|
|
|
ADD_PLATFORM_FLAGS("/X")
|
|
|
|
ADD_PLATFORM_FLAGS("/X")
|
|
|
@ -584,9 +584,9 @@ MACRO(NL_SETUP_BUILD)
|
|
|
|
SET(RELEASE_CFLAGS "/Ox /GF /GS- ${RELEASE_CFLAGS}")
|
|
|
|
SET(RELEASE_CFLAGS "/Ox /GF /GS- ${RELEASE_CFLAGS}")
|
|
|
|
# without inlining it's unusable, use custom optimizations again
|
|
|
|
# without inlining it's unusable, use custom optimizations again
|
|
|
|
SET(DEBUG_CFLAGS "/Od /Ob1 ${DEBUG_CFLAGS}")
|
|
|
|
SET(DEBUG_CFLAGS "/Od /Ob1 ${DEBUG_CFLAGS}")
|
|
|
|
ELSE(MSVC12)
|
|
|
|
ELSE()
|
|
|
|
MESSAGE(FATAL_ERROR "Can't determine compiler version ${MSVC_VERSION}")
|
|
|
|
MESSAGE(FATAL_ERROR "Can't determine compiler version ${MSVC_VERSION}")
|
|
|
|
ENDIF(MSVC14)
|
|
|
|
ENDIF()
|
|
|
|
|
|
|
|
|
|
|
|
ADD_PLATFORM_FLAGS("/D_CRT_SECURE_NO_DEPRECATE /D_CRT_SECURE_NO_WARNINGS /D_CRT_NONSTDC_NO_WARNINGS /DWIN32 /D_WINDOWS /wd4250")
|
|
|
|
ADD_PLATFORM_FLAGS("/D_CRT_SECURE_NO_DEPRECATE /D_CRT_SECURE_NO_WARNINGS /D_CRT_NONSTDC_NO_WARNINGS /DWIN32 /D_WINDOWS /wd4250")
|
|
|
|
|
|
|
|
|
|
|
@ -595,10 +595,10 @@ MACRO(NL_SETUP_BUILD)
|
|
|
|
ADD_PLATFORM_FLAGS("/D_WIN64")
|
|
|
|
ADD_PLATFORM_FLAGS("/D_WIN64")
|
|
|
|
# Fix a compilation error for some big C++ files
|
|
|
|
# Fix a compilation error for some big C++ files
|
|
|
|
SET(RELEASE_CFLAGS "${RELEASE_CFLAGS} /bigobj")
|
|
|
|
SET(RELEASE_CFLAGS "${RELEASE_CFLAGS} /bigobj")
|
|
|
|
ELSE(TARGET_X64)
|
|
|
|
ELSE()
|
|
|
|
# Allows 32 bits applications to use 3 GB of RAM
|
|
|
|
# Allows 32 bits applications to use 3 GB of RAM
|
|
|
|
SET(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} /LARGEADDRESSAWARE")
|
|
|
|
SET(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} /LARGEADDRESSAWARE")
|
|
|
|
ENDIF(TARGET_X64)
|
|
|
|
ENDIF()
|
|
|
|
|
|
|
|
|
|
|
|
# Exceptions are only set for C++
|
|
|
|
# Exceptions are only set for C++
|
|
|
|
SET(PLATFORM_CXXFLAGS "${PLATFORM_CXXFLAGS} /EHa")
|
|
|
|
SET(PLATFORM_CXXFLAGS "${PLATFORM_CXXFLAGS} /EHa")
|
|
|
@ -606,9 +606,9 @@ MACRO(NL_SETUP_BUILD)
|
|
|
|
IF(WITH_SYMBOLS)
|
|
|
|
IF(WITH_SYMBOLS)
|
|
|
|
SET(NL_RELEASE_CFLAGS "/Zi ${NL_RELEASE_CFLAGS}")
|
|
|
|
SET(NL_RELEASE_CFLAGS "/Zi ${NL_RELEASE_CFLAGS}")
|
|
|
|
SET(NL_RELEASE_LINKFLAGS "/DEBUG ${NL_RELEASE_LINKFLAGS}")
|
|
|
|
SET(NL_RELEASE_LINKFLAGS "/DEBUG ${NL_RELEASE_LINKFLAGS}")
|
|
|
|
ELSE(WITH_SYMBOLS)
|
|
|
|
ELSE()
|
|
|
|
SET(NL_RELEASE_LINKFLAGS "/RELEASE ${NL_RELEASE_LINKFLAGS}")
|
|
|
|
SET(NL_RELEASE_LINKFLAGS "/RELEASE ${NL_RELEASE_LINKFLAGS}")
|
|
|
|
ENDIF(WITH_SYMBOLS)
|
|
|
|
ENDIF()
|
|
|
|
|
|
|
|
|
|
|
|
SET(NL_DEBUG_CFLAGS "/Zi /MDd /RTC1 /D_DEBUG ${DEBUG_CFLAGS} ${NL_DEBUG_CFLAGS}")
|
|
|
|
SET(NL_DEBUG_CFLAGS "/Zi /MDd /RTC1 /D_DEBUG ${DEBUG_CFLAGS} ${NL_DEBUG_CFLAGS}")
|
|
|
|
SET(NL_RELEASE_CFLAGS "/MD /DNDEBUG ${RELEASE_CFLAGS} ${NL_RELEASE_CFLAGS}")
|
|
|
|
SET(NL_RELEASE_CFLAGS "/MD /DNDEBUG ${RELEASE_CFLAGS} ${NL_RELEASE_CFLAGS}")
|
|
|
@ -617,25 +617,25 @@ MACRO(NL_SETUP_BUILD)
|
|
|
|
|
|
|
|
|
|
|
|
IF(WITH_WARNINGS)
|
|
|
|
IF(WITH_WARNINGS)
|
|
|
|
SET(DEBUG_CFLAGS "/W4 ${DEBUG_CFLAGS}")
|
|
|
|
SET(DEBUG_CFLAGS "/W4 ${DEBUG_CFLAGS}")
|
|
|
|
ELSE(WITH_WARNINGS)
|
|
|
|
ELSE()
|
|
|
|
SET(DEBUG_CFLAGS "/W3 ${DEBUG_CFLAGS}")
|
|
|
|
SET(DEBUG_CFLAGS "/W3 ${DEBUG_CFLAGS}")
|
|
|
|
ENDIF(WITH_WARNINGS)
|
|
|
|
ENDIF()
|
|
|
|
ELSE(MSVC)
|
|
|
|
ELSE()
|
|
|
|
IF(WIN32)
|
|
|
|
IF(WIN32)
|
|
|
|
ADD_PLATFORM_FLAGS("-DWIN32 -D_WIN32")
|
|
|
|
ADD_PLATFORM_FLAGS("-DWIN32 -D_WIN32")
|
|
|
|
|
|
|
|
|
|
|
|
IF(CLANG)
|
|
|
|
IF(CLANG)
|
|
|
|
ADD_PLATFORM_FLAGS("-nobuiltininc")
|
|
|
|
ADD_PLATFORM_FLAGS("-nobuiltininc")
|
|
|
|
ENDIF(CLANG)
|
|
|
|
ENDIF()
|
|
|
|
ENDIF(WIN32)
|
|
|
|
ENDIF()
|
|
|
|
|
|
|
|
|
|
|
|
IF(WITH_SSE3)
|
|
|
|
IF(WITH_SSE3)
|
|
|
|
ADD_PLATFORM_FLAGS("-msse3")
|
|
|
|
ADD_PLATFORM_FLAGS("-msse3")
|
|
|
|
ENDIF(WITH_SSE3)
|
|
|
|
ENDIF()
|
|
|
|
|
|
|
|
|
|
|
|
IF(WITH_GCC_FPMATH_BOTH)
|
|
|
|
IF(WITH_GCC_FPMATH_BOTH)
|
|
|
|
ADD_PLATFORM_FLAGS("-mfpmath=both")
|
|
|
|
ADD_PLATFORM_FLAGS("-mfpmath=both")
|
|
|
|
ENDIF(WITH_GCC_FPMATH_BOTH)
|
|
|
|
ENDIF()
|
|
|
|
|
|
|
|
|
|
|
|
IF(APPLE)
|
|
|
|
IF(APPLE)
|
|
|
|
IF(NOT XCODE)
|
|
|
|
IF(NOT XCODE)
|
|
|
@ -670,97 +670,97 @@ MACRO(NL_SETUP_BUILD)
|
|
|
|
SET(_ARCHS "${_ARCHS} mips")
|
|
|
|
SET(_ARCHS "${_ARCHS} mips")
|
|
|
|
SET(TARGET_MIPS 1)
|
|
|
|
SET(TARGET_MIPS 1)
|
|
|
|
MATH(EXPR TARGETS_COUNT "${TARGETS_COUNT}+1")
|
|
|
|
MATH(EXPR TARGETS_COUNT "${TARGETS_COUNT}+1")
|
|
|
|
ELSE(_ARCH STREQUAL "i386")
|
|
|
|
ELSE()
|
|
|
|
SET(_ARCHS "${_ARCHS} unknwon(${_ARCH})")
|
|
|
|
SET(_ARCHS "${_ARCHS} unknwon(${_ARCH})")
|
|
|
|
ENDIF(_ARCH STREQUAL "i386")
|
|
|
|
ENDIF()
|
|
|
|
ENDFOREACH(_ARCH)
|
|
|
|
ENDFOREACH(_ARCH)
|
|
|
|
MESSAGE(STATUS "Compiling under Mac OS X for ${TARGETS_COUNT} architectures: ${_ARCHS}")
|
|
|
|
MESSAGE(STATUS "Compiling under Mac OS X for ${TARGETS_COUNT} architectures: ${_ARCHS}")
|
|
|
|
ELSE(CMAKE_OSX_ARCHITECTURES)
|
|
|
|
ELSE()
|
|
|
|
SET(TARGETS_COUNT 0)
|
|
|
|
SET(TARGETS_COUNT 0)
|
|
|
|
ENDIF(CMAKE_OSX_ARCHITECTURES)
|
|
|
|
ENDIF()
|
|
|
|
|
|
|
|
|
|
|
|
IF(TARGETS_COUNT EQUAL 1)
|
|
|
|
IF(TARGETS_COUNT EQUAL 1)
|
|
|
|
IF(TARGET_ARM)
|
|
|
|
IF(TARGET_ARM)
|
|
|
|
IF(TARGET_ARMV7S)
|
|
|
|
IF(TARGET_ARMV7S)
|
|
|
|
ADD_PLATFORM_FLAGS("-arch armv7s -DHAVE_ARMV7S")
|
|
|
|
ADD_PLATFORM_FLAGS("-arch armv7s -DHAVE_ARMV7S")
|
|
|
|
ENDIF(TARGET_ARMV7S)
|
|
|
|
ENDIF()
|
|
|
|
|
|
|
|
|
|
|
|
IF(TARGET_ARMV7)
|
|
|
|
IF(TARGET_ARMV7)
|
|
|
|
ADD_PLATFORM_FLAGS("-arch armv7 -DHAVE_ARMV7")
|
|
|
|
ADD_PLATFORM_FLAGS("-arch armv7 -DHAVE_ARMV7")
|
|
|
|
ENDIF(TARGET_ARMV7)
|
|
|
|
ENDIF()
|
|
|
|
|
|
|
|
|
|
|
|
IF(TARGET_ARMV6)
|
|
|
|
IF(TARGET_ARMV6)
|
|
|
|
ADD_PLATFORM_FLAGS("-arch armv6 -DHAVE_ARMV6")
|
|
|
|
ADD_PLATFORM_FLAGS("-arch armv6 -DHAVE_ARMV6")
|
|
|
|
ENDIF(TARGET_ARMV6)
|
|
|
|
ENDIF()
|
|
|
|
|
|
|
|
|
|
|
|
IF(TARGET_ARMV5)
|
|
|
|
IF(TARGET_ARMV5)
|
|
|
|
ADD_PLATFORM_FLAGS("-arch armv5 -DHAVE_ARMV5")
|
|
|
|
ADD_PLATFORM_FLAGS("-arch armv5 -DHAVE_ARMV5")
|
|
|
|
ENDIF(TARGET_ARMV5)
|
|
|
|
ENDIF()
|
|
|
|
|
|
|
|
|
|
|
|
ADD_PLATFORM_FLAGS("-mthumb -DHAVE_ARM")
|
|
|
|
ADD_PLATFORM_FLAGS("-mthumb -DHAVE_ARM")
|
|
|
|
ENDIF(TARGET_ARM)
|
|
|
|
ENDIF()
|
|
|
|
|
|
|
|
|
|
|
|
IF(TARGET_X64)
|
|
|
|
IF(TARGET_X64)
|
|
|
|
ADD_PLATFORM_FLAGS("-arch x86_64 -DHAVE_X64 -DHAVE_X86_64 -DHAVE_X86")
|
|
|
|
ADD_PLATFORM_FLAGS("-arch x86_64 -DHAVE_X64 -DHAVE_X86_64 -DHAVE_X86")
|
|
|
|
ELSEIF(TARGET_X86)
|
|
|
|
ELSEIF(TARGET_X86)
|
|
|
|
ADD_PLATFORM_FLAGS("-arch i386 -DHAVE_X86")
|
|
|
|
ADD_PLATFORM_FLAGS("-arch i386 -DHAVE_X86")
|
|
|
|
ENDIF(TARGET_X64)
|
|
|
|
ENDIF()
|
|
|
|
|
|
|
|
|
|
|
|
IF(TARGET_MIPS)
|
|
|
|
IF(TARGET_MIPS)
|
|
|
|
ADD_PLATFORM_FLAGS("-arch mips -DHAVE_MIPS")
|
|
|
|
ADD_PLATFORM_FLAGS("-arch mips -DHAVE_MIPS")
|
|
|
|
ENDIF(TARGET_MIPS)
|
|
|
|
ENDIF()
|
|
|
|
ELSEIF(TARGETS_COUNT EQUAL 0)
|
|
|
|
ELSEIF(TARGETS_COUNT EQUAL 0)
|
|
|
|
# Not using CMAKE_OSX_ARCHITECTURES, HAVE_XXX already defined before
|
|
|
|
# Not using CMAKE_OSX_ARCHITECTURES, HAVE_XXX already defined before
|
|
|
|
IF(TARGET_ARM)
|
|
|
|
IF(TARGET_ARM)
|
|
|
|
IF(TARGET_ARMV7S)
|
|
|
|
IF(TARGET_ARMV7S)
|
|
|
|
ADD_PLATFORM_FLAGS("-arch armv7s")
|
|
|
|
ADD_PLATFORM_FLAGS("-arch armv7s")
|
|
|
|
ENDIF(TARGET_ARMV7S)
|
|
|
|
ENDIF()
|
|
|
|
|
|
|
|
|
|
|
|
IF(TARGET_ARMV7)
|
|
|
|
IF(TARGET_ARMV7)
|
|
|
|
ADD_PLATFORM_FLAGS("-arch armv7")
|
|
|
|
ADD_PLATFORM_FLAGS("-arch armv7")
|
|
|
|
ENDIF(TARGET_ARMV7)
|
|
|
|
ENDIF()
|
|
|
|
|
|
|
|
|
|
|
|
IF(TARGET_ARMV6)
|
|
|
|
IF(TARGET_ARMV6)
|
|
|
|
ADD_PLATFORM_FLAGS("-arch armv6")
|
|
|
|
ADD_PLATFORM_FLAGS("-arch armv6")
|
|
|
|
ENDIF(TARGET_ARMV6)
|
|
|
|
ENDIF()
|
|
|
|
|
|
|
|
|
|
|
|
IF(TARGET_ARMV5)
|
|
|
|
IF(TARGET_ARMV5)
|
|
|
|
ADD_PLATFORM_FLAGS("-arch armv5")
|
|
|
|
ADD_PLATFORM_FLAGS("-arch armv5")
|
|
|
|
ENDIF(TARGET_ARMV5)
|
|
|
|
ENDIF()
|
|
|
|
|
|
|
|
|
|
|
|
ADD_PLATFORM_FLAGS("-mthumb")
|
|
|
|
ADD_PLATFORM_FLAGS("-mthumb")
|
|
|
|
ENDIF(TARGET_ARM)
|
|
|
|
ENDIF()
|
|
|
|
|
|
|
|
|
|
|
|
IF(TARGET_X64)
|
|
|
|
IF(TARGET_X64)
|
|
|
|
ADD_PLATFORM_FLAGS("-arch x86_64")
|
|
|
|
ADD_PLATFORM_FLAGS("-arch x86_64")
|
|
|
|
ELSEIF(TARGET_X86)
|
|
|
|
ELSEIF(TARGET_X86)
|
|
|
|
ADD_PLATFORM_FLAGS("-arch i386")
|
|
|
|
ADD_PLATFORM_FLAGS("-arch i386")
|
|
|
|
ENDIF(TARGET_X64)
|
|
|
|
ENDIF()
|
|
|
|
|
|
|
|
|
|
|
|
IF(TARGET_MIPS)
|
|
|
|
IF(TARGET_MIPS)
|
|
|
|
ADD_PLATFORM_FLAGS("-arch mips")
|
|
|
|
ADD_PLATFORM_FLAGS("-arch mips")
|
|
|
|
ENDIF(TARGET_MIPS)
|
|
|
|
ENDIF()
|
|
|
|
ELSE(TARGETS_COUNT EQUAL 1)
|
|
|
|
ELSE()
|
|
|
|
IF(TARGET_ARMV6)
|
|
|
|
IF(TARGET_ARMV6)
|
|
|
|
ADD_PLATFORM_FLAGS("-Xarch_armv6 -mthumb -Xarch_armv6 -DHAVE_ARM -Xarch_armv6 -DHAVE_ARMV6")
|
|
|
|
ADD_PLATFORM_FLAGS("-Xarch_armv6 -mthumb -Xarch_armv6 -DHAVE_ARM -Xarch_armv6 -DHAVE_ARMV6")
|
|
|
|
ENDIF(TARGET_ARMV6)
|
|
|
|
ENDIF()
|
|
|
|
|
|
|
|
|
|
|
|
IF(TARGET_ARMV7)
|
|
|
|
IF(TARGET_ARMV7)
|
|
|
|
ADD_PLATFORM_FLAGS("-Xarch_armv7 -mthumb -Xarch_armv7 -DHAVE_ARM -Xarch_armv7 -DHAVE_ARMV7")
|
|
|
|
ADD_PLATFORM_FLAGS("-Xarch_armv7 -mthumb -Xarch_armv7 -DHAVE_ARM -Xarch_armv7 -DHAVE_ARMV7")
|
|
|
|
ENDIF(TARGET_ARMV7)
|
|
|
|
ENDIF()
|
|
|
|
|
|
|
|
|
|
|
|
IF(TARGET_X86)
|
|
|
|
IF(TARGET_X86)
|
|
|
|
ADD_PLATFORM_FLAGS("-Xarch_i386 -DHAVE_X86")
|
|
|
|
ADD_PLATFORM_FLAGS("-Xarch_i386 -DHAVE_X86")
|
|
|
|
ENDIF(TARGET_X86)
|
|
|
|
ENDIF()
|
|
|
|
|
|
|
|
|
|
|
|
IF(TARGET_X64)
|
|
|
|
IF(TARGET_X64)
|
|
|
|
ADD_PLATFORM_FLAGS("-Xarch_x86_64 -DHAVE_X64 -Xarch_x86_64 -DHAVE_X86_64")
|
|
|
|
ADD_PLATFORM_FLAGS("-Xarch_x86_64 -DHAVE_X64 -Xarch_x86_64 -DHAVE_X86_64")
|
|
|
|
ENDIF(TARGET_X64)
|
|
|
|
ENDIF()
|
|
|
|
|
|
|
|
|
|
|
|
IF(TARGET_MIPS)
|
|
|
|
IF(TARGET_MIPS)
|
|
|
|
ADD_PLATFORM_FLAGS("-Xarch_mips -DHAVE_MIPS")
|
|
|
|
ADD_PLATFORM_FLAGS("-Xarch_mips -DHAVE_MIPS")
|
|
|
|
ENDIF(TARGET_MIPS)
|
|
|
|
ENDIF()
|
|
|
|
ENDIF(TARGETS_COUNT EQUAL 1)
|
|
|
|
ENDIF()
|
|
|
|
|
|
|
|
|
|
|
|
IF(IOS)
|
|
|
|
IF(IOS)
|
|
|
|
SET(CMAKE_OSX_SYSROOT "" CACHE PATH "" FORCE)
|
|
|
|
SET(CMAKE_OSX_SYSROOT "" CACHE PATH "" FORCE)
|
|
|
@ -770,73 +770,73 @@ MACRO(NL_SETUP_BUILD)
|
|
|
|
CONVERT_VERSION_NUMBER(${IOS_VERSION_MAJOR} ${IOS_VERSION_MINOR} ${IOS_VERSION_PATCH} IOS_VERSION_NUMBER)
|
|
|
|
CONVERT_VERSION_NUMBER(${IOS_VERSION_MAJOR} ${IOS_VERSION_MINOR} ${IOS_VERSION_PATCH} IOS_VERSION_NUMBER)
|
|
|
|
|
|
|
|
|
|
|
|
ADD_PLATFORM_FLAGS("-D__IPHONE_OS_VERSION_MIN_REQUIRED=${IOS_VERSION_NUMBER}")
|
|
|
|
ADD_PLATFORM_FLAGS("-D__IPHONE_OS_VERSION_MIN_REQUIRED=${IOS_VERSION_NUMBER}")
|
|
|
|
ENDIF(IOS_VERSION)
|
|
|
|
ENDIF()
|
|
|
|
|
|
|
|
|
|
|
|
IF(CMAKE_IOS_SYSROOT)
|
|
|
|
IF(CMAKE_IOS_SYSROOT)
|
|
|
|
IF(TARGET_ARMV7S)
|
|
|
|
IF(TARGET_ARMV7S)
|
|
|
|
IF(TARGETS_COUNT GREATER 1)
|
|
|
|
IF(TARGETS_COUNT GREATER 1)
|
|
|
|
SET(XARCH "-Xarch_armv7s ")
|
|
|
|
SET(XARCH "-Xarch_armv7s ")
|
|
|
|
ENDIF(TARGETS_COUNT GREATER 1)
|
|
|
|
ENDIF()
|
|
|
|
|
|
|
|
|
|
|
|
ADD_PLATFORM_FLAGS("${XARCH}-isysroot${CMAKE_IOS_SYSROOT}")
|
|
|
|
ADD_PLATFORM_FLAGS("${XARCH}-isysroot${CMAKE_IOS_SYSROOT}")
|
|
|
|
ADD_PLATFORM_FLAGS("${XARCH}-miphoneos-version-min=${IOS_VERSION}")
|
|
|
|
ADD_PLATFORM_FLAGS("${XARCH}-miphoneos-version-min=${IOS_VERSION}")
|
|
|
|
SET(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} ${XARCH}-Wl,-iphoneos_version_min,${IOS_VERSION}")
|
|
|
|
SET(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} ${XARCH}-Wl,-iphoneos_version_min,${IOS_VERSION}")
|
|
|
|
ENDIF(TARGET_ARMV7S)
|
|
|
|
ENDIF()
|
|
|
|
|
|
|
|
|
|
|
|
IF(TARGET_ARMV7)
|
|
|
|
IF(TARGET_ARMV7)
|
|
|
|
IF(TARGETS_COUNT GREATER 1)
|
|
|
|
IF(TARGETS_COUNT GREATER 1)
|
|
|
|
SET(XARCH "-Xarch_armv7 ")
|
|
|
|
SET(XARCH "-Xarch_armv7 ")
|
|
|
|
ENDIF(TARGETS_COUNT GREATER 1)
|
|
|
|
ENDIF()
|
|
|
|
|
|
|
|
|
|
|
|
ADD_PLATFORM_FLAGS("${XARCH}-isysroot${CMAKE_IOS_SYSROOT}")
|
|
|
|
ADD_PLATFORM_FLAGS("${XARCH}-isysroot${CMAKE_IOS_SYSROOT}")
|
|
|
|
ADD_PLATFORM_FLAGS("${XARCH}-miphoneos-version-min=${IOS_VERSION}")
|
|
|
|
ADD_PLATFORM_FLAGS("${XARCH}-miphoneos-version-min=${IOS_VERSION}")
|
|
|
|
SET(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} ${XARCH}-Wl,-iphoneos_version_min,${IOS_VERSION}")
|
|
|
|
SET(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} ${XARCH}-Wl,-iphoneos_version_min,${IOS_VERSION}")
|
|
|
|
ENDIF(TARGET_ARMV7)
|
|
|
|
ENDIF()
|
|
|
|
|
|
|
|
|
|
|
|
IF(TARGET_ARMV6)
|
|
|
|
IF(TARGET_ARMV6)
|
|
|
|
IF(TARGETS_COUNT GREATER 1)
|
|
|
|
IF(TARGETS_COUNT GREATER 1)
|
|
|
|
SET(XARCH "-Xarch_armv6 ")
|
|
|
|
SET(XARCH "-Xarch_armv6 ")
|
|
|
|
ENDIF(TARGETS_COUNT GREATER 1)
|
|
|
|
ENDIF()
|
|
|
|
|
|
|
|
|
|
|
|
ADD_PLATFORM_FLAGS("${XARCH}-isysroot${CMAKE_IOS_SYSROOT}")
|
|
|
|
ADD_PLATFORM_FLAGS("${XARCH}-isysroot${CMAKE_IOS_SYSROOT}")
|
|
|
|
ADD_PLATFORM_FLAGS("${XARCH}-miphoneos-version-min=${IOS_VERSION}")
|
|
|
|
ADD_PLATFORM_FLAGS("${XARCH}-miphoneos-version-min=${IOS_VERSION}")
|
|
|
|
SET(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} ${XARCH}-Wl,-iphoneos_version_min,${IOS_VERSION}")
|
|
|
|
SET(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} ${XARCH}-Wl,-iphoneos_version_min,${IOS_VERSION}")
|
|
|
|
ENDIF(TARGET_ARMV6)
|
|
|
|
ENDIF()
|
|
|
|
ENDIF(CMAKE_IOS_SYSROOT)
|
|
|
|
ENDIF()
|
|
|
|
|
|
|
|
|
|
|
|
IF(CMAKE_IOS_SIMULATOR_SYSROOT AND TARGET_X86)
|
|
|
|
IF(CMAKE_IOS_SIMULATOR_SYSROOT AND TARGET_X86)
|
|
|
|
IF(TARGETS_COUNT GREATER 1)
|
|
|
|
IF(TARGETS_COUNT GREATER 1)
|
|
|
|
SET(XARCH "-Xarch_i386 ")
|
|
|
|
SET(XARCH "-Xarch_i386 ")
|
|
|
|
ENDIF(TARGETS_COUNT GREATER 1)
|
|
|
|
ENDIF()
|
|
|
|
|
|
|
|
|
|
|
|
ADD_PLATFORM_FLAGS("${XARCH}-isysroot${CMAKE_IOS_SIMULATOR_SYSROOT}")
|
|
|
|
ADD_PLATFORM_FLAGS("${XARCH}-isysroot${CMAKE_IOS_SIMULATOR_SYSROOT}")
|
|
|
|
ADD_PLATFORM_FLAGS("${XARCH}-mios-simulator-version-min=${IOS_VERSION}")
|
|
|
|
ADD_PLATFORM_FLAGS("${XARCH}-mios-simulator-version-min=${IOS_VERSION}")
|
|
|
|
IF(CMAKE_OSX_DEPLOYMENT_TARGET)
|
|
|
|
IF(CMAKE_OSX_DEPLOYMENT_TARGET)
|
|
|
|
SET(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} ${XARCH}-Wl,-macosx_version_min,${CMAKE_OSX_DEPLOYMENT_TARGET}")
|
|
|
|
SET(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} ${XARCH}-Wl,-macosx_version_min,${CMAKE_OSX_DEPLOYMENT_TARGET}")
|
|
|
|
ENDIF(CMAKE_OSX_DEPLOYMENT_TARGET)
|
|
|
|
ENDIF()
|
|
|
|
ENDIF(CMAKE_IOS_SIMULATOR_SYSROOT AND TARGET_X86)
|
|
|
|
ENDIF()
|
|
|
|
ELSE(IOS)
|
|
|
|
ELSE()
|
|
|
|
# Always force -mmacosx-version-min to override environement variable
|
|
|
|
# Always force -mmacosx-version-min to override environement variable
|
|
|
|
IF(CMAKE_OSX_DEPLOYMENT_TARGET)
|
|
|
|
IF(CMAKE_OSX_DEPLOYMENT_TARGET)
|
|
|
|
SET(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -Wl,-macosx_version_min,${CMAKE_OSX_DEPLOYMENT_TARGET}")
|
|
|
|
SET(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -Wl,-macosx_version_min,${CMAKE_OSX_DEPLOYMENT_TARGET}")
|
|
|
|
ENDIF(CMAKE_OSX_DEPLOYMENT_TARGET)
|
|
|
|
ENDIF()
|
|
|
|
ENDIF(IOS)
|
|
|
|
ENDIF()
|
|
|
|
|
|
|
|
|
|
|
|
SET(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -Wl,-headerpad_max_install_names")
|
|
|
|
SET(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -Wl,-headerpad_max_install_names")
|
|
|
|
|
|
|
|
|
|
|
|
IF(HAVE_FLAG_SEARCH_PATHS_FIRST)
|
|
|
|
IF(HAVE_FLAG_SEARCH_PATHS_FIRST)
|
|
|
|
SET(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -Wl,-search_paths_first")
|
|
|
|
SET(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -Wl,-search_paths_first")
|
|
|
|
ENDIF(HAVE_FLAG_SEARCH_PATHS_FIRST)
|
|
|
|
ENDIF()
|
|
|
|
ENDIF(NOT XCODE)
|
|
|
|
ENDIF()
|
|
|
|
ELSE(APPLE)
|
|
|
|
ELSE()
|
|
|
|
IF(HOST_CPU STREQUAL "x86_64" AND TARGET_CPU STREQUAL "x86")
|
|
|
|
IF(HOST_CPU STREQUAL "x86_64" AND TARGET_CPU STREQUAL "x86")
|
|
|
|
ADD_PLATFORM_FLAGS("-m32 -march=i686")
|
|
|
|
ADD_PLATFORM_FLAGS("-m32 -march=i686")
|
|
|
|
ENDIF(HOST_CPU STREQUAL "x86_64" AND TARGET_CPU STREQUAL "x86")
|
|
|
|
ENDIF()
|
|
|
|
|
|
|
|
|
|
|
|
IF(HOST_CPU STREQUAL "x86" AND TARGET_CPU STREQUAL "x86_64")
|
|
|
|
IF(HOST_CPU STREQUAL "x86" AND TARGET_CPU STREQUAL "x86_64")
|
|
|
|
ADD_PLATFORM_FLAGS("-m64")
|
|
|
|
ADD_PLATFORM_FLAGS("-m64")
|
|
|
|
ENDIF(HOST_CPU STREQUAL "x86" AND TARGET_CPU STREQUAL "x86_64")
|
|
|
|
ENDIF()
|
|
|
|
ENDIF(APPLE)
|
|
|
|
ENDIF()
|
|
|
|
|
|
|
|
|
|
|
|
ADD_PLATFORM_FLAGS("-D_REENTRANT -fno-strict-aliasing")
|
|
|
|
ADD_PLATFORM_FLAGS("-D_REENTRANT -fno-strict-aliasing")
|
|
|
|
|
|
|
|
|
|
|
@ -846,11 +846,11 @@ MACRO(NL_SETUP_BUILD)
|
|
|
|
|
|
|
|
|
|
|
|
IF(WITH_COVERAGE)
|
|
|
|
IF(WITH_COVERAGE)
|
|
|
|
ADD_PLATFORM_FLAGS("-fprofile-arcs -ftest-coverage")
|
|
|
|
ADD_PLATFORM_FLAGS("-fprofile-arcs -ftest-coverage")
|
|
|
|
ENDIF(WITH_COVERAGE)
|
|
|
|
ENDIF()
|
|
|
|
|
|
|
|
|
|
|
|
IF(WITH_WARNINGS)
|
|
|
|
IF(WITH_WARNINGS)
|
|
|
|
ADD_PLATFORM_FLAGS("-Wall -W -Wpointer-arith -Wsign-compare -Wno-deprecated-declarations -Wno-multichar -Wno-unused")
|
|
|
|
ADD_PLATFORM_FLAGS("-Wall -W -Wpointer-arith -Wsign-compare -Wno-deprecated-declarations -Wno-multichar -Wno-unused")
|
|
|
|
ENDIF(WITH_WARNINGS)
|
|
|
|
ENDIF()
|
|
|
|
|
|
|
|
|
|
|
|
IF(ANDROID)
|
|
|
|
IF(ANDROID)
|
|
|
|
ADD_PLATFORM_FLAGS("--sysroot=${PLATFORM_ROOT}")
|
|
|
|
ADD_PLATFORM_FLAGS("--sysroot=${PLATFORM_ROOT}")
|
|
|
@ -867,17 +867,17 @@ MACRO(NL_SETUP_BUILD)
|
|
|
|
SET(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -march=armv7-a -Wl,--fix-cortex-a8")
|
|
|
|
SET(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -march=armv7-a -Wl,--fix-cortex-a8")
|
|
|
|
ELSEIF(TARGET_ARMV5)
|
|
|
|
ELSEIF(TARGET_ARMV5)
|
|
|
|
ADD_PLATFORM_FLAGS("-march=armv5te -mtune=xscale -msoft-float")
|
|
|
|
ADD_PLATFORM_FLAGS("-march=armv5te -mtune=xscale -msoft-float")
|
|
|
|
ENDIF(TARGET_ARMV7)
|
|
|
|
ENDIF()
|
|
|
|
|
|
|
|
|
|
|
|
SET(TARGET_THUMB ON)
|
|
|
|
SET(TARGET_THUMB ON)
|
|
|
|
IF(TARGET_THUMB)
|
|
|
|
IF(TARGET_THUMB)
|
|
|
|
ADD_PLATFORM_FLAGS("-mthumb -fno-strict-aliasing -finline-limit=64")
|
|
|
|
ADD_PLATFORM_FLAGS("-mthumb -fno-strict-aliasing -finline-limit=64")
|
|
|
|
SET(DEBUG_CFLAGS "${DEBUG_CFLAGS} -marm")
|
|
|
|
SET(DEBUG_CFLAGS "${DEBUG_CFLAGS} -marm")
|
|
|
|
ELSE(TARGET_THUMB)
|
|
|
|
ELSE()
|
|
|
|
ADD_PLATFORM_FLAGS("-funswitch-loops -finline-limit=300")
|
|
|
|
ADD_PLATFORM_FLAGS("-funswitch-loops -finline-limit=300")
|
|
|
|
SET(DEBUG_CFLAGS "${DEBUG_CFLAGS} -fno-strict-aliasing")
|
|
|
|
SET(DEBUG_CFLAGS "${DEBUG_CFLAGS} -fno-strict-aliasing")
|
|
|
|
SET(RELEASE_CFLAGS "${RELEASE_CFLAGS} -fstrict-aliasing")
|
|
|
|
SET(RELEASE_CFLAGS "${RELEASE_CFLAGS} -fstrict-aliasing")
|
|
|
|
ENDIF(TARGET_THUMB)
|
|
|
|
ENDIF()
|
|
|
|
ELSEIF(TARGET_X86)
|
|
|
|
ELSEIF(TARGET_X86)
|
|
|
|
# Optimizations for Intel Atom
|
|
|
|
# Optimizations for Intel Atom
|
|
|
|
ADD_PLATFORM_FLAGS("-march=i686 -mtune=atom -mstackrealign -msse3 -mfpmath=sse -m32 -flto -ffast-math -funroll-loops")
|
|
|
|
ADD_PLATFORM_FLAGS("-march=i686 -mtune=atom -mstackrealign -msse3 -mfpmath=sse -m32 -flto -ffast-math -funroll-loops")
|
|
|
@ -887,39 +887,39 @@ MACRO(NL_SETUP_BUILD)
|
|
|
|
ELSEIF(TARGET_MIPS)
|
|
|
|
ELSEIF(TARGET_MIPS)
|
|
|
|
ADD_PLATFORM_FLAGS("-fpic -finline-functions -fmessage-length=0 -fno-inline-functions-called-once -fgcse-after-reload -frerun-cse-after-loop -frename-registers -fno-strict-aliasing")
|
|
|
|
ADD_PLATFORM_FLAGS("-fpic -finline-functions -fmessage-length=0 -fno-inline-functions-called-once -fgcse-after-reload -frerun-cse-after-loop -frename-registers -fno-strict-aliasing")
|
|
|
|
SET(RELEASE_CFLAGS "${RELEASE_CFLAGS} -funswitch-loops -finline-limit=300")
|
|
|
|
SET(RELEASE_CFLAGS "${RELEASE_CFLAGS} -funswitch-loops -finline-limit=300")
|
|
|
|
ENDIF(TARGET_ARM)
|
|
|
|
ENDIF()
|
|
|
|
SET(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now")
|
|
|
|
SET(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now")
|
|
|
|
SET(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -L${PLATFORM_ROOT}/usr/lib")
|
|
|
|
SET(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -L${PLATFORM_ROOT}/usr/lib")
|
|
|
|
ENDIF(ANDROID)
|
|
|
|
ENDIF()
|
|
|
|
|
|
|
|
|
|
|
|
IF(APPLE)
|
|
|
|
IF(APPLE)
|
|
|
|
ADD_PLATFORM_FLAGS("-gdwarf-2 -D_DARWIN_UNLIMITED_STREAMS")
|
|
|
|
ADD_PLATFORM_FLAGS("-gdwarf-2 -D_DARWIN_UNLIMITED_STREAMS")
|
|
|
|
ENDIF(APPLE)
|
|
|
|
ENDIF()
|
|
|
|
|
|
|
|
|
|
|
|
# Fix "relocation R_X86_64_32 against.." error on x64 platforms
|
|
|
|
# Fix "relocation R_X86_64_32 against.." error on x64 platforms
|
|
|
|
IF(TARGET_X64 AND WITH_STATIC AND NOT WITH_STATIC_DRIVERS AND NOT MINGW)
|
|
|
|
IF(TARGET_X64 AND WITH_STATIC AND NOT WITH_STATIC_DRIVERS AND NOT MINGW)
|
|
|
|
ADD_PLATFORM_FLAGS("-fPIC")
|
|
|
|
ADD_PLATFORM_FLAGS("-fPIC")
|
|
|
|
ENDIF(TARGET_X64 AND WITH_STATIC AND NOT WITH_STATIC_DRIVERS AND NOT MINGW)
|
|
|
|
ENDIF()
|
|
|
|
|
|
|
|
|
|
|
|
SET(PLATFORM_CXXFLAGS "${PLATFORM_CXXFLAGS} -ftemplate-depth-48")
|
|
|
|
SET(PLATFORM_CXXFLAGS "${PLATFORM_CXXFLAGS} -ftemplate-depth-48")
|
|
|
|
|
|
|
|
|
|
|
|
IF(NOT APPLE)
|
|
|
|
IF(NOT APPLE)
|
|
|
|
SET(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -Wl,--no-undefined -Wl,--as-needed")
|
|
|
|
SET(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -Wl,--no-undefined -Wl,--as-needed")
|
|
|
|
ENDIF(NOT APPLE)
|
|
|
|
ENDIF()
|
|
|
|
|
|
|
|
|
|
|
|
IF(WITH_SYMBOLS)
|
|
|
|
IF(WITH_SYMBOLS)
|
|
|
|
SET(NL_RELEASE_CFLAGS "${NL_RELEASE_CFLAGS} -g")
|
|
|
|
SET(NL_RELEASE_CFLAGS "${NL_RELEASE_CFLAGS} -g")
|
|
|
|
ELSE(WITH_SYMBOLS)
|
|
|
|
ELSE()
|
|
|
|
IF(APPLE)
|
|
|
|
IF(APPLE)
|
|
|
|
SET(NL_RELEASE_LINKFLAGS "-Wl,-dead_strip ${NL_RELEASE_LINKFLAGS}")
|
|
|
|
SET(NL_RELEASE_LINKFLAGS "-Wl,-dead_strip ${NL_RELEASE_LINKFLAGS}")
|
|
|
|
ELSE(APPLE)
|
|
|
|
ELSE()
|
|
|
|
SET(NL_RELEASE_LINKFLAGS "-Wl,-s ${NL_RELEASE_LINKFLAGS}")
|
|
|
|
SET(NL_RELEASE_LINKFLAGS "-Wl,-s ${NL_RELEASE_LINKFLAGS}")
|
|
|
|
ENDIF(APPLE)
|
|
|
|
ENDIF()
|
|
|
|
ENDIF(WITH_SYMBOLS)
|
|
|
|
ENDIF()
|
|
|
|
|
|
|
|
|
|
|
|
SET(NL_DEBUG_CFLAGS "-g -DNL_DEBUG -D_DEBUG ${NL_DEBUG_CFLAGS}")
|
|
|
|
SET(NL_DEBUG_CFLAGS "-g -DNL_DEBUG -D_DEBUG ${NL_DEBUG_CFLAGS}")
|
|
|
|
SET(NL_RELEASE_CFLAGS "-DNL_RELEASE -DNDEBUG -O3 ${NL_RELEASE_CFLAGS}")
|
|
|
|
SET(NL_RELEASE_CFLAGS "-DNL_RELEASE -DNDEBUG -O3 ${NL_RELEASE_CFLAGS}")
|
|
|
|
ENDIF(MSVC)
|
|
|
|
ENDIF()
|
|
|
|
ENDMACRO(NL_SETUP_BUILD)
|
|
|
|
ENDMACRO(NL_SETUP_BUILD)
|
|
|
|
|
|
|
|
|
|
|
|
MACRO(NL_SETUP_BUILD_FLAGS)
|
|
|
|
MACRO(NL_SETUP_BUILD_FLAGS)
|
|
|
@ -954,7 +954,7 @@ MACRO(NL_MAKE_ABSOLUTE_PREFIX NAME_RELATIVE NAME_ABSOLUTE)
|
|
|
|
ELSE()
|
|
|
|
ELSE()
|
|
|
|
SET(${NAME_ABSOLUTE} ${${NAME_RELATIVE}})
|
|
|
|
SET(${NAME_ABSOLUTE} ${${NAME_RELATIVE}})
|
|
|
|
ENDIF()
|
|
|
|
ENDIF()
|
|
|
|
ENDIF(IS_ABSOLUTE "${${NAME_RELATIVE}}")
|
|
|
|
ENDIF()
|
|
|
|
ENDMACRO(NL_MAKE_ABSOLUTE_PREFIX)
|
|
|
|
ENDMACRO(NL_MAKE_ABSOLUTE_PREFIX)
|
|
|
|
|
|
|
|
|
|
|
|
MACRO(NL_SETUP_PREFIX_PATHS)
|
|
|
|
MACRO(NL_SETUP_PREFIX_PATHS)
|
|
|
@ -1031,7 +1031,7 @@ MACRO(RYZOM_SETUP_PREFIX_PATHS)
|
|
|
|
ELSE()
|
|
|
|
ELSE()
|
|
|
|
SET(RYZOM_ETC_PREFIX "." CACHE PATH "Installation path for configurations")
|
|
|
|
SET(RYZOM_ETC_PREFIX "." CACHE PATH "Installation path for configurations")
|
|
|
|
ENDIF()
|
|
|
|
ENDIF()
|
|
|
|
ENDIF(NOT RYZOM_ETC_PREFIX)
|
|
|
|
ENDIF()
|
|
|
|
NL_MAKE_ABSOLUTE_PREFIX(RYZOM_ETC_PREFIX RYZOM_ETC_ABSOLUTE_PREFIX)
|
|
|
|
NL_MAKE_ABSOLUTE_PREFIX(RYZOM_ETC_PREFIX RYZOM_ETC_ABSOLUTE_PREFIX)
|
|
|
|
|
|
|
|
|
|
|
|
## Allow override of install_prefix/share path.
|
|
|
|
## Allow override of install_prefix/share path.
|
|
|
@ -1071,7 +1071,7 @@ MACRO(RYZOM_SETUP_PREFIX_PATHS)
|
|
|
|
ELSE()
|
|
|
|
ELSE()
|
|
|
|
SET(RYZOM_LIB_PREFIX "lib" CACHE PATH "Installation path for libraries.")
|
|
|
|
SET(RYZOM_LIB_PREFIX "lib" CACHE PATH "Installation path for libraries.")
|
|
|
|
ENDIF()
|
|
|
|
ENDIF()
|
|
|
|
ENDIF(NOT RYZOM_LIB_PREFIX)
|
|
|
|
ENDIF()
|
|
|
|
NL_MAKE_ABSOLUTE_PREFIX(RYZOM_LIB_PREFIX RYZOM_LIB_ABSOLUTE_PREFIX)
|
|
|
|
NL_MAKE_ABSOLUTE_PREFIX(RYZOM_LIB_PREFIX RYZOM_LIB_ABSOLUTE_PREFIX)
|
|
|
|
|
|
|
|
|
|
|
|
## Allow override of install_prefix/games path.
|
|
|
|
## Allow override of install_prefix/games path.
|
|
|
@ -1089,7 +1089,7 @@ ENDMACRO(RYZOM_SETUP_PREFIX_PATHS)
|
|
|
|
MACRO(SETUP_EXTERNAL)
|
|
|
|
MACRO(SETUP_EXTERNAL)
|
|
|
|
IF(WITH_EXTERNAL)
|
|
|
|
IF(WITH_EXTERNAL)
|
|
|
|
FIND_PACKAGE(External REQUIRED)
|
|
|
|
FIND_PACKAGE(External REQUIRED)
|
|
|
|
ENDIF(WITH_EXTERNAL)
|
|
|
|
ENDIF()
|
|
|
|
|
|
|
|
|
|
|
|
IF(WIN32)
|
|
|
|
IF(WIN32)
|
|
|
|
FIND_PACKAGE(External REQUIRED)
|
|
|
|
FIND_PACKAGE(External REQUIRED)
|
|
|
@ -1098,8 +1098,8 @@ MACRO(SETUP_EXTERNAL)
|
|
|
|
IF(DEFINED BOOST_DIR)
|
|
|
|
IF(DEFINED BOOST_DIR)
|
|
|
|
SET(BOOST_INCLUDEDIR ${BOOST_DIR}/include)
|
|
|
|
SET(BOOST_INCLUDEDIR ${BOOST_DIR}/include)
|
|
|
|
SET(BOOST_LIBRARYDIR ${BOOST_DIR}/lib)
|
|
|
|
SET(BOOST_LIBRARYDIR ${BOOST_DIR}/lib)
|
|
|
|
ENDIF(DEFINED BOOST_DIR)
|
|
|
|
ENDIF()
|
|
|
|
ELSE(WIN32)
|
|
|
|
ELSE()
|
|
|
|
FIND_PACKAGE(External QUIET)
|
|
|
|
FIND_PACKAGE(External QUIET)
|
|
|
|
|
|
|
|
|
|
|
|
IF(APPLE)
|
|
|
|
IF(APPLE)
|
|
|
@ -1108,28 +1108,28 @@ MACRO(SETUP_EXTERNAL)
|
|
|
|
ELSE()
|
|
|
|
ELSE()
|
|
|
|
SET(CMAKE_FIND_LIBRARY_SUFFIXES .dylib .so .a)
|
|
|
|
SET(CMAKE_FIND_LIBRARY_SUFFIXES .dylib .so .a)
|
|
|
|
ENDIF()
|
|
|
|
ENDIF()
|
|
|
|
ELSE(APPLE)
|
|
|
|
ELSE()
|
|
|
|
IF(WITH_STATIC_EXTERNAL)
|
|
|
|
IF(WITH_STATIC_EXTERNAL)
|
|
|
|
SET(CMAKE_FIND_LIBRARY_SUFFIXES .a .so)
|
|
|
|
SET(CMAKE_FIND_LIBRARY_SUFFIXES .a .so)
|
|
|
|
ELSE()
|
|
|
|
ELSE()
|
|
|
|
SET(CMAKE_FIND_LIBRARY_SUFFIXES .so .a)
|
|
|
|
SET(CMAKE_FIND_LIBRARY_SUFFIXES .so .a)
|
|
|
|
ENDIF()
|
|
|
|
ENDIF()
|
|
|
|
ENDIF(APPLE)
|
|
|
|
ENDIF()
|
|
|
|
ENDIF(WIN32)
|
|
|
|
ENDIF()
|
|
|
|
|
|
|
|
|
|
|
|
# Android and iOS have pthread
|
|
|
|
# Android and iOS have pthread
|
|
|
|
IF(ANDROID OR IOS)
|
|
|
|
IF(ANDROID OR IOS)
|
|
|
|
SET(CMAKE_USE_PTHREADS_INIT 1)
|
|
|
|
SET(CMAKE_USE_PTHREADS_INIT 1)
|
|
|
|
SET(Threads_FOUND TRUE)
|
|
|
|
SET(Threads_FOUND TRUE)
|
|
|
|
ELSE(ANDROID OR IOS)
|
|
|
|
ELSE()
|
|
|
|
FIND_PACKAGE(Threads REQUIRED)
|
|
|
|
FIND_PACKAGE(Threads REQUIRED)
|
|
|
|
# TODO: replace all -l<lib> by absolute path to <lib> in CMAKE_THREAD_LIBS_INIT
|
|
|
|
# TODO: replace all -l<lib> by absolute path to <lib> in CMAKE_THREAD_LIBS_INIT
|
|
|
|
ENDIF(ANDROID OR IOS)
|
|
|
|
ENDIF()
|
|
|
|
|
|
|
|
|
|
|
|
IF(WITH_STLPORT)
|
|
|
|
IF(WITH_STLPORT)
|
|
|
|
FIND_PACKAGE(STLport REQUIRED)
|
|
|
|
FIND_PACKAGE(STLport REQUIRED)
|
|
|
|
INCLUDE_DIRECTORIES(${STLPORT_INCLUDE_DIR})
|
|
|
|
INCLUDE_DIRECTORIES(${STLPORT_INCLUDE_DIR})
|
|
|
|
ENDIF(WITH_STLPORT)
|
|
|
|
ENDIF()
|
|
|
|
|
|
|
|
|
|
|
|
IF(WIN32)
|
|
|
|
IF(WIN32)
|
|
|
|
# Must include DXSDK before WINSDK
|
|
|
|
# Must include DXSDK before WINSDK
|
|
|
@ -1137,10 +1137,10 @@ MACRO(SETUP_EXTERNAL)
|
|
|
|
# IF(DXSDK_INCLUDE_DIR)
|
|
|
|
# IF(DXSDK_INCLUDE_DIR)
|
|
|
|
# INCLUDE_DIRECTORIES(${DXSDK_INCLUDE_DIR})
|
|
|
|
# INCLUDE_DIRECTORIES(${DXSDK_INCLUDE_DIR})
|
|
|
|
# ENDIF()
|
|
|
|
# ENDIF()
|
|
|
|
ENDIF(WIN32)
|
|
|
|
ENDIF()
|
|
|
|
|
|
|
|
|
|
|
|
IF(MSVC)
|
|
|
|
IF(MSVC)
|
|
|
|
FIND_PACKAGE(MSVC REQUIRED)
|
|
|
|
FIND_PACKAGE(MSVC REQUIRED)
|
|
|
|
FIND_PACKAGE(WindowsSDK REQUIRED)
|
|
|
|
FIND_PACKAGE(WindowsSDK REQUIRED)
|
|
|
|
ENDIF(MSVC)
|
|
|
|
ENDIF()
|
|
|
|
ENDMACRO(SETUP_EXTERNAL)
|
|
|
|
ENDMACRO(SETUP_EXTERNAL)
|
|
|
|