New install target.

This commit is contained in:
Nicolás Ortega Froysa 2018-03-25 12:30:39 +02:00
parent 1cdd5964f0
commit 8c19b96bb7
No known key found for this signature in database
GPG Key ID: FEC70E3BAE2E69BF
2 changed files with 19 additions and 5 deletions

View File

@ -33,8 +33,13 @@ set(CMAKE_C_FLAGS_RELEASE "-O3")
set(CMAKE_C_FLAGS_RELWITHDEBINFO "-g -O3")
set(CMAKE_C_FLAGS_MINSIZEREL "-Os")
# TODO: detect libraries here
# TODO: set include directories here
find_package(PkgConfig REQUIRED)
pkg_check_modules(ALLEG5 REQUIRED allegro-5)
pkg_check_modules(ALLEG5-PRIM REQUIRED allegro_primitives-5)
pkg_check_modules(ALLEG5-FONT REQUIRED allegro_font-5)
include_directories(
SYSTEM ${ALLEG5_INCLUDE_DIRS})
set(SRCS
src/main.c)
@ -50,6 +55,11 @@ endif()
add_executable(${TARGET_NAME} ${SRCS})
# TODO: link libraries
target_link_libraries(${TARGET_NAME}
${ALLEG5_LIBRARIES}
${ALLEG5-PRIM_LIBRARIES}
${ALLEG5-FONT_LIBRARIES})
# TODO: create install instructions
install(TARGETS ${TARGET_NAME}
RUNTIME DESTINATION bin/
CONFIGURATIONS release minsizerel)

6
README
View File

@ -21,7 +21,11 @@ You can then compile the program via the following commands:
This will create a release build with compiler optimizations. If you would like
a debug build then pass the `-DCMAKE_BUILD_TYPE=debug' flag to the `cmake'
command.
command. If you would like to install then run `cmake' with the additional flag
`-DCMAKE_INSTALL_PREFIX=<install_dir>'. If you are installing as a user then
you may want to set the installation prefix to `/usr/local/', and if you're
packaging then please consult your distribution's policies. With this you
should be able to run the `make install' target and install the binary.
# Contributing
--------------