cmkr icon indicating copy to clipboard operation
cmkr copied to clipboard

Flatten the build directory

Open xtremegamer1 opened this issue 3 years ago • 9 comments

I want to copy a dll generated by a subdirectory into the path of my main binary. Is this possible with cmkr? If not pls implement

xtremegamer1 avatar Oct 05 '22 09:10 xtremegamer1

cmake-after = """
add_custom_command(TARGET the_target PRE_BUILD
                   COMMAND ${CMAKE_COMMAND} -E copy
                   ${CMAKE_SOURCE_DIR}/yourfile.dll $<TARGET_FILE_DIR:the_target>/yourfile.dll)
"""

Would be one way

ZehMatt avatar Oct 05 '22 11:10 ZehMatt

Thanks. Can you explain to me what does these commands mean? Also you should add a simpler way to do it the whole point of this project is that it’s cmake for retards, and I don’t think a retard can understand that command.

xtremegamer1 avatar Oct 05 '22 11:10 xtremegamer1

Like what the hell does triple quote mean

xtremegamer1 avatar Oct 05 '22 11:10 xtremegamer1

Feel free to use CMake instead.

ZehMatt avatar Oct 05 '22 11:10 ZehMatt

This feature currently isn’t supported but I’ll add it eventually. The triple quotes are a part of TOML to allow a string with “ and \ etc inside (same as python).

mrexodia avatar Oct 05 '22 11:10 mrexodia

https://github.com/mrexodia/AppInitHook/blob/master/cmake.toml#L23

This is what you want to use, it will put all the output files next to each other no matter the subdirectory structure (also this will become a built-in feature).

mrexodia avatar Oct 05 '22 11:10 mrexodia

Feel free to use CMake instead.

I saw some cool people like Mr. Can Boluk and xerox_ using cmkr so I want to use it too to be cool like them. I don’t mean any hate so sorry if I sounded rude

xtremegamer1 avatar Oct 05 '22 11:10 xtremegamer1

https://github.com/mrexodia/AppInitHook/blob/master/cmake.toml#L23

This is what you want to use, it will put all the output files next to each other no matter the subdirectory structure (also this will become a built-in feature).

Thanks mr your the best :)

xtremegamer1 avatar Oct 05 '22 11:10 xtremegamer1

This would be solved by something similar to https://github.com/mrexodia/AppInitHook/blob/master/CMake/flatten-build-hierarchy.cmake

Perhaps:

[project]
flatten-build = true

mrexodia avatar Nov 23 '22 23:11 mrexodia