[Cmake] beginner question
Brad King
brad.king at kitware.com
Mon, 19 Apr 2004 09:48:19 -0400
Lucas Lorenzo wrote:
> Hi all,
>
> I'm working with ITK. I'm adding some member functions to some classes
> already existing so, what I'm doing is to make a copy of the .h and
> .txx files into my application directory and I'm performing the changes
> onto these copied files.
>
> In particular, I'm working with a parent and a derived class. In my
> application I'm including the .h file for the derived class and I'm
> defining an object of the derived class.
>
> My problem is that changes in the .h file of the derived class seemed to
> be taken into account by the compiler but when I make a change in the
> parent class .h file nothing happens. It's like it is still looking at
> the .h file in the ITK include directory (even though the path for my
> copied .h files is been included).
The include path is probably finding the original version of the header
file first. Try adding
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
to your CMakeLists.txt file before the FIND_PACKAGE(ITK) and related
lines. This should fix the include directory ordering.
-Brad