Index: CMakeLists.txt @@ -21,11 +21,10 @@ find_package(SDL 1.2.7 REQUIRED) find_package(Boost 1.36 REQUIRED COMPONENTS iostreams program_options regex system) -# no, gettext executables are not required when NLS is deactivated +if(ENABLE_NLS) find_package(Gettext) -# yes, libintl is *required* even when NLS is deactivated (this is to compile -# src/gettext.cpp since it includes libintl.h) find_package(Libintl REQUIRED) +endif(ENABLE_NLS) find_package(X11) @@ -73,7 +72,7 @@ option(ENABLE_GAME "Enable compilation of the game" ON) option(ENABLE_CAMPAIGN_SERVER "Enable compilation of campaign server") option(ENABLE_SERVER "Enable compilation of server" ON) -option(ENABLE_TOOLS "Enable building and installation of tools for artists and WML maintainers") +option(ENABLE_TOOLS "Enable building and installation of tools for artists and WML maintainers" OFF) option(ENABLE_TESTS "Build unit tests") option(ENABLE_NLS "Enable building of translations" ON) option(ENABLE_POOL_ALLOC "Enable custom pool malloc" OFF) @@ -120,18 +119,18 @@ endif(ENABLE_STRICT_COMPILATION) # Strict compilation for C files is disabled until somebody wants to clean them. - set(CMAKE_C_FLAGS "-O2 -W -Wall -ansi $ENV{CFLAGS}" + set(CMAKE_C_FLAGS "-W -Wall -ansi $ENV{CFLAGS}" CACHE STRING "Flags used by the C compiler during normal builds." FORCE) - set(CMAKE_C_FLAGS_DEBUG "-O0 -DDEBUG -ggdb3 -W -Wall -ansi $ENV{CFLAGS}" + set(CMAKE_C_FLAGS_DEBUG "-DDEBUG -W -Wall -ansi $ENV{CFLAGS}" CACHE STRING "Flags used by the C compiler during debug builds." FORCE) - set(CMAKE_C_FLAGS_RELEASE "-O3 -DNDEBUG -W -Wall -ansi $ENV{CFLAGS} -Wno-unused" + set(CMAKE_C_FLAGS_RELEASE "-DNDEBUG -W -Wall -ansi $ENV{CFLAGS} -Wno-unused" CACHE STRING "Flags used by the C compiler during release builds." FORCE) - set(CMAKE_CXX_FLAGS "-O2 -W -Wall -std=c++98 ${STRICT_FLAGS} $ENV{CXXFLAGS}" + set(CMAKE_CXX_FLAGS "-W -Wall -std=c++98 ${STRICT_FLAGS} $ENV{CXXFLAGS}" CACHE STRING "Flags used by the CXX compiler during normal builds." FORCE) - set(CMAKE_CXX_FLAGS_DEBUG "-O0 -DDEBUG -ggdb3 -W -Wall -std=c++98 ${STRICT_FLAGS} $ENV{CXXFLAGS}" + set(CMAKE_CXX_FLAGS_DEBUG "-DDEBUG -W -Wall -std=c++98 ${STRICT_FLAGS} $ENV{CXXFLAGS}" CACHE STRING "Flags used by the CXX compiler during debug builds." FORCE) - set(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG -W -Wall -std=c++98 ${STRICT_FLAGS} $ENV{CXXFLAGS} -Wno-unused" + set(CMAKE_CXX_FLAGS_RELEASE "-DNDEBUG -W -Wall -std=c++98 ${STRICT_FLAGS} $ENV{CXXFLAGS} -Wno-unused" CACHE STRING "Flags used by the CXX compiler during release builds." FORCE) endif(NOT CONFIGURED) @@ -158,6 +157,11 @@ add_definitions(-D_X11) endif(X11_FOUND) +if(ENABLE_NLS) + set(CMAKE_C_FLAGS "-DENABLE_NLS ${CMAKE_C_FLAGS}") + set(CMAKE_CXX_FLAGS "-DENABLE_NLS ${CMAKE_CXX_FLAGS}") +endif(ENABLE_NLS) + add_definitions(-DLOCALEDIR=\\\"${LOCALEDIR}\\\") # When the path starts with a / on a Unix system it's an absolute path. @@ -165,6 +169,7 @@ if(LOCALEDIR MATCHES "^/") add_definitions(-DHAS_RELATIVE_LOCALEDIR=0) set(LOCALE_INSTALL ${LOCALEDIR}) + set(LOCALEDIR "translations") else(LOCALEDIR MATCHES "^/") add_definitions(-DHAS_RELATIVE_LOCALEDIR=1) set(LOCALE_INSTALL ${DATADIR}/${LOCALEDIR}) @@ -219,10 +224,14 @@ find_package( Boost 1.36 REQUIRED COMPONENTS unit_test_framework ) endif(ENABLE_TESTS) if(ENABLE_GAME) - find_package( FriBiDi ) + pkg_check_modules( FRIBIDI fribidi>=0.19.0 ) if(ENABLE_FRIBIDI AND FRIBIDI_LIBRARIES) add_definitions(-DHAVE_FRIBIDI) elseif(ENABLE_FRIBIDI AND NOT FRIBIDI_LIBRARIES) + pkg_check_modules( FRIBIDI fribidi ) + if(FRIBIDI_LIBRARIES) + add_definitions(-DOLD_FRIBIDI) + endif(FRIBIDI_LIBRARIES) message("Could not find FriBiDi. Disabling FriBiDi support.") endif()