comparison Resources/CMake/Utilities.cmake @ 1376:dc5acb03ad93 broker

Better source groups for SDL samples (retry)
author Benjamin Golinvaux <bgo@osimis.io>
date Wed, 22 Apr 2020 11:54:57 +0200
parents 5055031f4a06
children
comparison
equal deleted inserted replaced
1371:f15529add7b0 1376:dc5acb03ad93
33 #message(STATUS "Test_GetFilenameFromPath: <<OK>>") 33 #message(STATUS "Test_GetFilenameFromPath: <<OK>>")
34 endif() 34 endif()
35 endmacro() 35 endmacro()
36 36
37 Test_GetFilenameFromPath() 37 Test_GetFilenameFromPath()
38
39 macro(SortFilesInSourceGroups)
40 if(FALSE)
41 foreach(source IN LISTS ORTHANC_STONE_SOURCES)
42 # if("${source}" MATCHES ".*/pixman.*\\.c")
43 # message("pixman source: ${source}")
44 # elseif("${source}" MATCHES ".*/pixman.*\\.c")
45 # message("pixman header: ${source}")
46 # endif()
47
48 if("${source}" MATCHES ".*\\.\\./.*")
49 message("source raw: ${source}")
50 #file(TO_CMAKE_PATH ${source} sourceCMakePath)
51 get_filename_component(sourceCMakePath ${source} ABSOLUTE)
52 message("source CMake: ${sourceCMakePath}")
53 endif()
54
55 # returns the containing directory with forward slashes
56 # get_filename_component(source_path "${source}" PATH)
57
58 # converts / to \
59 # string(REPLACE "/" "\\" source_path_msvc "${source_path}")
60 #source_group("Stone ${source_path_msvc}" FILES "${source}")
61 endforeach()
62 endif()
63
64 source_group("Orthanc Framework\\Sources" REGULAR_EXPRESSION ".*/orthanc/(Core|Plugins)/.*cpp")
65 source_group("Orthanc Framework\\Headers" REGULAR_EXPRESSION ".*/orthanc/(Core|Plugins)/.*hpp")
66 source_group("Orthanc Framework\\Headers" REGULAR_EXPRESSION ".*/orthanc/(Core|Plugins)/.*h")
67
68 source_group("Stone Library\\Sources" REGULAR_EXPRESSION ".*/orthanc-stone/.*cpp")
69 source_group("Stone Library\\Headers" REGULAR_EXPRESSION ".*/orthanc-stone/.*hpp")
70 source_group("Stone Library\\Headers" REGULAR_EXPRESSION ".*/orthanc-stone/.*h")
71
72 source_group("Stone Samples\\Source" REGULAR_EXPRESSION ".*orthanc-stone/Samples/.*\\.cpp")
73 source_group("Stone Samples\\Headers" REGULAR_EXPRESSION ".*orthanc-stone/Samples/.*\\.h")
74
75 source_group("ThirdParty\\cairo" REGULAR_EXPRESSION ".*${CMAKE_BINARY_DIR}/cairo[^/]*/.*")
76 source_group("ThirdParty\\pixman" REGULAR_EXPRESSION ".*${CMAKE_BINARY_DIR}/pixman[^/]*/.*")
77 source_group("ThirdParty\\base64" REGULAR_EXPRESSION ".*ThirdParty/base64.*")
78 source_group("ThirdParty\\SDL2" REGULAR_EXPRESSION ".*${CMAKE_BINARY_DIR}/SDL2.*")
79 source_group("ThirdParty\\glew" REGULAR_EXPRESSION ".*${CMAKE_BINARY_DIR}/glew.*")
80 source_group("AUTOGENERATED" REGULAR_EXPRESSION ".*${CMAKE_BINARY_DIR}/AUTOGENERATED/.*")
81 source_group("ThirdParty\\minizip" REGULAR_EXPRESSION ".*ThirdParty/minizip/.*")
82 source_group("ThirdParty\\md5" REGULAR_EXPRESSION ".*ThirdParty/md5/.*")
83 endmacro()
84