VS Launcher with different RUNTIME_LIBRARY_DIR's per configuration
ulrichard opened this issue · 4 comments
First, thanks a lot for sharing your cmake modules. Especially CreateLaunchers.cmake is really helpful.
But here comes the problem: Some of the dll's have the same name for debug and release builds, but are in different directories. So it would be really cool to be able to write this:
create_target_launcher(myprog
ARGS "/config Default_3D"
RUNTIME_LIBRARIES_Debug ${PL_RUNTIME_DIRS_DEBUG}
RUNTIME_LIBRARIES_Release ${PL_RUNTIME_DIRS_RELEASE}
RUNTIME_LIBRARIES_RelWithDebInfo ${PL_RUNTIME_DIRS_RELEASE}
RUNTIME_LIBRARIES_MinSizeRel ${PL_RUNTIME_DIRS_RELEASE}
WORKING_DIRECTORY ${PROJECT_MAIN_DIR}/App/bin
)
I'm not sure if it's easier to try to emulate it with the ENVIRONMENT option and the VS variable $(ConfigurationName), or if it's easier to modify the cmake code.
What do you think?
Hi
I found a workaround for this issue. I only need it for working_directory, so that i can specify the destination to be the output folder of the executable. I use it as follows:
create_target_launcher(TestTarget WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/@USERFILE_CONFIGNAME@").
This variable gets replaced with Debug/Release/RelWithDebInfo/MinSizeRel.
In your case, you would have to follow the same naming for your RUNTIME_LIBRARIES, you could perhaps symlink RelWithDebInfo and MinSizeRel to point to Release?
Hi jesperhh,
Thanks for your suggestion.
The two PL_RUNTIME_DIRS_* variables contain more than ten directories from 3rd party libraries.
We try to keep the directory structure as close to the original as we can to simplify upgrading.
And we keep the libs in a mercurial repo, so I don't know how that would handle symlinks.
So, I don't see how I could solve my problem with your workaround.
I wonder if generator expressions could help with this, particularly with #25 in mind.
Generator expression work has been merged. Not sure if that helps your situation (or if you even still have this problem) - please re-check if you would like.