From e69f62f7b7c93b3cd3f3cdfcaa07e19ea7e6fe13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20K=C3=BCmmel?= Date: Fri, 19 Aug 2011 18:04:41 +0000 Subject: [PATCH] cmake: fix buggy profile option handling git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@39494 a592a061-630c-0410-9148-cb99ea01b6c8 --- CMakeLists.txt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c2dce134c2..bcdff225ed 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -97,6 +97,7 @@ LYX_OPTION(DEBUG_GLIBC "Enable libstdc++ debug mode" OFF GCC) LYX_OPTION(DEBUG_GLIBC_PEDANTIC "Enable libstdc++pedantic debug mode" OFF GCC) LYX_OPTION(STDLIB_DEBUG "Use debug stdlib" OFF GCC) LYX_OPTION(CONCEPT_CHECKS "Enable concept-checks" OFF GCC) +LYX_OPTION(PROFILE "Build with options for gprof" OFF GCC) # MSVC specific LYX_OPTION(CONSOLE "Show console on Windows" ON MSVC) @@ -361,10 +362,10 @@ set(LYX_MOC_FILES moc_*.cpp) include(ProjectSourceGroup) -if(NOT MSVC) +if(LYX_PROFILE AND NOT MSVC) set(CMAKE_BUILD_TYPE Profile CACHE TYPE STRING FORCE) - set(CMAKE_CXX_FLAGS_PROFILE "${CMAKE_CXX_FLAGS_RELEASE} -pg" CACHE TYPE STRING FORCE) - set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pg" CACHE TYPE STRING FORCE) + set(CMAKE_CXX_FLAGS_PROFILE "${CMAKE_CXX_FLAGS_RELEASE} -pg") + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pg") else() set(LYX_PROFILE OFF) endif()