Skip to content

Commit

Permalink
Merge pull request #29 from fpiesche/patch-1
Browse files Browse the repository at this point in the history
Add `install` target to CMakeLists.txt
  • Loading branch information
ptitSeb authored Feb 7, 2024
2 parents a400068 + 79fb22b commit ce22727
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
cmake_minimum_required(VERSION 2.8)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)

set(CMAKE_INSTALL_BINDIR ".")
set(CMAKE_INSTALL_LIBDIR ".")
set(CMAKE_INSTALL_DATADIR ".")
include(GNUInstallDirs)

option(BITTBOY "Set to ON if targeting a Bittboy device" ${BITTBOY})
option(GAMESHELL "Set to ON if targeting a GameShell device" ${GAMESHELL})
Expand Down Expand Up @@ -187,6 +195,7 @@ if(NOT EMSCRIPTEN)
endif()

add_executable(hcl ${HCL_SOURCE_FILES} ${HCL_SDL_FILES})
set_target_properties(hcl PROPERTIES OUTPUT_NAME "hcl")
target_link_libraries (hcl ${EXTRA_LIBS} m)
if(EMSCRIPTEN)
#set(CMAKE_EXECUTABLE_SUFFIX ".html")
Expand All @@ -200,3 +209,23 @@ if(EMSCRIPTEN)
#target_link_libraries(hcl "--preload-file" "data")
set_target_properties(hcl PROPERTIES OUTPUT_NAME "${CMAKE_SOURCE_DIR}/docs/index.html")
endif(EMSCRIPTEN)

# Main binary
install(TARGETS hcl
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
BUNDLE DESTINATION "${CMAKE_INSTALL_BINDIR}"
)

# Support data
install(DIRECTORY
"${CMAKE_CURRENT_SOURCE_DIR}/data"
DESTINATION "${CMAKE_INSTALL_DATADIR}"
FILE_PERMISSIONS
OWNER_READ OWNER_WRITE
GROUP_READ
WORLD_READ
DIRECTORY_PERMISSIONS
OWNER_READ OWNER_EXECUTE OWNER_WRITE
GROUP_READ GROUP_EXECUTE GROUP_WRITE
WORLD_READ WORLD_EXECUTE
)

0 comments on commit ce22727

Please sign in to comment.