I have the jpeglib library, built with cmake and visual studio 2005. And I also have a separate program that uses this library. How can I compile that program so that I can debug both program and library code?
My first attempt was by just including the main program's project into the libjpeg solution, changing include paths and specifying the path to libjpeg .lib
. This worked, but when I rerun cmake, I have to redo that. I described it here: https://board.flatassembler.net/topic.php?p=203834#203834
How can I compile those two programs using cmake itself? I tried adding this in the libjpeg CMakeList.txt :
add_executable(_main--ddraw main.cpp)
set_property(TARGET _main--ddraw PROPERTY RUNTIME_OUTPUT_DIRECTORY "c:/_src/_main--ddraw3")
target_link_libraries(_main--ddraw jpeg-static)
But it only resulted in this:
1>CMake Error at CMakeLists.txt:369 (add_executable):
1> Cannot find source file:
1> main.cpp
1> Tried extensions .c .C .c++ .cc .cpp .cxx .m .M .mm .h .hh .h++ .hm .hpp
1> .hxx .in .txx
1>CMake Error: CMake can not determine linker language for target: _main--ddraw