[poppler] CMakeLists.txt cmake/modules

Pino Toscano pino at kemper.freedesktop.org
Wed Jan 30 15:12:26 PST 2008


 CMakeLists.txt                    |    7 -------
 cmake/modules/PopplerMacros.cmake |   29 +++++++++++++++++++++++++++++
 2 files changed, 29 insertions(+), 7 deletions(-)

New commits:
commit 19da87a20b3906523a330e3c956903a58a3ede7f
Author: Pino Toscano <pino at kde.org>
Date:   Thu Jan 31 00:11:58 2008 +0100

    Support the different CMake build modes.
    
    Now you can specify (using -DCMAKE_BUILD_TYPE=type) a CMake build type to have GCC or ICC w/ tuned C(XX)FLAGS.
    The supported build types are: None (as in no type is specified on command line), RelWithDebInfo, Release, Debug, DebugFull, Profile.

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7d468a0..97850f7 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -35,13 +35,6 @@ set(QT3_MIN_VERSION "3.3.0")
 set(QT4_MIN_VERSION "4.1.0")
 set(CAIRO_VERSION "1.4")
 
-# set the default compile warnings
-if(CMAKE_COMPILER_IS_GNUCXX)
-  set(DEFAULT_COMPILE_WARNINGS_NO)
-  set(DEFAULT_COMPILE_WARNINGS_YES "-Wall -Wno-write-strings")
-  set(DEFAULT_COMPILE_WARNINGS_KDE "-Wnon-virtual-dtor -Wno-long-long -Wundef -ansi -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -Wcast-align -Wconversion -Wchar-subscripts -Wall -W -Wpointer-arith -Wwrite-strings -O2 -Wformat-security -Wmissing-format-attribute -fno-exceptions -fno-check-new -fno-common")
-endif(CMAKE_COMPILER_IS_GNUCXX)
-
 macro_bool_to_01(ENABLE_SPLASH HAVE_SPLASH)
 find_package(Freetype REQUIRED)
 find_package(Fontconfig REQUIRED)
diff --git a/cmake/modules/PopplerMacros.cmake b/cmake/modules/PopplerMacros.cmake
index 4531bcf..f2a5290 100644
--- a/cmake/modules/PopplerMacros.cmake
+++ b/cmake/modules/PopplerMacros.cmake
@@ -81,3 +81,32 @@ if(WIN32)
                                 "${CMAKE_INSTALL_PREFIX}/bin" )
 endif(WIN32)
 
+if(CMAKE_COMPILER_IS_GNUCXX)
+  # set the default compile warnings
+  set(DEFAULT_COMPILE_WARNINGS_NO)
+  set(DEFAULT_COMPILE_WARNINGS_YES "-Wall -Wno-write-strings")
+  set(DEFAULT_COMPILE_WARNINGS_KDE "-Wnon-virtual-dtor -Wno-long-long -Wundef -ansi -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -Wcast-align -Wconversion -Wchar-subscripts -Wall -W -Wpointer-arith -Wwrite-strings -O2 -Wformat-security -Wmissing-format-attribute -fno-exceptions -fno-check-new -fno-common")
+
+  set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g")
+  set(CMAKE_CXX_FLAGS_RELEASE        "-O2 -DNDEBUG")
+  set(CMAKE_CXX_FLAGS_DEBUG          "-g -O2 -fno-reorder-blocks -fno-schedule-insns -fno-inline")
+  set(CMAKE_CXX_FLAGS_DEBUGFULL      "-g3 -fno-inline")
+  set(CMAKE_CXX_FLAGS_PROFILE        "-g3 -fno-inline -ftest-coverage -fprofile-arcs")
+  set(CMAKE_C_FLAGS_RELWITHDEBINFO   "-O2 -g")
+  set(CMAKE_C_FLAGS_RELEASE          "-O2 -DNDEBUG")
+  set(CMAKE_C_FLAGS_DEBUG            "-g -O2 -fno-reorder-blocks -fno-schedule-insns -fno-inline")
+  set(CMAKE_C_FLAGS_DEBUGFULL        "-g3 -fno-inline")
+  set(CMAKE_C_FLAGS_PROFILE          "-g3 -fno-inline -ftest-coverage -fprofile-arcs")
+endif (CMAKE_COMPILER_IS_GNUCXX)
+
+if(CMAKE_C_COMPILER MATCHES "icc")
+  set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g")
+  set(CMAKE_CXX_FLAGS_RELEASE        "-O2 -DNDEBUG")
+  set(CMAKE_CXX_FLAGS_DEBUG          "-O2 -g -0b0 -noalign")
+  set(CMAKE_CXX_FLAGS_DEBUGFULL      "-g -Ob0 -noalign")
+  set(CMAKE_C_FLAGS_RELWITHDEBINFO   "-O2 -g")
+  set(CMAKE_C_FLAGS_RELEASE          "-O2 -DNDEBUG")
+  set(CMAKE_C_FLAGS_DEBUG            "-O2 -g -Ob0 -noalign")
+  set(CMAKE_C_FLAGS_DEBUGFULL        "-g -Ob0 -noalign")
+endif(CMAKE_C_COMPILER MATCHES "icc")
+


More information about the poppler mailing list