forked from osolovyoff/blank
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
41 lines (37 loc) · 1.75 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
function(add_recursive current_dir sources_files)
file(GLOB children RELATIVE ${PROJECT_SOURCE_DIR}/${current_dir} ${PROJECT_SOURCE_DIR}/${current_dir}/*)
foreach(child ${children})
if(IS_DIRECTORY ${PROJECT_SOURCE_DIR}/${current_dir}/${child})
add_recursive(${current_dir}/${child} ${sources_files})
else()
get_filename_component(extension ${child} EXT)
if (NOT extension STREQUAL "")
string(REGEX MATCHALL "^.*.[h|hpp|c|cpp|cxx]" out ${extension})
if (NOT out STREQUAL "")
if(MSVC)
string(REPLACE "/" "\\" groupname ${current_dir})
endif()
set(filename ${PROJECT_SOURCE_DIR}/${current_dir}/${child})
source_group(${groupname} FILES ${filename})
set(${sources_files} ${${sources_files}} ${filename})
endif()
endif()
endif()
endforeach()
set(${sources_files} ${${sources_files}} PARENT_SCOPE)
endfunction(add_recursive)
#_________________________________________________________________________________________
cmake_minimum_required(VERSION 3.8 FATAL_ERROR)
get_filename_component(SolutionName ${CMAKE_CURRENT_LIST_DIR} NAME)
project(${SolutionName})
include(${CMAKE_BINARY_DIR}/conanbuildinfo_multi.cmake)
include_directories(source)
conan_basic_setup()
add_recursive(source PARSED_SOURCE)
add_executable(${PROJECT_NAME} ${PARSED_SOURCE})
foreach(debug_lib ${CONAN_LIBS_DEBUG})
target_link_libraries(${PROJECT_NAME} debug ${debug_lib})
endforeach()
foreach(release_lib ${CONAN_LIBS_RELEASE})
target_link_libraries(${PROJECT_NAME} optimized ${release_lib})
endforeach()