Skip to content

Commit 01204c3

Browse files
authored
Merge pull request #91 from DavidLudwig/sample_reorg_1
reduce redundancy in sample-app names
2 parents 6979949 + aa467c6 commit 01204c3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+160
-130
lines changed

.gitmodules

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
[submodule "P0267_RefImpl/Samples/SVG/external/svgpp"]
2-
path = P0267_RefImpl/Samples/SVG/external/svgpp
1+
[submodule "P0267_RefImpl/Samples/svg/external/svgpp"]
2+
path = P0267_RefImpl/Samples/svg/external/svgpp
33
url = https://github.com/svgpp/svgpp
4-
[submodule "P0267_RefImpl/Samples/SVG/external/rapidxml_ns"]
5-
path = P0267_RefImpl/Samples/SVG/external/rapidxml_ns
4+
[submodule "P0267_RefImpl/Samples/svg/external/rapidxml_ns"]
5+
path = P0267_RefImpl/Samples/svg/external/rapidxml_ns
66
url = https://github.com/svgpp/rapidxml_ns
77
[submodule "P0267_RefImpl/Tests/Catch2"]
88
path = P0267_RefImpl/Tests/Catch2
99
url = https://github.com/catchorg/Catch2
10-
[submodule "P0267_RefImpl/Samples/Maps/external/pugixml"]
11-
path = P0267_RefImpl/Samples/Maps/external/pugixml
10+
[submodule "P0267_RefImpl/Samples/maps/external/pugixml"]
11+
path = P0267_RefImpl/Samples/maps/external/pugixml
1212
url = https://github.com/zeux/pugixml
Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
cmake_minimum_required(VERSION 3.0.0)
22
project(io2d CXX)
33

4-
add_subdirectory(DrawCPP)
5-
add_subdirectory(RocksInSpace)
6-
add_subdirectory(SVG)
7-
add_subdirectory(Life)
8-
add_subdirectory(CPULoad)
9-
add_subdirectory(Sprites)
10-
add_subdirectory(Maps)
4+
# Search for and add sample app(s):
5+
file(GLOB all_paths ${CMAKE_CURRENT_LIST_DIR}/*)
6+
set(all_samples "")
7+
foreach(one_path ${all_paths})
8+
if(IS_DIRECTORY ${one_path})
9+
if(EXISTS ${one_path}/CMakeLists.txt)
10+
get_filename_component(one_sample ${one_path} NAME)
11+
add_subdirectory(${one_sample})
12+
endif()
13+
endif()
14+
endforeach()

P0267_RefImpl/Samples/CPULoad/CMakeLists.txt

Lines changed: 0 additions & 34 deletions
This file was deleted.

P0267_RefImpl/Samples/DrawCPP/CMakeLists.txt

Lines changed: 0 additions & 18 deletions
This file was deleted.

P0267_RefImpl/Samples/Life/CMakeLists.txt

Lines changed: 0 additions & 16 deletions
This file was deleted.

P0267_RefImpl/Samples/Sprites/CMakeLists.txt

Lines changed: 0 additions & 28 deletions
This file was deleted.
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
cmake_minimum_required(VERSION 3.0.0)
2+
set(CMAKE_CXX_STANDARD 17)
3+
4+
# Use the CMakeLists.txt's parent-directory-name for the project's id/name
5+
get_filename_component(PROJECT_ID ${CMAKE_CURRENT_SOURCE_DIR} NAME)
6+
string(REPLACE " " "_" PROJECT_ID ${PROJECT_ID})
7+
project(${PROJECT_ID})
8+
9+
set(CPULOAD_SRC
10+
main.cpp
11+
data_source.cpp
12+
data_source.h
13+
profiler.h
14+
)
15+
16+
if( ${CMAKE_SYSTEM_NAME} MATCHES "Darwin" )
17+
list(APPEND CPULOAD_SRC profiler_mach.cpp)
18+
elseif( ${CMAKE_SYSTEM_NAME} MATCHES "Windows" )
19+
list(APPEND CPULOAD_SRC profiler_nt.cpp)
20+
elseif( ${CMAKE_SYSTEM_NAME} MATCHES "Linux" )
21+
list(APPEND CPULOAD_SRC profiler_linux.cpp)
22+
else()
23+
message( "CPULoad doesn't have a profiler for this platform, thus skipping." )
24+
return()
25+
endif()
26+
27+
add_executable(${PROJECT_ID} ${CPULOAD_SRC})
28+
target_link_libraries(${PROJECT_ID} io2d)
29+
30+
if( DEFINED IOS_PLATFORM )
31+
# iOS requires special packaging, so we have to treat this target separately
32+
set_target_properties(${PROJECT_ID} PROPERTIES MACOSX_BUNDLE YES)
33+
set_target_properties(${PROJECT_ID} PROPERTIES MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/iOS/Info.plist")
34+
target_sources(${PROJECT_ID} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/iOS/LaunchScreen.storyboard)
35+
target_sources(${PROJECT_ID} PRIVATE iOS/libcxx_tmp_stubs.cpp)
36+
set_target_properties(${PROJECT_ID} PROPERTIES RESOURCE "${CMAKE_CURRENT_SOURCE_DIR}/iOS/LaunchScreen.storyboard")
37+
set_target_properties(${PROJECT_ID} PROPERTIES XCODE_ATTRIBUTE_TARGETED_DEVICE_FAMILY "1,2")
38+
endif()
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)