Handle being made a subproject
This commit is contained in:
@@ -11,6 +11,10 @@ project(WiiUse)
|
|||||||
# Set up options
|
# Set up options
|
||||||
###
|
###
|
||||||
|
|
||||||
|
if(NOT CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
|
||||||
|
set(SUBPROJECT YES)
|
||||||
|
endif()
|
||||||
|
|
||||||
include("./ParseVersion.cmake")
|
include("./ParseVersion.cmake")
|
||||||
message(STATUS "Configuring WiiUse version ${CPACK_PACKAGE_VERSION}")
|
message(STATUS "Configuring WiiUse version ${CPACK_PACKAGE_VERSION}")
|
||||||
|
|
||||||
@@ -57,6 +61,7 @@ endif()
|
|||||||
# The lib is in the "src" subdirectory
|
# The lib is in the "src" subdirectory
|
||||||
add_subdirectory(src)
|
add_subdirectory(src)
|
||||||
|
|
||||||
|
if(NOT SUBPROJECT)
|
||||||
# Example apps
|
# Example apps
|
||||||
if(BUILD_EXAMPLE)
|
if(BUILD_EXAMPLE)
|
||||||
add_subdirectory(example)
|
add_subdirectory(example)
|
||||||
@@ -65,8 +70,17 @@ endif()
|
|||||||
if(BUILD_EXAMPLE_SDL)
|
if(BUILD_EXAMPLE_SDL)
|
||||||
add_subdirectory(example-sdl)
|
add_subdirectory(example-sdl)
|
||||||
endif()
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(SUBPROJECT)
|
||||||
|
set(WIIUSE_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src" PARENT_SCOPE)
|
||||||
|
set(WIIUSE_INCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/src" PARENT_SCOPE)
|
||||||
|
set(WIIUSE_LIBRARY wiiuse PARENT_SCOPE)
|
||||||
|
set(WIIUSE_LIBRARIES wiiuse PARENT_SCOPE)
|
||||||
|
set(WIIUSE_FOUND ON PARENT_SCOPE)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(NOT SUBPROJECT)
|
||||||
###
|
###
|
||||||
# Set packaging options (for CPack)
|
# Set packaging options (for CPack)
|
||||||
###
|
###
|
||||||
@@ -118,3 +132,4 @@ cpack_add_component(examples
|
|||||||
cpack_add_component(runtime
|
cpack_add_component(runtime
|
||||||
DISPLAY_NAME "Runtime Library"
|
DISPLAY_NAME "Runtime Library"
|
||||||
REQUIRED)
|
REQUIRED)
|
||||||
|
endif()
|
||||||
|
|||||||
Reference in New Issue
Block a user