From 5ff2493004dbdc1dd69547e27fa1fe838ea78b17 Mon Sep 17 00:00:00 2001 From: Saveliy Skresanov Date: Mon, 1 Apr 2013 17:12:59 +0700 Subject: [PATCH] Added renderer option (-DRenderer) and changed some things in bitness check. --- CMakeLists.txt | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index fee7f6163..63f56a55d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -24,25 +24,16 @@ include_directories(resources) include_directories(src) add_executable(powder ${powder_SRC}) - -# TODO: make "bitness" check if(CMAKE_SIZEOF_VOID_P EQUAL 8) add_definitions(-D_64BIT) - SET(CMAKE_CXX_FLAGS "-m64") - SET(CMAKE_C_FLAGS "-m64") - SET(CMAKE_EXE_LINKER_FLAGS "-m64") - SET(CMAKE_MODULE_LINKER_FLAGS "-m64") - SET(CMAKE_SHARED_LINKER_FLAGS "-m64") -else() - SET(CMAKE_CXX_FLAGS "-m32") - SET(CMAKE_C_FLAGS "-m32") - SET(CMAKE_EXE_LINKER_FLAGS "-m32") - SET(CMAKE_MODULE_LINKER_FLAGS "-m32") - SET(CMAKE_SHARED_LINKER_FLAGS "-m32") endif() -# Is that needed? -add_definitions(-DUSE_SDL) +option(Renderer "Compiles TPT for site previews rendering" OFF) +if(Renderer) + add_definitions(-DRENDERER) +else() + add_definitions(-DUSE_SDL) +endif() if(${CMAKE_SYSTEM_NAME} MATCHES "Linux") add_definitions(-DLIN) @@ -56,6 +47,7 @@ endif(${CMAKE_SYSTEM_NAME} MATCHES "Windows") if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") add_definitions(-DMACOSX) + #TODO: Include SDLMain.h and SDLMain.m endif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") @@ -127,6 +119,11 @@ target_link_libraries(powder ${BZIP2_LIBRARIES}) # zlib +if(PreferStatic) + set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_ONLY_STATIC}) + find_package(ZLIB) + set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_ORIG}) +endif(PreferStatic) if(NOT ZLIB_FOUND) find_package(ZLIB REQUIRED) endif(NOT ZLIB_FOUND)