Skip to content

Commit 863a28a

Browse files
author
kalarepa
committed
Update CMakeLists.txt
Change library type to shared and add install routines.
1 parent b3c8a2f commit 863a28a

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

CMakeLists.txt

+11
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ set(tmx_SRCS
3232
)
3333

3434
add_library(${PROJECT_NAME} ${tmx_HDRS} ${tmx_SRCS})
35+
install(TARGETS pugi ${PROJECT_NAME} LIBRARY DESTINATION lib)
36+
install(FILES ${pugi_HDRS} ${tmx_HDRS} DESTINATION include)
37+
38+
FILE(GLOB maps "${CMAKE_CURRENT_SOURCE_DIR}/maps/*")
39+
install(FILES ${maps} DESTINATION share/tmx/examples/maps)
3540

3641
#set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
3742
find_package(SFML 2 REQUIRED system window graphics)
@@ -44,30 +49,35 @@ if (SFML_FOUND)
4449
target_link_libraries(BenchMark pugi)
4550
target_link_libraries(BenchMark ${SFML_LIBRARIES})
4651
target_link_libraries(BenchMark ${ZLIB_LIBRARIES})
52+
install(TARGETS BenchMark RUNTIME DESTINATION share/tmx/examples)
4753

4854
add_executable(DrawWithDebug examples/DrawMapWithDebug.cpp)
4955
target_link_libraries(DrawWithDebug ${PROJECT_NAME})
5056
target_link_libraries(DrawWithDebug pugi)
5157
target_link_libraries(DrawWithDebug ${SFML_LIBRARIES})
5258
target_link_libraries(DrawWithDebug ${ZLIB_LIBRARIES})
59+
install(TARGETS DrawWithDebug RUNTIME DESTINATION share/tmx/examples)
5360

5461
add_executable(Isometric examples/IsometricWithConvertCoords.cpp)
5562
target_link_libraries(Isometric ${PROJECT_NAME})
5663
target_link_libraries(Isometric pugi)
5764
target_link_libraries(Isometric ${SFML_LIBRARIES})
5865
target_link_libraries(Isometric ${ZLIB_LIBRARIES})
66+
install(TARGETS Isometric RUNTIME DESTINATION share/tmx/examples)
5967

6068
add_executable(QuadTree examples/MapWithQuadTree.cpp)
6169
target_link_libraries(QuadTree ${PROJECT_NAME})
6270
target_link_libraries(QuadTree pugi)
6371
target_link_libraries(QuadTree ${SFML_LIBRARIES})
6472
target_link_libraries(QuadTree ${ZLIB_LIBRARIES})
73+
install(TARGETS QuadTree RUNTIME DESTINATION share/tmx/examples)
6574

6675
add_executable(ShaderEffects examples/ShaderEffects.cpp)
6776
target_link_libraries(ShaderEffects ${PROJECT_NAME})
6877
target_link_libraries(ShaderEffects pugi)
6978
target_link_libraries(ShaderEffects ${SFML_LIBRARIES})
7079
target_link_libraries(ShaderEffects ${ZLIB_LIBRARIES})
80+
install(TARGETS ShaderEffects RUNTIME DESTINATION share/tmx/examples)
7181

7282
if(BOX2D_FOUND)
7383
add_executable(Box2D examples/Box2D.cpp src/tmx2box2d.cpp)
@@ -76,6 +86,7 @@ if (SFML_FOUND)
7686
target_link_libraries(Box2D ${SFML_LIBRARIES})
7787
target_link_libraries(Box2D ${ZLIB_LIBRARIES})
7888
target_link_libraries(Box2D ${BOX2D_LIBRARIES})
89+
install(TARGETS Box2D RUNTIME DESTINATION share/tmx/examples)
7990

8091
endif (BOX2D_FOUND)
8192

0 commit comments

Comments
 (0)