Skip to content

Instantly share code, notes, and snippets.

@yeputons
Created August 8, 2024 20:52
Show Gist options
  • Save yeputons/230dd8e110c64f928208ae2bfeb950d0 to your computer and use it in GitHub Desktop.
Save yeputons/230dd8e110c64f928208ae2bfeb950d0 to your computer and use it in GitHub Desktop.
cmake_minimum_required(VERSION 3.22)
project(cmake-issue-demo CXX)
add_executable(exec main.cpp)
set(ARGS ARG1 "value1" ARG2 "$<$<CONFIG:Debug>:value2>" ARG3 "value3")
add_custom_command(
TARGET exec POST_BUILD
COMMAND "${CMAKE_COMMAND}"
-D "ARGS=${ARGS}"
-P "${CMAKE_CURRENT_SOURCE_DIR}/helper.cmake"
VERBATIM
)
message("ARGS=${ARGS}")
int main() {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment