Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VS Launcher with different RUNTIME_LIBRARY_DIR's per configuration #11

Open
ulrichard opened this issue Nov 12, 2012 · 4 comments
Open

Comments

@ulrichard
Copy link

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?

@jesperhh
Copy link

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?

@ulrichard
Copy link
Author

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.

@rpavlik
Copy link
Owner

rpavlik commented Apr 15, 2015

I wonder if generator expressions could help with this, particularly with #25 in mind.

@rpavlik
Copy link
Owner

rpavlik commented Aug 5, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants