Skip to content

There is no post-build copy event in the main CMakelists.txt #57

@Eugene3535

Description

@Eugene3535

An exit trigger is triggered when trying to launch the application:

// Make sure asset folder is present from the current working directory
if (!std::filesystem::is_directory("assets")) {
	std::cerr << "Could not locate assets folder from current working directory\n";
	exit(-1);
}

And you have to manually copy the assets folder to the binary directory.
Solution: add to CMakeLists.txt the following custom command:

add_custom_command(TARGET ${NAME} POST_BUILD
	COMMAND ${CMAKE_COMMAND} -E copy_directory_if_different "${CMAKE_SOURCE_DIR}/assets" "$<TARGET_FILE_DIR:${NAME}>/assets"
	VERBATIM
)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions