Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Qt signal/slot + Boost.Coroutine
cmake_minimum_required(VERSION 2.6)
function(group_sources root)
function(__group_sources__ root prefix)
file(GLOB entries RELATIVE "${root}" "${root}/*")
foreach(entry ${entries})
set(abspath "${root}/${entry}")
if(IS_DIRECTORY "${abspath}")
__group_sources__("${abspath}" "${prefix}/${entry}")
else()
list(APPEND group "${abspath}")
endif()
endforeach()
string(REPLACE "/" "\\" prefix "${prefix}")
source_group("${prefix}" FILES ${group})
endfunction()
get_filename_component(prefix "${root}" NAME)
__group_sources__("${root}" "${prefix}")
endfunction()
group_sources("${CMAKE_SOURCE_DIR}/src")
group_sources("${CMAKE_SOURCE_DIR}/include")
file(GLOB_RECURSE sources "${CMAKE_SOURCE_DIR}/src" "*.c")
file(GLOB_RECURSE headers "${CMAKE_SOURCE_DIR}/include" "*.h")
add_executable(a WIN32 ${sources} ${headers})

Hi!

Line 6 in CMakeLists.txt should read

find_package(Boost REQUIRED COMPONENTS coroutine system context thread)

Otherwise it won't link. Notice the added thread component.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment