Zitat von Matthias Moeller <[email protected]>:
I try to write a cmake file for some external library (from the sparse suite). In the provided makefile a single source file is compiled twice with different compiler flags, e.g., $(C) -DDINT -c ../Source/amd_aat.c -o amd_i_aat.o $(C) -DDLONG -c ../Source/amd_aat.c -o amd_l_aat.o and finally all object files are combined in a single library.
That is really not good style. It is much easier and more explicit to do _in_the_code_ what you need. Done hide it in the build system:
amd_i_aat.c: #define DINT #include "amd_aat.c" amd_l_aat.c: #define DLONG #include "amd_aat.c" Then only add those two to your target. HS _______________________________________________ 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
