[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kdevelop-bugs
Subject:    [Bug 224463] Choice to enable Autocompletion #defined or not datas
From:       Moky <mgharbi () laas ! fr>
Date:       2010-01-27 14:01:56
Message-ID: 20100127140156.C25A931954 () immanuel ! kde ! org
[Download RAW message or body]

https://bugs.kde.org/show_bug.cgi?id=224463





--- Comment #5 from Moky <mgharbi laas fr>  2010-01-27 15:01:54 ---
Before using CMake I had custom makefiles. And We pass -D<VAR> option to Gcc.
And I already have the bug. So I do not think it is linked to cmake.

Sorry but I can not share My project. But I can share a light structure of
cmake files.


CMakeLists.txt

SET(BM3D_CompilationFlags "")

MACRO(BM3D_flag flagName description status)
  SET(flagName "${flagName}")
  SET(description "${description}")
  SET(status "${status}")
  OPTION(${flagName} ${description} ${status})
  LIST(APPEND BM3D_CompilationFlags ${flagName})
ENDMACRO(BM3D_flag)

MACRO(BM3D_CheckCompilationFlags)
  MESSAGE ("Active Flags :")
  FOREACH(flag ${BM3D_CompilationFlags})
    IF(${flag})
      MESSAGE("${flag}")
      ADD_DEFINITIONS("-D${flag}")
    ENDIF()
  ENDFOREACH(flag)
ENDMACRO(BM3D_CheckCompilationFlags)


#flag example
BM3D_flag(PQP "To compile with PQP (Proximity Query Package) collision library"
OFF)
BM3D_flag(USE_CLAPACK "Mathematic Library" OFF)

BM3D_CheckCompilationFlags()

SET(BM3D_src "")

IF(PQP)
  LIST(APPEND BM3D_src "./src/pqp.c")
ENDIF(PQP)

LIST(APPEND BM3D_src "./src/main.c")

SET(CMAKE_C_COMPILER g++)

ADD_DEFINITIONS(-DUNIX)
ADD_DEFINITIONS(-g -Wall -Wno-unknown-pragmas)
ADD_EXECUTABLE(Foo ${BM3D_src})

the pqp.c file is compiled only when the flag PQP is on. So inside main.c we
have functions like :

void foo (void){
 int i = 0;
 #ifdef PQP
 printf("I'm using PQP\n");
 #endif
 printf("end of file\n");
}

-- 
Configure bugmail: https://bugs.kde.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

_______________________________________________
KDevelop-bugs mailing list
KDevelop-bugs@kdevelop.org
https://barney.cs.uni-potsdam.de/mailman/listinfo/kdevelop-bugs
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic