
Use CMake's target_link_libraries instead of manually maintaining library dependencies in a single list. In practice adding new libraries often ended up being guess-work, now each library lists the libraries it uses. This was used for the game player executable so libraries could optionally link to stubs. If we need this functionality it can be done using target-properties as described in T46725.
16 lines
542 B
CMake
16 lines
542 B
CMake
function(cycles_set_solution_folder target)
|
|
if(WINDOWS_USE_VISUAL_STUDIO_FOLDERS)
|
|
get_filename_component(folderdir ${CMAKE_CURRENT_SOURCE_DIR} DIRECTORY)
|
|
string(REPLACE ${CMAKE_SOURCE_DIR} "" folderdir ${folderdir})
|
|
set_target_properties(${target} PROPERTIES FOLDER ${folderdir})
|
|
endif()
|
|
endfunction()
|
|
|
|
macro(cycles_add_library target library_deps)
|
|
add_library(${target} ${ARGN})
|
|
if(NOT ("${library_deps}" STREQUAL ""))
|
|
target_link_libraries(${target} "${library_deps}")
|
|
endif()
|
|
cycles_set_solution_folder(${target})
|
|
endmacro()
|