Skip to content

Commit c0c5764

Browse files
committed
samples: Add install targets
Change-Id: I1cd883d66fd7c3fb709d9701f7f10d4a2d3489c7
1 parent 102ff04 commit c0c5764

File tree

4 files changed

+13
-1
lines changed

4 files changed

+13
-1
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ script:
8080
# Build VulkanSamples
8181
mkdir build
8282
cd build
83-
cmake -DCMAKE_BUILD_TYPE=Debug -C../external/helper.cmake ..
83+
cmake -C../external/helper.cmake ..
8484
make -j $core_count
8585
cd ..
8686
fi

API-Samples/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,10 @@ set (S_TARGETS
270270
spirv_assembly spirv_specialization memory_barriers validation_cache vulkan_1_1_flexible)
271271
sampleWithSingleFile()
272272

273+
foreach (sample ${S_TARGETS})
274+
install(TARGETS ${sample} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
275+
endforeach(sample)
276+
273277
if (NOT ANDROID)
274278
add_subdirectory(utils)
275279
endif()

CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,12 @@ if (USE_CCACHE)
3333
endif(CCACHE_FOUND)
3434
endif()
3535

36+
include(GNUInstallDirs)
37+
# Set a better default install location for Windows only if the user did not provide one.
38+
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT AND WIN32)
39+
set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/install" CACHE PATH "default install path" FORCE)
40+
endif()
41+
3642
# Enable cmake folders
3743
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
3844

Sample-Programs/Hologram/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,3 +97,5 @@ add_executable(Hologram ${sources})
9797
target_compile_definitions(Hologram ${definitions})
9898
target_include_directories(Hologram ${includes})
9999
target_link_libraries(Hologram ${libraries})
100+
101+
install(TARGETS Hologram RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})

0 commit comments

Comments
 (0)