make use of folder properties in cmake

This commit is contained in:
rextimmy 2021-11-22 12:30:08 +10:00
parent 637f54e859
commit d58cf398a9
3 changed files with 22 additions and 0 deletions

View file

@ -1,5 +1,7 @@
cmake_minimum_required (VERSION 3.10.2)
set_property(GLOBAL PROPERTY USE_FOLDERS TRUE)
set(TORQUE_LIBS_FOLDER_NAME "Libs" CACHE STRING "The solution folder name to place all libs under")
set(TORQUE_APP_NAME "" CACHE STRING "the app name")
set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/temp" CACHE PATH "default install path" FORCE )

View file

@ -340,6 +340,9 @@ macro(finishLibrary)
#endforeach()
_postTargetProcess()
#set the folder property name
set_target_properties(${PROJECT_NAME} PROPERTIES FOLDER ${TORQUE_LIBS_FOLDER_NAME})
endmacro()
# macro to add an executable

View file

@ -969,3 +969,20 @@ if(TORQUE_TEMPLATE)
INSTALL(FILES "${CMAKE_SOURCE_DIR}/Templates/${TORQUE_TEMPLATE}/DeletePrefs.bat" DESTINATION "${TORQUE_APP_DIR}")
endif()
endif()
###############################################################################
# Properties folder
###############################################################################
# we only need to add libs that we add via add_subdirectory command, basics.cmake
# will take care of the other source libs added via addLib
if(TORQUE_SFX_OPENAL AND WIN32)
set_target_properties(OpenAL PROPERTIES FOLDER ${TORQUE_LIBS_FOLDER_NAME})
#why is openal adding these two?
set_target_properties(common PROPERTIES FOLDER ${TORQUE_LIBS_FOLDER_NAME})
set_target_properties(ex-common PROPERTIES FOLDER ${TORQUE_LIBS_FOLDER_NAME})
endif()
if(TORQUE_SDL)
set_target_properties(SDL2 PROPERTIES FOLDER ${TORQUE_LIBS_FOLDER_NAME})
endif()