File tree Expand file tree Collapse file tree 4 files changed +31
-10
lines changed
Expand file tree Collapse file tree 4 files changed +31
-10
lines changed Original file line number Diff line number Diff line change @@ -3,4 +3,10 @@ project(cpp-particle-system)
33set (CMAKE_CXX_STANDARD 17)
44
55add_subdirectory (src)
6- add_subdirectory (examples/sdl2)
6+
7+ option (BUILD_EXAMPLES "Build examples" ON )
8+
9+ if (BUILD_EXAMPLES)
10+ MESSAGE (STATUS "Building examples is enabled" )
11+ add_subdirectory (examples)
12+ endif ()
Original file line number Diff line number Diff line change 1+ add_subdirectory (sdl2)
Original file line number Diff line number Diff line change 1- cmake_minimum_required (VERSION 3.16.3)
21project (sdl2-example)
32
43add_executable (sdl2-example main.cpp DemoApplication.cpp DemoApplication.h ParticleObject.cpp ParticleObject.h)
54
65if ( WIN32 OR WIN64 )
76 find_package (SDL2 CONFIG REQUIRED)
87 find_package (sdl2-image CONFIG REQUIRED)
9- target_link_libraries (sdl2-example PRIVATE SDL2::SDL2 SDL2::SDL2main SDL2::SDL2_image CppParticleSystem )
8+ target_link_libraries (sdl2-example PRIVATE SDL2::SDL2 SDL2::SDL2main SDL2::SDL2_image cpp-particle- system )
109else ()
1110 find_package (SDL2 REQUIRED)
1211 find_package (SDL2_image REQUIRED)
1312 include_directories (${SDL2_INCLUDE_DIR} ${SDL2_IMAGE_INCLUDE_DIR} )
1413 include_directories (${SDL2_INCLUDE_DIRS} ${SDL2_IMAGE_INCLUDE_DIRS} )
15- target_link_libraries (sdl2-example ${SDL2_LIBRARIES} ${SDL2_IMAGE_LIBRARIES} CppParticleSystem )
14+ target_link_libraries (sdl2-example ${SDL2_LIBRARIES} ${SDL2_IMAGE_LIBRARIES} cpp-particle- system )
1615endif ()
1716
1817#target_link_directories(sdl2-example PRIVATE CppParticleSystem/)
Original file line number Diff line number Diff line change 1- cmake_minimum_required ( VERSION 3.16.3 )
2- project (CppParticleSystem )
1+ project (cpp-particle- system )
2+ set (PROJECT_VERSION 3.1 )
33
4- set (CppParticleSystem
5- ParticleSystem.h
4+ set (sources
65 ParticleSystem.cpp
76 )
87
9- add_library (CppParticleSystem STATIC ${CppParticleSystem} )
10- target_include_directories (CppParticleSystem PUBLIC "${CMAKE_CURRENT_SOURCE_DIR} " )
8+ set (public_headers
9+ ParticleSystem.h
10+ )
11+
12+ add_library (cpp-particle-system ${sources} ${public_headers} )
13+
14+ set_target_properties (cpp-particle-system PROPERTIES
15+ PUBLIC_HEADER "${public_headers} "
16+ VERSION ${PROJECT_VERSION}
17+ )
18+
19+ target_include_directories (cpp-particle-system
20+ PUBLIC
21+ $<INSTALL_INTERFACE:include >
22+ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR} >
23+ PRIVATE
24+ ${CMAKE_CURRENT_SOURCE_DIR}
25+ )
You can’t perform that action at this time.
0 commit comments