Here is another problem I'm facing with the previous example :
If I do this : In C:\Maths : > Cmake -G"MinGW Makefiles" -DCMAKE_BUILD_TYPE=Release && make => builds > libMaths And after : In C:\HelloMath (assuming the cmake has been called before Maths build : > make => fails with the following output : C:\Math\CMakeFiles\Maths.dir\build.make:43: CMakeFiles/Maths.dir/depend.make: No such file or directory C:\Math\CMakeFiles\Maths.dir\build.make:46: CMakeFiles/Maths.dir/progress.make: No such file or directory C:\Math\CMakeFiles\Maths.dir\build.make:49: CMakeFiles/Maths.dir/flags.make: No such file or directory mingw32-make[2]: *** No rule to make target `CMakeFiles/Maths.dir/flags.make'. Stop. mingw32-make[1]: *** [C:/Math/CMakeFiles/Maths.dir/all] Error 2 mingw32-make: *** [all] Error 2 in build.make, the path of depend.make progress.make and flags.make is relative. In order to make the build work, I need it to be absolute (it is absolute when building HelloMath) Is there a way to make it absolute ? Thanks ! Pierre-Julien VILLOUD -----Message d'origine----- De : [email protected] [mailto:[email protected]] De la part de Pierre-Julien Villoud Envoyé : mardi 15 septembre 2009 10:17 À : Marcel Loose Cc : [email protected] Objet : Re: [CMake] add_subdirectory and build directory I found my problem Here are 2 CMakeLists.txt : =================================== CMakeLists.txt : libMaths : #Minimum Cmake version required cmake_minimum_required(VERSION 2.6) add_library(Maths MathFuncsLib.cpp ) =================================== =================================== CMakeLists.txt : HelloMath : #Minimum Cmake version required cmake_minimum_required(VERSION 2.6) include_directories(../Math) link_directories(../Math) add_executable(HelloMath hellomath.cpp ) target_link_libraries(HelloMath Maths ) add_subdirectory(../Math ../Math) =================================== My build process is the following : Cmake (...) && make And it's the cmake call that causes the problem : In C:\Maths : > Cmake -G"MinGW Makefiles" -DCMAKE_BUILD_TYPE=Release && make => builds > libMaths In C:\HelloMath : > Cmake -G"MinGW Makefiles" -DCMAKE_BUILD_TYPE=Release && make => builds > HelloMath AND builds libMaths (whereas it's up to date) because of the cmake > call. The following works : In C:\HelloMath : > Cmake -G"MinGW Makefiles" -DCMAKE_BUILD_TYPE=Release && make => builds > HelloMath AND builds libMaths because of the cmake call. In C:\Maths : > make => does not build libMaths since it's up to date. So I must try to remove the cmake call and it will be fine ! Sorry to have bothered you... Thanks ! Pierre-Julien VILLOUD
_______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
