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:
andy5995
2018-09-26 01:03:16 -05:00
parent 4e90adfd84
commit 64bcd0af37
2 changed files with 73 additions and 71 deletions

View File

@@ -1,6 +1,8 @@
CMAKE_MINIMUM_REQUIRED( VERSION 2.8.2 )
PROJECT( ZetaGlest )
# Mathu, could you update this comment please?
#
#SET(CMAKE_VERBOSE_MAKEFILE ON)
#
@@ -127,9 +129,7 @@ IF(CMAKE_COMPILER_IS_GNUCXX OR MINGW)
# ENDIF()
ENDIF()
#SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
#MESSAGE(STATUS "*TEST: Checking for max SSE LEVEL [${FORCE_MAX_SSE_LEVEL}]")
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)")
@@ -140,7 +140,6 @@ IF(CMAKE_COMPILER_IS_GNUCXX OR MINGW)
special_check_for_sse( ${FORCE_MAX_SSE_LEVEL} )
ENDIF()
IF(WANT_USE_STREFLOP)
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)
@@ -160,7 +159,11 @@ IF(CMAKE_COMPILER_IS_GNUCXX OR MINGW)
ENDIF()
ENDIF()
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()
include(CheckCXXSourceRuns)
@@ -312,15 +315,19 @@ IF(EXISTS "${PROJECT_SOURCE_DIR}/source/")
ADD_SUBDIRECTORY( ${PROJECT_SOURCE_DIR}/source/tests )
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.")
ADD_SUBDIRECTORY( ${PROJECT_SOURCE_DIR}/data/glest_game )
ADD_SUBDIRECTORY(${PROJECT_SOURCE_DIR}/../zetaglest-data $CMAKE_BINARY_DIR/data)
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")
MESSAGE(WARNING ">> CLANG is NOT currently compatible as it does not support the following essential GCC compiler settings: -frounding-math -fsignaling-nans")
ENDIF()
@@ -329,8 +336,6 @@ get_directory_property( DirDefs DIRECTORY ${CMAKE_SOURCE_DIR} COMPILE_DEFINITION
foreach( d ${DirDefs} )
message( STATUS "=====> Found Define: " ${d} )
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}_INCLUDE_DIR)

View File

@@ -5,6 +5,7 @@ OPTION(FORCE_EMBEDDED_LIBS "Force use of embedded libraries' code." OFF)
add_definitions("-DDATADIR=${INSTALL_DIR_DATA}")
if(WANT_USE_STREFLOP)
# IMPORTANT: should come BEFORE finding packages
find_package(PkgConfig REQUIRED)
IF(FORCE_STREFLOP_SOFTWRAPPER)
@@ -24,19 +25,15 @@ IF(NOT STREFLOP_FOUND)
pkg_search_module(STREFLOP streflop)
ENDIF()
MESSAGE(STATUS "Search for Library STREFLOP result = ${STREFLOP_FOUND} libs: ${STREFLOP_LIBRARIES} include dirs: ${STREFLOP_INCLUDE_DIRS}")
IF(FORCE_EMBEDDED_LIBS)
SET(STREFLOP_FOUND OFF)
MESSAGE(STATUS "FORCING USE of EMBEDDED Libraries...")
ENDIF()
IF(WANT_USE_STREFLOP)
IF(NOT STREFLOP_FOUND)
ADD_SUBDIRECTORY(sources/streflop)
ELSE()
INCLUDE_DIRECTORIES(${STREFLOP_INCLUDE_DIRS} ${STREFLOP_INCLUDE_DIRS}/streflop)
SET(EXTERNAL_LIBS ${EXTERNAL_LIBS} ${STREFLOP_LIBRARIES})
ADD_DEFINITIONS("-DUSE_STREFLOP_PKG")
ENDIF()
ENDIF()