[cmake-developers] Cmake and visual studio failing to build....
J Decker
d3ck0r at gmail.com
Thu Aug 9 19:27:17 EDT 2012
I'm having a little difficulty figuring out why this is not building
my projects using visual studio/msbuild. Basically all I get is
"========== Build: 0 succeeded, 0 failed, 24 up-to-date, 0 skipped =========="
I've used MSBuild with /v:diag set and in the huge log that that generates....
Outputs for C:\GENERAL\BUILD\VS10-X86\ALTANIK\CMAKEFILES\D460CDD940FC411117A7C12689E8CBDF\BUILDCORE.RULE|M:\ALTANIK\CMAKE_ALL\CMAKELISTS.TXT:
(TaskId:43)
C:\GENERAL\BUILD\VS10-X86\ALTANIK\CMAKEFILES\GENERATE.STAMP (TaskId:43)
C:\GENERAL\BUILD\VS10-X86\ALTANIK\CMAKEFILES\BUILDCORE (TaskId:43)
All outputs are up-to-date. (TaskId:43)
How do I make sure that 'add_custom_target' is built? and I shouldn't
have to ask that because the docs say....
"Adds a target with the given name that executes the given commands.
The target has no output file and is ALWAYS CONSIDERED OUT OF DATE
even if the commands try to create a file with the name of the
target."
macro( BuildProject PROJECT SOLUTION PROJECT_SOURCE INSTALL_RESULT )
#...
add_custom_target( Build${PROJECT} ALL
COMMAND cmake -G "${CMAKE_GENERATOR}" ${PROJECT_SOURCE}
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
-DCMAKE_INSTALL_PREFIX=${INSTALL} ${ARGN}
COMMAND ${BUILD_COMMAND}
WORKING_DIRECTORY ${BUILD}
${ADD_SOURCES}
)
#...
endmacro()
ADD_SOURCES is the .SLN filename
BUILD is where it's building
BUILD_COMMAND was retreived using build_command()
and occasionally do ADD_CUSTOM_COMMAND( target Build${PROJECT} ...
some other commands... )
on watcom, mingw, and usually visual studio, the cmake lists that uses
this macro basically ends up running cmake and an approprite build
command for each project...
I have a bunch fo project build targets, and have added dependencies
to most of that like 'add_dependencies( ${LAST_TARGET} Buildcore )'
so Buildcore will get built first... last_target is set by the
macro... yadda yadda.
All of that works.
But today, and some time last month a bit...
More information about the cmake-developers
mailing list