Skip to content
This repository has been archived by the owner on Sep 19, 2024. It is now read-only.

Commit

Permalink
(add): add cmake install
Browse files Browse the repository at this point in the history
  • Loading branch information
VisualGMQ committed Jun 25, 2023
1 parent c945a0a commit bfa8bb4
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,23 @@ include(cmake/utility.cmake)
include(cmake/FindSDL2.cmake)
include(cmake/copydll.cmake)

IsMSVCBackend(is_msvc_backend)

aux_source_directory(src SRC)
add_executable(mine-sweep ${SRC})
target_include_directories(mine-sweep PRIVATE include)
target_link_libraries(mine-sweep PRIVATE SDL2)
target_compile_features(mine-sweep PRIVATE cxx_std_17)
CopyDLL(mine-sweep)

if (${is_msvc_backend})
target_link_options(mine-sweep PRIVATE $<IF:$<CONFIG:Release>,/SUBSYSTEM:WINDOWS,/SUBSYSTEM:CONSOLE>)
endif()

CopyDLL(mine-sweep)

install(PROGRAMS $<TARGET_FILE:mine-sweep>
DESTINATION "${CMAKE_BINARY_DIR}/mine-sweep-${PROJECT_VERSION}")
install(DIRECTORY resources
DESTINATION "${CMAKE_BINARY_DIR}/mine-sweep-${PROJECT_VERSION}")
install(FILES $CACHE{SDL2_DYNAMIC_LIB_DIR}/SDL2.dll
DESTINATION "${CMAKE_BINARY_DIR}/mine-sweep-${PROJECT_VERSION}")

0 comments on commit bfa8bb4

Please sign in to comment.