ADD_DEFINITIONS and kdevelop
Esben Mose Hansen
kde at mosehansen.dk
Sun May 9 19:54:38 BST 2010
On Wednesday 05 May 2010 17:38:59 Esben Mose Hansen wrote:
> Not public quite yet, and too much code anyway. But I will try to create a
> smallish example tomorrow.
Ok, baby got sick and all those things, but I have a minimal example now:
CMakeLists.txt:
PROJECT(cmaketest)
cmake_minimum_required(VERSION 2.8)
find_package(KDevPlatform)
IF (KDevPlatform_DIR)
add_definitions(-DHAVE_TEST)
ENDIF(KDevPlatform_DIR)
ADD_EXECUTABLE(cmaketest main.cpp)
main.cpp:
#include <iostream>
int main(int argc, char **argv) {
#ifdef HAVE_TEST
std::cout << "Ok, we have text!" << std::endl;
#endif
std::cout << "Hello, world!" << std::endl;
return 0;
}
It is quite obvious from the highlighting that the HAVE_TEST macro is
undefined. After some debugging ( and submitting a patch to a related issue ),
I note that find_package fails to define KDevPlatform_DIR upon completion
(While CMake defines it there). I don't know why, but I might look at it
soonish. At least I feel I know a bit about how to navigate the cmake
projectmanager now.
--
Kind regards, Esben
More information about the KDevelop
mailing list