Improve installation

This commit is contained in:
Ryan Pavlik
2010-11-11 12:06:14 -06:00
parent 737a04255b
commit c2c1dca625
4 changed files with 23 additions and 4 deletions

View File

@@ -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

View File

@@ -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()

View File

@@ -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()

View File

@@ -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)