Skip to content

Commit

Permalink
Fix build fail
Browse files Browse the repository at this point in the history
Signed-off-by: Bensuperpc <[email protected]>
  • Loading branch information
bensuperpc committed Nov 6, 2021
1 parent e45e0b9 commit bea28b7
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 1 deletion.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,5 @@ cmake-build-*/
prefix/
CMakeLists.txt.user
CMakeUserPresets.json
project-include-after.cmake
old/*
.cache/
33 changes: 33 additions & 0 deletions project-include-after.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# This file is run at the end of every project() call

# Top level setup to set folder property for targets to be grouped in IDEs that
# support folders
if(PROJECT_NAME STREQUAL "GTA_SA_cheat_finder")
set(FOLDER_GTA_SA_cheat_finder Project)
set(FOLDER_GTA_SA_cheat_finderTests Test)

function(project_set_folder_property)
set(var "FOLDER_${PROJECT_NAME}")
if(NOT DEFINED "${var}")
# message(FATAL_ERROR "Variable '${var}' does not exist")
message(WARNING "Variable '${var}' does not exist")
endif()
get_property(targets DIRECTORY PROPERTY BUILDSYSTEM_TARGETS)
foreach(target IN LISTS targets)
get_property(folder TARGET "${target}" PROPERTY FOLDER)
if(DEFINED folder)
continue()
endif()
set(folder UtilityTargets)
get_property(type TARGET "${target}" PROPERTY TYPE)
if(NOT type STREQUAL "UTILITY")
set(folder "${${var}}Targets")
endif()
set_property(TARGET "${target}" PROPERTY FOLDER "${folder}")
endforeach()
endfunction()

set_property(GLOBAL PROPERTY USE_FOLDERS YES)
endif()

cmake_language(DEFER CALL project_set_folder_property)

0 comments on commit bea28b7

Please sign in to comment.