Improve installation
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
cmake_minimum_required(VERSION 2.6)
|
||||
|
||||
# Set package properties
|
||||
project(wiiuse)
|
||||
project(WiiUse)
|
||||
|
||||
###
|
||||
# Set up options
|
||||
@@ -15,6 +15,7 @@ project(wiiuse)
|
||||
|
||||
option(BUILD_EXAMPLE "Should we build the example app?" YES)
|
||||
option(BUILD_EXAMPLE_SDL "Should we build the SDL-based example app?" YES)
|
||||
option(INSTALL_EXAMPLES "Should we install the example apps?" YES)
|
||||
|
||||
###
|
||||
# Perform build configuration of dependencies
|
||||
|
||||
@@ -2,8 +2,13 @@ find_package(SDL)
|
||||
find_package(OpenGL)
|
||||
find_package(GLUT)
|
||||
|
||||
if(SDL_FOUND)
|
||||
if(SDL_FOUND AND OPENGL_FOUND AND GLUT_FOUND)
|
||||
include_directories(../src ${SDL_INCLUDE_DIR} ${OPENGL_INCLUDE_DIR} ${GLUT_INCLUDE_DIRS})
|
||||
add_executable(example-sdl sdl.c)
|
||||
target_link_libraries(example-sdl wiiuse ${SDL_LIBRARY} ${OPENGL_LIBRARIES} ${GLUT_LIBRARIES})
|
||||
|
||||
if(INSTALL_EXAMPLES)
|
||||
install(TARGETS example-sdl
|
||||
RUNTIME DESTINATION bin COMPONENT examples)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
include_directories(../src)
|
||||
add_executable(example example.c)
|
||||
target_link_libraries(example wiiuse)
|
||||
target_link_libraries(example wiiuse)
|
||||
|
||||
if(INSTALL_EXAMPLES)
|
||||
install(TARGETS example
|
||||
RUNTIME DESTINATION bin COMPONENT examples)
|
||||
endif()
|
||||
@@ -50,12 +50,20 @@ install(TARGETS
|
||||
RUNTIME
|
||||
DESTINATION
|
||||
bin
|
||||
COMPONENT
|
||||
runtime
|
||||
ARCHIVE
|
||||
DESTINATION
|
||||
lib
|
||||
COMPONENT
|
||||
development
|
||||
LIBRARY
|
||||
DESTINATION
|
||||
lib
|
||||
COMPONENT
|
||||
runtime
|
||||
PUBLIC_HEADER
|
||||
DESTINATION
|
||||
include)
|
||||
include
|
||||
COMPONENT
|
||||
development)
|
||||
|
||||
Reference in New Issue
Block a user