cigui/examples/CMakeLists.txt
noffie 8e0e9ceb7c Major Restructuring
N0ffie switched to mingw (fixing linux warnings)
2025-04-12 18:09:16 +02:00

26 lines
No EOL
909 B
CMake

# Examples CMakeLists.txt
cmake_minimum_required(VERSION 3.14)
# Function to easily add examples
function(add_cigui_example NAME)
find_files(EXAMPLE_${NAME}_SOURCES "${NAME}/src" cpp c cxx hpp h hxx inl)
add_executable(EXAMPLE_${NAME} ${EXAMPLE_${NAME}_SOURCES})
target_link_libraries(EXAMPLE_${NAME} PRIVATE cigui)
set_target_properties(EXAMPLE_${NAME} PROPERTIES OUTPUT_NAME "${NAME}")
# Copy SFML DLLs to output directory on Windows when building shared
if(WIN32 AND CIGUI_BUILD_SHARED)
add_custom_command(TARGET EXAMPLE_${NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
$<TARGET_FILE:sfml-graphics>
$<TARGET_FILE:sfml-window>
$<TARGET_FILE:sfml-system>
$<TARGET_FILE:cigui>
$<TARGET_FILE_DIR:EXAMPLE_${NAME}>
)
endif()
endfunction()
# Basic example
add_subdirectory(Full)