psemek/examples/CMakeLists.txt

12 lines
439 B
CMake

find_package(ZLIB REQUIRED)
file(GLOB PSEMEK_EXAMPLES RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/*.cpp")
foreach(example ${PSEMEK_EXAMPLES})
get_filename_component(TARGET_NAME "${example}" NAME_WLE)
set(TARGET_NAME psemek-example-${TARGET_NAME})
psemek_add_executable(${TARGET_NAME} ${example})
if(TARGET ${TARGET_NAME})
target_link_libraries(${TARGET_NAME} PUBLIC psemek ZLIB::ZLIB)
endif()
endforeach()