mirror of
https://github.com/glest/glest-source.git
synced 2025-08-19 06:31:19 +02:00
CMake:more cleanup
@mathusummut can you update the comment regarding Win building at the top of the main CMake file please Signed-off-by: andy5995 <andy400-dev@yahoo.com>
This commit is contained in:
@@ -1,6 +1,8 @@
|
|||||||
CMAKE_MINIMUM_REQUIRED( VERSION 2.8.2 )
|
CMAKE_MINIMUM_REQUIRED( VERSION 2.8.2 )
|
||||||
PROJECT( ZetaGlest )
|
PROJECT( ZetaGlest )
|
||||||
|
|
||||||
|
# Mathu, could you update this comment please?
|
||||||
|
#
|
||||||
#SET(CMAKE_VERBOSE_MAKEFILE ON)
|
#SET(CMAKE_VERBOSE_MAKEFILE ON)
|
||||||
|
|
||||||
#
|
#
|
||||||
@@ -92,7 +94,7 @@ IF(APPLE)
|
|||||||
ENDIF(APPLE)
|
ENDIF(APPLE)
|
||||||
|
|
||||||
IF(CMAKE_COMPILER_IS_GNUCXX OR MINGW)
|
IF(CMAKE_COMPILER_IS_GNUCXX OR MINGW)
|
||||||
IF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
IF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
||||||
MESSAGE(STATUS "Detected CLANG Compiler...")
|
MESSAGE(STATUS "Detected CLANG Compiler...")
|
||||||
ELSEIF(CMAKE_COMPILER_IS_GNUCXX)
|
ELSEIF(CMAKE_COMPILER_IS_GNUCXX)
|
||||||
MESSAGE(STATUS "Detected GNUC Compiler...")
|
MESSAGE(STATUS "Detected GNUC Compiler...")
|
||||||
@@ -127,40 +129,41 @@ IF(CMAKE_COMPILER_IS_GNUCXX OR MINGW)
|
|||||||
# ENDIF()
|
# ENDIF()
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
#SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
|
|
||||||
#MESSAGE(STATUS "*TEST: Checking for max SSE LEVEL [${FORCE_MAX_SSE_LEVEL}]")
|
|
||||||
|
|
||||||
OPTION(FORCE_STREFLOP_SOFTWRAPPER "Set the streflop library to be forced to use the software emulator" OFF)
|
|
||||||
IF(NOT FORCE_MAX_SSE_LEVEL AND NOT FORCE_STREFLOP_SOFTWRAPPER)
|
|
||||||
SET(FORCE_MAX_SSE_LEVEL "1" CACHE STRING "Set the max SSE level to use if supported (0-3)")
|
|
||||||
ENDIF()
|
|
||||||
|
|
||||||
IF(NOT FORCE_STREFLOP_SOFTWRAPPER)
|
|
||||||
MESSAGE(STATUS "*NOTE: Checking for max SSE LEVEL [${FORCE_MAX_SSE_LEVEL}]")
|
|
||||||
special_check_for_sse( ${FORCE_MAX_SSE_LEVEL} )
|
|
||||||
ENDIF()
|
|
||||||
|
|
||||||
IF(WANT_USE_STREFLOP)
|
IF(WANT_USE_STREFLOP)
|
||||||
|
OPTION(FORCE_STREFLOP_SOFTWRAPPER "Set the streflop library to be forced to use the software emulator" OFF)
|
||||||
|
IF(NOT FORCE_MAX_SSE_LEVEL AND NOT FORCE_STREFLOP_SOFTWRAPPER)
|
||||||
|
SET(FORCE_MAX_SSE_LEVEL "1" CACHE STRING "Set the max SSE level to use if supported (0-3)")
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
IF(NOT FORCE_STREFLOP_SOFTWRAPPER)
|
||||||
|
MESSAGE(STATUS "*NOTE: Checking for max SSE LEVEL [${FORCE_MAX_SSE_LEVEL}]")
|
||||||
|
special_check_for_sse( ${FORCE_MAX_SSE_LEVEL} )
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
ADD_DEFINITIONS("-DUSE_STREFLOP -DSTREFLOP_RANDOM_GEN_SIZE=32 -DLIBM_COMPILING_FLT32 -DN_SPECIALIZED=32")
|
ADD_DEFINITIONS("-DUSE_STREFLOP -DSTREFLOP_RANDOM_GEN_SIZE=32 -DLIBM_COMPILING_FLT32 -DN_SPECIALIZED=32")
|
||||||
|
|
||||||
IF(HAS_SSE_EXTENSIONS AND NOT ${FORCE_MAX_SSE_LEVEL} MATCHES "0" AND NOT FORCE_STREFLOP_SOFTWRAPPER)
|
IF(HAS_SSE_EXTENSIONS AND NOT ${FORCE_MAX_SSE_LEVEL} MATCHES "0" AND NOT FORCE_STREFLOP_SOFTWRAPPER)
|
||||||
ADD_DEFINITIONS("-DSTREFLOP_SSE")
|
ADD_DEFINITIONS("-DSTREFLOP_SSE")
|
||||||
MESSAGE(STATUS "*NOTE: using SSE for STREFLOP.")
|
MESSAGE(STATUS "*NOTE: using SSE for STREFLOP.")
|
||||||
ELSE()
|
ELSE()
|
||||||
IF(NOT FORCE_STREFLOP_SOFTWRAPPER)
|
IF(NOT FORCE_STREFLOP_SOFTWRAPPER)
|
||||||
special_check_for_x87()
|
special_check_for_x87()
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
IF(HAS_X87_SUPPORT AND NOT FORCE_STREFLOP_SOFTWRAPPER)
|
IF(HAS_X87_SUPPORT AND NOT FORCE_STREFLOP_SOFTWRAPPER)
|
||||||
ADD_DEFINITIONS("-DSTREFLOP_X87")
|
ADD_DEFINITIONS("-DSTREFLOP_X87")
|
||||||
MESSAGE(STATUS "*NOTE: using X87 for STREFLOP.")
|
MESSAGE(STATUS "*NOTE: using X87 for STREFLOP.")
|
||||||
ELSE()
|
ELSE()
|
||||||
ADD_DEFINITIONS("-DSTREFLOP_SOFT")
|
ADD_DEFINITIONS("-DSTREFLOP_SOFT")
|
||||||
MESSAGE(STATUS "*NOTE: using SOFT emulation for STREFLOP.")
|
MESSAGE(STATUS "*NOTE: using SOFT emulation for STREFLOP.")
|
||||||
ENDIF()
|
ENDIF()
|
||||||
ENDIF()
|
ENDIF()
|
||||||
ELSE()
|
ELSE()
|
||||||
MESSAGE(STATUS "*WARNING: Disabled use of STREFLOP! Out of synchs may occur")
|
# We are temporarily trying to build without streflop. If out-of-syncs
|
||||||
|
# become a problem, we'll probably replace streflop with libmpc or mpf4
|
||||||
|
#
|
||||||
|
# MESSAGE(STATUS "*WARNING: Disabled use of STREFLOP! Out of synchs may occur")
|
||||||
|
MESSAGE(STATUS "libstreflop disabled")
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
include(CheckCXXSourceRuns)
|
include(CheckCXXSourceRuns)
|
||||||
@@ -312,15 +315,19 @@ IF(EXISTS "${PROJECT_SOURCE_DIR}/source/")
|
|||||||
ADD_SUBDIRECTORY( ${PROJECT_SOURCE_DIR}/source/tests )
|
ADD_SUBDIRECTORY( ${PROJECT_SOURCE_DIR}/source/tests )
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
# Check if data exist
|
#
|
||||||
IF(EXISTS "${PROJECT_SOURCE_DIR}/data/glest_game/CMakeLists.txt")
|
# Check if data exists
|
||||||
|
# The option to actually install data is set in the data CMakeLists.txt
|
||||||
|
# file. It defaults to OFF. The INSTALL_DIR_DATA path is always set
|
||||||
|
# regardless (because of the rules above) and is defined as the macro DATADIR
|
||||||
|
# at compile-time. That allows the binary to find the data no matter
|
||||||
|
# where it is, and whether or not it has actually been installed
|
||||||
|
#
|
||||||
|
IF(EXISTS "${PROJECT_SOURCE_DIR}/../zetaglest-data/CMakeLists.txt")
|
||||||
MESSAGE(STATUS "**Found game data.")
|
MESSAGE(STATUS "**Found game data.")
|
||||||
ADD_SUBDIRECTORY( ${PROJECT_SOURCE_DIR}/data/glest_game )
|
ADD_SUBDIRECTORY(${PROJECT_SOURCE_DIR}/../zetaglest-data $CMAKE_BINARY_DIR/data)
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
#get_directory_property( DirDefs COMPILE_DEFINITIONS )
|
|
||||||
#MESSAGE(STATUS ">>>> NOTICE Compiler definitions used: ${DirDefs}")
|
|
||||||
#MESSAGE(STATUS "END of compile defs...")
|
|
||||||
IF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
IF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
||||||
MESSAGE(WARNING ">> CLANG is NOT currently compatible as it does not support the following essential GCC compiler settings: -frounding-math -fsignaling-nans")
|
MESSAGE(WARNING ">> CLANG is NOT currently compatible as it does not support the following essential GCC compiler settings: -frounding-math -fsignaling-nans")
|
||||||
ENDIF()
|
ENDIF()
|
||||||
@@ -329,8 +336,6 @@ get_directory_property( DirDefs DIRECTORY ${CMAKE_SOURCE_DIR} COMPILE_DEFINITION
|
|||||||
foreach( d ${DirDefs} )
|
foreach( d ${DirDefs} )
|
||||||
message( STATUS "=====> Found Define: " ${d} )
|
message( STATUS "=====> Found Define: " ${d} )
|
||||||
endforeach()
|
endforeach()
|
||||||
#MESSAGE( STATUS "=====> DirDefs: " ${DirDefs} )
|
|
||||||
#MESSAGE(STATUS "*** Compiler definitions are [${COMPILE_DEFINITIONS}]")
|
|
||||||
|
|
||||||
MARK_AS_ADVANCED(${SDL_VERSION_NAME}MAIN_LIBRARY)
|
MARK_AS_ADVANCED(${SDL_VERSION_NAME}MAIN_LIBRARY)
|
||||||
MARK_AS_ADVANCED(${SDL_VERSION_NAME}_INCLUDE_DIR)
|
MARK_AS_ADVANCED(${SDL_VERSION_NAME}_INCLUDE_DIR)
|
||||||
|
@@ -5,40 +5,37 @@ OPTION(FORCE_EMBEDDED_LIBS "Force use of embedded libraries' code." OFF)
|
|||||||
|
|
||||||
add_definitions("-DDATADIR=${INSTALL_DIR_DATA}")
|
add_definitions("-DDATADIR=${INSTALL_DIR_DATA}")
|
||||||
|
|
||||||
# IMPORTANT: should come BEFORE finding packages
|
if(WANT_USE_STREFLOP)
|
||||||
find_package(PkgConfig REQUIRED)
|
# IMPORTANT: should come BEFORE finding packages
|
||||||
IF(FORCE_STREFLOP_SOFTWRAPPER)
|
find_package(PkgConfig REQUIRED)
|
||||||
pkg_search_module(STREFLOP streflop-soft)
|
IF(FORCE_STREFLOP_SOFTWRAPPER)
|
||||||
ELSE()
|
pkg_search_module(STREFLOP streflop-soft)
|
||||||
IF(HAS_SSE_EXTENSIONS AND NOT ${FORCE_MAX_SSE_LEVEL} MATCHES "0")
|
ELSE()
|
||||||
pkg_search_module(STREFLOP streflop-sse)
|
IF(HAS_SSE_EXTENSIONS AND NOT ${FORCE_MAX_SSE_LEVEL} MATCHES "0")
|
||||||
ELSE()
|
pkg_search_module(STREFLOP streflop-sse)
|
||||||
IF(HAS_X87_SUPPORT)
|
ELSE()
|
||||||
pkg_search_module(STREFLOP streflop-x87)
|
IF(HAS_X87_SUPPORT)
|
||||||
ELSE()
|
pkg_search_module(STREFLOP streflop-x87)
|
||||||
pkg_search_module(STREFLOP streflop-soft)
|
ELSE()
|
||||||
ENDIF()
|
pkg_search_module(STREFLOP streflop-soft)
|
||||||
ENDIF()
|
ENDIF()
|
||||||
ENDIF()
|
ENDIF()
|
||||||
IF(NOT STREFLOP_FOUND)
|
ENDIF()
|
||||||
pkg_search_module(STREFLOP streflop)
|
IF(NOT STREFLOP_FOUND)
|
||||||
ENDIF()
|
pkg_search_module(STREFLOP streflop)
|
||||||
MESSAGE(STATUS "Search for Library STREFLOP result = ${STREFLOP_FOUND} libs: ${STREFLOP_LIBRARIES} include dirs: ${STREFLOP_INCLUDE_DIRS}")
|
ENDIF()
|
||||||
|
MESSAGE(STATUS "Search for Library STREFLOP result = ${STREFLOP_FOUND} libs: ${STREFLOP_LIBRARIES} include dirs: ${STREFLOP_INCLUDE_DIRS}")
|
||||||
IF(FORCE_EMBEDDED_LIBS)
|
IF(FORCE_EMBEDDED_LIBS)
|
||||||
SET(STREFLOP_FOUND OFF)
|
SET(STREFLOP_FOUND OFF)
|
||||||
MESSAGE(STATUS "FORCING USE of EMBEDDED Libraries...")
|
MESSAGE(STATUS "FORCING USE of EMBEDDED Libraries...")
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
IF(NOT STREFLOP_FOUND)
|
||||||
IF(WANT_USE_STREFLOP)
|
ADD_SUBDIRECTORY(sources/streflop)
|
||||||
IF(NOT STREFLOP_FOUND)
|
ELSE()
|
||||||
ADD_SUBDIRECTORY(sources/streflop)
|
INCLUDE_DIRECTORIES(${STREFLOP_INCLUDE_DIRS} ${STREFLOP_INCLUDE_DIRS}/streflop)
|
||||||
ELSE()
|
SET(EXTERNAL_LIBS ${EXTERNAL_LIBS} ${STREFLOP_LIBRARIES})
|
||||||
INCLUDE_DIRECTORIES(${STREFLOP_INCLUDE_DIRS} ${STREFLOP_INCLUDE_DIRS}/streflop)
|
|
||||||
SET(EXTERNAL_LIBS ${EXTERNAL_LIBS} ${STREFLOP_LIBRARIES})
|
|
||||||
|
|
||||||
ADD_DEFINITIONS("-DUSE_STREFLOP_PKG")
|
ADD_DEFINITIONS("-DUSE_STREFLOP_PKG")
|
||||||
ENDIF()
|
ENDIF()
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
#########################################################################################
|
#########################################################################################
|
||||||
|
Reference in New Issue
Block a user