Skip to content

Commit

Permalink
installable for linux
Browse files Browse the repository at this point in the history
  • Loading branch information
borbrudar committed Nov 7, 2021
1 parent 7789e0a commit 358a44c
Showing 1 changed file with 15 additions and 7 deletions.
22 changes: 15 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
cmake_minimum_required(VERSION 3.16.0)
project(Arcade VERSION 0.1.0)
set (CMAKE_CXX_STANDARD 17)
include(GNUInstallDirs)

include(CTest)
enable_testing()
Expand Down Expand Up @@ -84,23 +85,30 @@ list(TRANSFORM HEADER_FILE_NAMES APPEND ".h")
list(TRANSFORM HEADER_FILE_NAMES PREPEND "src/include/")


set(CMAKE_INSTALL_RPATH $ORIGIN/../lib)
add_executable(${PROJECT_NAME} ${SOURCE_FILE_NAMES})

add_executable(Arcade ${SOURCE_FILE_NAMES} ${HEADER_FILE_NAMES})

target_include_directories(Arcade PRIVATE ${PROJECT_SOURCE_DIR}/src/include/)

target_include_directories(${PROJECT_NAME} PUBLIC ${PROJECT_BINARY_DIR})
target_include_directories(Arcade
PRIVATE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src/include/>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/src/include/>
)

#-----------COPY RES DIR-------------------------
file(COPY res DESTINATION "${PROJECT_BINARY_DIR}")
file(COPY res DESTINATION "${CMAKE_CURRENT_BINARY_DIR}")


#-----------------------------------------------------
#---------ADD SFML LIBRARY----------------------------

add_subdirectory("${PROJECT_SOURCE_DIR}/external/SFML")
add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/external/SFML")
target_link_libraries(Arcade sfml-graphics sfml-audio)

install(TARGETS Arcade
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
)
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/res DESTINATION ${CMAKE_INSTALL_BINDIR})

set(CPACK_PROJECT_NAME ${PROJECT_NAME})
set(CPACK_PROJECT_VERSION ${PROJECT_VERSION})
Expand Down

0 comments on commit 358a44c

Please sign in to comment.