Commit 0be13f82 authored by deuce's avatar deuce
Browse files

Export cmake configs and install them.

Don't create options until there's a use for them.
parent 0947d80a
...@@ -9,8 +9,6 @@ INCLUDE (FindSDL) ...@@ -9,8 +9,6 @@ INCLUDE (FindSDL)
INCLUDE (FindX11) INCLUDE (FindX11)
INCLUDE (FindPkgConfig) INCLUDE (FindPkgConfig)
option(SDL_AUDIO "Set to OFF to disable SDL for audio output" ON)
set(SOURCE set(SOURCE
conwrap.c conwrap.c
dat_file.c dat_file.c
...@@ -41,15 +39,13 @@ if(NOT WIN32) ...@@ -41,15 +39,13 @@ if(NOT WIN32)
list(APPEND SOURCE xpsem.c) list(APPEND SOURCE xpsem.c)
endif() endif()
if(SDL_AUDIO) if(SDL_FOUND)
if(SDL_FOUND) list(APPEND SOURCE sdlfuncs.c)
list(APPEND SOURCE sdlfuncs.c) if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") list(APPEND SOURCE SDLMain.m)
list(APPEND SOURCE SDLMain.m) endif()
endif() if(WIN32)
if(WIN32) list(APPEND SOURCE SDL_win32_main.c)
list(APPEND SOURCE SDL_win32_main.c)
endif()
endif() endif()
endif() endif()
...@@ -126,11 +122,9 @@ if(HAS_SRANDOMDEV_FUNC) ...@@ -126,11 +122,9 @@ if(HAS_SRANDOMDEV_FUNC)
target_compile_definitions(xpdev PRIVATE HAS_SRANDOMDEV_FUNC) target_compile_definitions(xpdev PRIVATE HAS_SRANDOMDEV_FUNC)
endif() endif()
if(SDL_AUDIO) if(SDL_FOUND)
if(SDL_FOUND) target_include_directories(xpdev PRIVATE ${SDL_INCLUDE_DIR})
target_include_directories(xpdev PRIVATE ${SDL_INCLUDE_DIR}) target_compile_definitions(xpdev PUBLIC ${WITH_SDL_AUDIO})
target_compile_definitions(xpdev PRIVATE ${WITH_SDL_AUDIO})
endif()
endif() endif()
if(X11_FOUND) if(X11_FOUND)
...@@ -192,5 +186,9 @@ if(NOT WIN32) ...@@ -192,5 +186,9 @@ if(NOT WIN32)
list(APPEND INSTALL_HEADERS xpsem.h) list(APPEND INSTALL_HEADERS xpsem.h)
endif() endif()
install(TARGETS xpdev DESTINATION bin) export(PACKAGE XPDev)
export(TARGETS xpdev FILE xpdev.cmake)
install(TARGETS xpdev DESTINATION lib EXPORT XPDev)
install(FILES ${INSTALL_HEADERS} DESTINATION include/xpdev) install(FILES ${INSTALL_HEADERS} DESTINATION include/xpdev)
install(EXPORT XPDev DESTINATION lib/cmake/xpdev)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment