Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added a cmake option to disable the INSTALL target #350

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,4 @@ lexander Yashin https://github.com/yashin-alexander
Nils Duval https://github.com/nlsdvl
JackRedstonia [email protected]
David Bullock https://github.com/dwbullock
Emilian Cioca https://github.com/EmilianC
6 changes: 3 additions & 3 deletions contrib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ set (CMAKE_POSITION_INDEPENDENT_CODE ON)
include_directories (../include)

include (Configure.cmake)
#INCLUDE (InstallIncludes.cmake)
#INCLUDE (InstallStaticData.cmake)

if (UNIX AND NOT WIN32 AND NOT APPLE)
if (CMAKE_SIZEOF_VOID_P MATCHES "8")
Expand All @@ -36,4 +34,6 @@ IF (SOLOUD_GENERATE_GLUE)
include (gen_glue.cmake)
endif ()

include (InstallExport)
IF (SOLOUD_INSTALL)
include (InstallExport)
endif ()
3 changes: 3 additions & 0 deletions contrib/Configure.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ print_option_status (SOLOUD_DYNAMIC "Build dynamic library")
option (SOLOUD_STATIC "Set to ON to build static SoLoud" ON)
print_option_status (SOLOUD_STATIC "Build static library")

option (SOLOUD_INSTALL "Set to ON for generating an INSTALL target" ON)
print_option_status (SOLOUD_INSTALL "Generate INSTALL target")

option (SOLOUD_C_API "Set to ON to include the C API" OFF)
print_option_status (SOLOUD_C_API "Build C API")

Expand Down
12 changes: 9 additions & 3 deletions contrib/gen_glue.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ add_custom_command (OUTPUT "${CMAKE_CURRENT_SOURCE_DIR}/../glue/soloud.cs"
DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/../scripts/gen_cs.py"
)
add_custom_target (generate_glue_cs ALL DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/../glue/soloud.cs")
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/../glue/soloud.cs" DESTINATION glue)
if (SOLOUD_INSTALL)
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/../glue/soloud.cs" DESTINATION glue)
endif ()

###############################################################################
# Python API
Expand All @@ -33,7 +35,9 @@ add_custom_command (OUTPUT "${CMAKE_CURRENT_SOURCE_DIR}/../glue/soloud.rb"
DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/../scripts/gen_ruby.py"
)
add_custom_target (generate_glue_ruby ALL DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/../glue/soloud.rb")
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/../glue/soloud.rb" DESTINATION glue)
if (SOLOUD_INSTALL)
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/../glue/soloud.rb" DESTINATION glue)
endif ()

###############################################################################
# Ruby API
Expand All @@ -44,4 +48,6 @@ add_custom_command (OUTPUT "${CMAKE_CURRENT_SOURCE_DIR}/../glue/soloud.py"
DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/../scripts/gen_python.py"
)
add_custom_target(generate_glue_python ALL DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/../glue/soloud.py")
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/../glue/soloud.py" DESTINATION glue)
if (SOLOUD_INSTALL)
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/../glue/soloud.py" DESTINATION glue)
endif ()
18 changes: 10 additions & 8 deletions contrib/src.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -165,13 +165,13 @@ if (SOLOUD_BACKEND_SDL2)

endif()

if (SOLOUD_BACKEND_ALSA)
add_definitions (-DWITH_ALSA)
set (BACKENDS_SOURCES
${BACKENDS_SOURCES}
if (SOLOUD_BACKEND_ALSA)
add_definitions (-DWITH_ALSA)

set (BACKENDS_SOURCES
${BACKENDS_SOURCES}
${BACKENDS_PATH}/alsa/soloud_alsa.cpp
)
)

find_library (ALSA_LIBRARY asound)
set (LINK_LIBRARIES
Expand Down Expand Up @@ -296,5 +296,7 @@ endif()

target_link_libraries (${TARGET_NAME} ${LINK_LIBRARIES})

include (Install)
INSTALL(FILES ${TARGET_HEADERS} DESTINATION include/${TARGET_NAME})
if (SOLOUD_INSTALL)
include (Install)
INSTALL(FILES ${TARGET_HEADERS} DESTINATION include/${TARGET_NAME})
endif ()