Skip to content

Instantly share code, notes, and snippets.

@Manu343726
Created September 5, 2015 11:10
Show Gist options
  • Select an option

  • Save Manu343726/5c50b07712b85dabfdc7 to your computer and use it in GitHub Desktop.

Select an option

Save Manu343726/5c50b07712b85dabfdc7 to your computer and use it in GitHub Desktop.
Workaround to make VS behave like unique-configuration generator
# Workaround to make VS behave like unique-configuration generator:
if(WIN32 AND MSVC)
set_target_properties([TARGET]
PROPERTIES EXCLUDE_FROM_ALL TRUE)
# Build [TARGET] using CMAKE_BUILD_TYPE always, as unique-configuration makefiles
add_custom_target(build_msvc ALL
COMMAND ${CMAKE_COMMAND} --build \".\" --target [TARGET] --config ${CMAKE_BUILD_TYPE}
WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
endif()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment