Merged: From default to sound_dev

This commit is contained in:
kaetemi 2012-04-12 18:21:26 +02:00
commit 52fcb148f2
2 changed files with 70 additions and 16 deletions

View file

@ -54,10 +54,14 @@ ELSE(MYSQL_INCLUDE_DIR AND MYSQL_LIBRARIES)
IF(MYSQL_INCLUDE_DIR)
IF(MYSQL_LIBRARY_RELEASE)
SET(MYSQL_LIBRARIES "optimized;${MYSQL_LIBRARY_RELEASE}")
SET(MYSQL_LIBRARIES optimized ${MYSQL_LIBRARY_RELEASE})
IF(MYSQL_LIBRARY_DEBUG)
SET(MYSQL_LIBRARIES "${MYSQL_LIBRARIES};debug;${MYSQL_LIBRARY_DEBUG}")
SET(MYSQL_LIBRARIES ${MYSQL_LIBRARIES} debug ${MYSQL_LIBRARY_DEBUG})
ENDIF(MYSQL_LIBRARY_DEBUG)
FIND_PACKAGE(OpenSSL)
IF(OPENSSL_FOUND)
SET(MYSQL_LIBRARIES ${MYSQL_LIBRARIES} ${OPENSSL_LIBRARIES})
ENDIF(OPENSSL_FOUND)
ENDIF(MYSQL_LIBRARY_RELEASE)
ENDIF(MYSQL_INCLUDE_DIR)

View file

@ -1,3 +1,11 @@
# Force Release configuration for compiler checks
SET(CMAKE_TRY_COMPILE_CONFIGURATION "Release")
# Force Release configuration by default
IF(NOT CMAKE_BUILD_TYPE)
SET(CMAKE_BUILD_TYPE "Release" CACHE STRING "" FORCE)
ENDIF(NOT CMAKE_BUILD_TYPE)
###
# Helper macro that generates .pc and installs it.
# Argument: name - the name of the .pc package, e.g. "nel-pacs.pc"
@ -5,7 +13,11 @@
MACRO(NL_GEN_PC name)
IF(NOT WIN32 AND WITH_INSTALL_LIBRARIES)
CONFIGURE_FILE(${name}.in "${CMAKE_CURRENT_BINARY_DIR}/${name}")
INSTALL(FILES "${CMAKE_CURRENT_BINARY_DIR}/${name}" DESTINATION lib/pkgconfig)
IF(CMAKE_LIBRARY_ARCHITECTURE)
INSTALL(FILES "${CMAKE_CURRENT_BINARY_DIR}/${name}" DESTINATION lib/${CMAKE_LIBRARY_ARCHITECTURE}/pkgconfig)
ELSE(CMAKE_LIBRARY_ARCHITECTURE)
INSTALL(FILES "${CMAKE_CURRENT_BINARY_DIR}/${name}" DESTINATION lib/pkgconfig)
ENDIF(CMAKE_LIBRARY_ARCHITECTURE)
ENDIF(NOT WIN32 AND WITH_INSTALL_LIBRARIES)
ENDMACRO(NL_GEN_PC)
@ -230,6 +242,17 @@ MACRO(NL_SETUP_DEFAULT_OPTIONS)
###
# Optional support
###
# Check if CMake is launched from a Debian packaging script
SET(DEB_HOST_GNU_CPU $ENV{DEB_HOST_GNU_CPU})
# Don't strip if generating a .deb
IF(DEB_HOST_GNU_CPU)
OPTION(WITH_SYMBOLS "Keep debug symbols in binaries" ON )
ELSE(DEB_HOST_GNU_CPU)
OPTION(WITH_SYMBOLS "Keep debug symbols in binaries" OFF)
ENDIF(DEB_HOST_GNU_CPU)
IF(WIN32)
OPTION(WITH_STLPORT "With STLport support." ON )
ELSE(WIN32)
@ -388,12 +411,20 @@ MACRO(NL_SETUP_BUILD)
ENDIF(TARGET_CPU STREQUAL "x86_64")
# Fix library paths suffixes for Debian MultiArch
IF(NOT CMAKE_LIBRARY_ARCHITECTURE)
SET(CMAKE_LIBRARY_ARCHITECTURE $ENV{DEB_HOST_MULTIARCH})
ENDIF(NOT CMAKE_LIBRARY_ARCHITECTURE)
SET(DEBIAN_MULTIARCH $ENV{DEB_HOST_MULTIARCH})
IF(DEBIAN_MULTIARCH)
SET(CMAKE_LIBRARY_ARCHITECTURE ${DEBIAN_MULTIARCH})
ENDIF(DEBIAN_MULTIARCH)
IF(CMAKE_LIBRARY_ARCHITECTURE)
SET(CMAKE_LIBRARY_PATH "/lib/${CMAKE_LIBRARY_ARCHITECTURE};/usr/lib/${CMAKE_LIBRARY_ARCHITECTURE};${CMAKE_LIBRARY_PATH}")
SET(CMAKE_LIBRARY_PATH /lib/${CMAKE_LIBRARY_ARCHITECTURE} /usr/lib/${CMAKE_LIBRARY_ARCHITECTURE} ${CMAKE_LIBRARY_PATH})
IF(TARGET_X64)
SET(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} /lib64 /usr/lib64)
ENDIF(TARGET_X64)
IF(TARGET_X86)
SET(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} /lib32 /usr/lib32)
ENDIF(TARGET_X86)
ENDIF(CMAKE_LIBRARY_ARCHITECTURE)
IF(MSVC)
@ -416,10 +447,10 @@ MACRO(NL_SETUP_BUILD)
MESSAGE(FATAL_ERROR "Can't determine compiler version ${MSVC_VERSION}")
ENDIF(MSVC10)
SET(PLATFORM_CFLAGS "${PLATFORM_CFLAGS} /D_CRT_SECURE_NO_WARNINGS /D_CRT_NONSTDC_NO_WARNINGS /DWIN32 /D_WINDOWS /W3 /Zi /Zm1000 /MP /Gy-")
SET(PLATFORM_CFLAGS "${PLATFORM_CFLAGS} /D_CRT_SECURE_NO_WARNINGS /D_CRT_NONSTDC_NO_WARNINGS /DWIN32 /D_WINDOWS /W3 /Zm1000 /MP /Gy-")
# Common link flags
SET(PLATFORM_LINKFLAGS "-DEBUG")
SET(PLATFORM_LINKFLAGS "")
IF(TARGET_X64)
# Fix a bug with Intellisense
@ -434,10 +465,17 @@ MACRO(NL_SETUP_BUILD)
# Exceptions are only set for C++
SET(PLATFORM_CXXFLAGS "${PLATFORM_CFLAGS} /EHa")
SET(NL_DEBUG_CFLAGS "/MDd /RTC1 /D_DEBUG ${MIN_OPTIMIZATIONS}")
SET(NL_RELEASE_CFLAGS "/MD /D NDEBUG ${SPEED_OPTIMIZATIONS}")
SET(NL_DEBUG_LINKFLAGS "/NODEFAULTLIB:msvcrt /INCREMENTAL:YES")
SET(NL_RELEASE_LINKFLAGS "/OPT:REF /OPT:ICF /INCREMENTAL:NO")
IF(WITH_SYMBOLS)
SET(NL_RELEASE_CFLAGS "/Zi ${NL_RELEASE_CFLAGS}")
SET(NL_RELEASE_LINKFLAGS "/DEBUG ${NL_RELEASE_LINKFLAGS}")
ELSE(WITH_SYMBOLS)
SET(NL_RELEASE_LINKFLAGS "/RELEASE ${NL_RELEASE_LINKFLAGS}")
ENDIF(WITH_SYMBOLS)
SET(NL_DEBUG_CFLAGS "/Zi /MDd /RTC1 /D_DEBUG ${MIN_OPTIMIZATIONS} ${NL_DEBUG_CFLAGS}")
SET(NL_RELEASE_CFLAGS "/MD /DNDEBUG ${SPEED_OPTIMIZATIONS} ${NL_RELEASE_CFLAGS}")
SET(NL_DEBUG_LINKFLAGS "/DEBUG /OPT:NOREF /OPT:NOICF /NODEFAULTLIB:msvcrt /INCREMENTAL:YES ${NL_DEBUG_LINKFLAGS}")
SET(NL_RELEASE_LINKFLAGS "/OPT:REF /OPT:ICF /INCREMENTAL:NO ${NL_RELEASE_LINKFLAGS}")
ELSE(MSVC)
IF(HOST_CPU STREQUAL "x86_64" AND TARGET_CPU STREQUAL "x86")
SET(PLATFORM_CFLAGS "${PLATFORM_CFLAGS} -m32 -march=i686")
@ -447,7 +485,11 @@ MACRO(NL_SETUP_BUILD)
SET(PLATFORM_CFLAGS "${PLATFORM_CFLAGS} -m64")
ENDIF(HOST_CPU STREQUAL "x86" AND TARGET_CPU STREQUAL "x86_64")
SET(PLATFORM_CFLAGS "${PLATFORM_CFLAGS} -g -D_REENTRANT -pipe -ftemplate-depth-48 -Wall -ansi -W -Wpointer-arith -Wsign-compare -Wno-deprecated-declarations -Wno-multichar -Wno-unused -fno-strict-aliasing")
SET(PLATFORM_CFLAGS "${PLATFORM_CFLAGS} -D_REENTRANT -pipe -ftemplate-depth-48 -Wall -W -Wpointer-arith -Wsign-compare -Wno-deprecated-declarations -Wno-multichar -Wno-unused -fno-strict-aliasing")
IF(NOT ${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang")
SET(PLATFORM_CFLAGS "${PLATFORM_CFLAGS} -ansi")
ENDIF(NOT ${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang")
IF(WITH_COVERAGE)
SET(PLATFORM_CFLAGS "-fprofile-arcs -ftest-coverage ${PLATFORM_CFLAGS}")
@ -468,8 +510,16 @@ MACRO(NL_SETUP_BUILD)
SET(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -Wl,--no-undefined -Wl,--as-needed")
ENDIF(NOT APPLE)
SET(NL_DEBUG_CFLAGS "-DNL_DEBUG -D_DEBUG")
SET(NL_RELEASE_CFLAGS "-DNL_RELEASE -DNDEBUG -O3")
IF(WITH_SYMBOLS)
SET(NL_RELEASE_CFLAGS "${NL_RELEASE_CFLAGS} -g")
ELSE(WITH_SYMBOLS)
IF(NOT ${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang")
SET(NL_RELEASE_LINKFLAGS "-Wl,-s ${NL_RELEASE_LINKFLAGS}")
ENDIF(NOT ${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang")
ENDIF(WITH_SYMBOLS)
SET(NL_DEBUG_CFLAGS "-DNL_DEBUG -D_DEBUG ${NL_DEBUG_CFLAGS}")
SET(NL_RELEASE_CFLAGS "-DNL_RELEASE -DNDEBUG -O3 ${NL_RELEASE_CFLAGS}")
ENDIF(MSVC)
ENDMACRO(NL_SETUP_BUILD)