[CMake] Setting up a PGO sequence

Martin Apel martin.apel at simpack.de
Thu Aug 6 07:54:09 EDT 2009


Hi,

I think you should be able to do something like the following:

set(CMAKE_C_FLAGS <PGO_TRAINING_OPTIONS> ${CMAKE_C_FLAGS})   # For CXX
probably as well
ctest_configure(BUILD "${CTEST_BINARY_DIRECTORY}" )
ctest_build(BUILD "${CTEST_BINARY_DIRECTORY}" )
ctest_test(BUILD "${CTEST_BINARY_DIRECTORY}" )

set(CMAKE_C_FLAGS <PGO_FINAL_OPTIONS> ${CMAKE_C_FLAGS})   # For CXX
probably as well
ctest_configure(BUILD "${CTEST_BINARY_DIRECTORY}" )
ctest_build(BUILD "${CTEST_BINARY_DIRECTORY}" )

I haven't tried this out, but I don't see any reason, why this should
not work.

Regards,

Martin


night owl03d wrote:
> I am trying to figure out the best way to set up CMake to do release
> builds with profile guided optimization for gcc and msvc.
>
> The general sequence I want to perform is...
>
> 1. Build with instrumentation.
> 2. Run training apps.
> 3. rebuild with pgo. (In gcc this is a clobber build, and in msvc it
> is just a relink).
>
> My best guess is that I want to do the build, configure ctest to run
> my training apps, and then redo the build. Well 1 and 2 is easy, but I
> am trying to figure out how to arrange for 3 to be fired off without
> manual intervention. I am sure there is an easy way to do it, but I am
> brain farting on it right now.
>
> I have used scons to do this sort of thing before, but I can't figure
> out how to make it work with cmake.
>
>
>
>
>
>


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20090806/c5818b5c/attachment.htm>


More information about the CMake mailing list