diff options
author | Marcel Metz <[email protected]> | 2017-03-04 23:03:53 +0100 |
---|---|---|
committer | Marcel Metz <[email protected]> | 2017-03-05 00:14:49 +0100 |
commit | 27be429ca4b89fc23034c83a11ebcf963c36ba26 (patch) | |
tree | 5bdf15b8d4a77186a2018339ce6695dc516a4732 | |
parent | 9d0bf065eea4ebda8cfd3af1b5deb80f6b4ec906 (diff) |
Rename logical CMake target `openal` to `OpenAL`
-rw-r--r-- | CMakeLists.txt | 72 |
1 files changed, 37 insertions, 35 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 1686587f..345ede2e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -328,7 +328,7 @@ ELSE() # Force enable -fPIC for CMake versions before 2.8.9 (later versions have # the POSITION_INDEPENDENT_CODE target property). The static common library - # will be linked into the dynamic openal library, which requires all its + # will be linked into the dynamic OpenAL library, which requires all its # code to be position-independent. IF(CMAKE_VERSION VERSION_LESS "2.8.9" AND NOT WIN32) CHECK_C_COMPILER_FLAG(-fPIC HAVE_FPIC_SWITCH) @@ -1239,59 +1239,61 @@ CONFIGURE_FILE( # Build main library IF(LIBTYPE STREQUAL "STATIC") - ADD_LIBRARY(openal STATIC ${COMMON_OBJS} ${OPENAL_OBJS} ${ALC_OBJS}) + ADD_LIBRARY(OpenAL STATIC ${COMMON_OBJS} ${OPENAL_OBJS} ${ALC_OBJS}) ELSE() - ADD_LIBRARY(openal SHARED ${COMMON_OBJS} ${OPENAL_OBJS} ${ALC_OBJS}) + ADD_LIBRARY(OpenAL SHARED ${COMMON_OBJS} ${OPENAL_OBJS} ${ALC_OBJS}) ENDIF() -SET_PROPERTY(TARGET openal APPEND PROPERTY COMPILE_FLAGS ${EXTRA_CFLAGS}) -SET_PROPERTY(TARGET openal APPEND PROPERTY COMPILE_DEFINITIONS AL_BUILD_LIBRARY AL_ALEXT_PROTOTYPES) +SET_PROPERTY(TARGET OpenAL APPEND PROPERTY COMPILE_FLAGS ${EXTRA_CFLAGS}) +SET_PROPERTY(TARGET OpenAL APPEND PROPERTY COMPILE_DEFINITIONS AL_BUILD_LIBRARY AL_ALEXT_PROTOTYPES) IF(WIN32 AND ALSOFT_NO_UID_DEFS) - SET_PROPERTY(TARGET openal APPEND PROPERTY COMPILE_DEFINITIONS AL_NO_UID_DEFS) + SET_PROPERTY(TARGET OpenAL APPEND PROPERTY COMPILE_DEFINITIONS AL_NO_UID_DEFS) ENDIF() -SET_PROPERTY(TARGET openal APPEND PROPERTY INCLUDE_DIRECTORIES "${OpenAL_SOURCE_DIR}/OpenAL32/Include" "${OpenAL_SOURCE_DIR}/Alc") +SET_PROPERTY(TARGET OpenAL APPEND PROPERTY INCLUDE_DIRECTORIES "${OpenAL_SOURCE_DIR}/OpenAL32/Include" "${OpenAL_SOURCE_DIR}/Alc") IF(HAVE_ALSA) - SET_PROPERTY(TARGET openal APPEND PROPERTY INCLUDE_DIRECTORIES ${ALSA_INCLUDE_DIRS}) + SET_PROPERTY(TARGET OpenAL APPEND PROPERTY INCLUDE_DIRECTORIES ${ALSA_INCLUDE_DIRS}) ENDIF() IF(HAVE_OSS) - SET_PROPERTY(TARGET openal APPEND PROPERTY INCLUDE_DIRECTORIES ${OSS_INCLUDE_DIRS}) + SET_PROPERTY(TARGET OpenAL APPEND PROPERTY INCLUDE_DIRECTORIES ${OSS_INCLUDE_DIRS}) ENDIF() IF(HAVE_SOLARIS) - SET_PROPERTY(TARGET openal APPEND PROPERTY INCLUDE_DIRECTORIES ${AUDIOIO_INCLUDE_DIRS}) + SET_PROPERTY(TARGET OpenAL APPEND PROPERTY INCLUDE_DIRECTORIES ${AUDIOIO_INCLUDE_DIRS}) ENDIF() IF(HAVE_SNDIO) - SET_PROPERTY(TARGET openal APPEND PROPERTY INCLUDE_DIRECTORIES ${SOUNDIO_INCLUDE_DIRS}) + SET_PROPERTY(TARGET OpenAL APPEND PROPERTY INCLUDE_DIRECTORIES ${SOUNDIO_INCLUDE_DIRS}) ENDIF() IF(HAVE_QSA) - SET_PROPERTY(TARGET openal APPEND PROPERTY INCLUDE_DIRECTORIES ${QSA_INCLUDE_DIRS}) + SET_PROPERTY(TARGET OpenAL APPEND PROPERTY INCLUDE_DIRECTORIES ${QSA_INCLUDE_DIRS}) ENDIF() IF(HAVE_DSOUND) - SET_PROPERTY(TARGET openal APPEND PROPERTY INCLUDE_DIRECTORIES ${DSOUND_INCLUDE_DIRS}) + SET_PROPERTY(TARGET OpenAL APPEND PROPERTY INCLUDE_DIRECTORIES ${DSOUND_INCLUDE_DIRS}) ENDIF() IF(HAVE_PORTAUDIO) - SET_PROPERTY(TARGET openal APPEND PROPERTY INCLUDE_DIRECTORIES ${PORTAUDIO_INCLUDE_DIRS}) + SET_PROPERTY(TARGET OpenAL APPEND PROPERTY INCLUDE_DIRECTORIES ${PORTAUDIO_INCLUDE_DIRS}) ENDIF() IF(HAVE_PULSEAUDIO) - SET_PROPERTY(TARGET openal APPEND PROPERTY INCLUDE_DIRECTORIES ${PULSEAUDIO_INCLUDE_DIRS}) + SET_PROPERTY(TARGET OpenAL APPEND PROPERTY INCLUDE_DIRECTORIES ${PULSEAUDIO_INCLUDE_DIRS}) ENDIF() IF(HAVE_JACK) - SET_PROPERTY(TARGET openal APPEND PROPERTY INCLUDE_DIRECTORIES ${JACK_INCLUDE_DIRS}) + SET_PROPERTY(TARGET OpenAL APPEND PROPERTY INCLUDE_DIRECTORIES ${JACK_INCLUDE_DIRS}) ENDIF() IF(WIN32) IF(MSVC) - SET_PROPERTY(TARGET openal APPEND_STRING PROPERTY LINK_FLAGS " /SUBSYSTEM:WINDOWS") + SET_PROPERTY(TARGET OpenAL APPEND_STRING PROPERTY LINK_FLAGS " /SUBSYSTEM:WINDOWS") ELSEIF(CMAKE_COMPILER_IS_GNUCC) - SET_PROPERTY(TARGET openal APPEND_STRING PROPERTY LINK_FLAGS " -mwindows") + SET_PROPERTY(TARGET OpenAL APPEND_STRING PROPERTY LINK_FLAGS " -mwindows") ENDIF() ENDIF() -SET_TARGET_PROPERTIES(openal PROPERTIES VERSION ${LIB_VERSION} +SET_TARGET_PROPERTIES(OpenAL PROPERTIES VERSION ${LIB_VERSION} SOVERSION ${LIB_MAJOR_VERSION}) -IF(WIN32) - SET_TARGET_PROPERTIES(openal PROPERTIES OUTPUT_NAME "OpenAL32") +IF(NOT WIN32) + SET_TARGET_PROPERTIES(OpenAL PROPERTIES OUTPUT_NAME "openal") +ELSE() + SET_TARGET_PROPERTIES(OpenAL PROPERTIES OUTPUT_NAME "OpenAL32") ENDIF() if(WIN32 AND NOT LIBTYPE STREQUAL "STATIC") - SET_TARGET_PROPERTIES(openal PROPERTIES PREFIX "") + SET_TARGET_PROPERTIES(OpenAL PROPERTIES PREFIX "") IF(MINGW AND ALSOFT_BUILD_IMPORT_LIB) FIND_PROGRAM(SED_EXECUTABLE NAMES sed DOC "sed executable") @@ -1305,8 +1307,8 @@ if(WIN32 AND NOT LIBTYPE STREQUAL "STATIC") MESSAGE(STATUS "WARNING: Cannot find dlltool, disabling .def/.lib generation") ENDIF() ELSE() - SET_PROPERTY(TARGET openal APPEND_STRING PROPERTY LINK_FLAGS " -Wl,--output-def,OpenAL32.def") - ADD_CUSTOM_COMMAND(TARGET openal POST_BUILD + SET_PROPERTY(TARGET OpenAL APPEND_STRING PROPERTY LINK_FLAGS " -Wl,--output-def,OpenAL32.def") + ADD_CUSTOM_COMMAND(TARGET OpenAL POST_BUILD COMMAND "${SED_EXECUTABLE}" -i -e "s/ @[^ ]*//" OpenAL32.def COMMAND "${DLLTOOL_EXECUTABLE}" -d OpenAL32.def -l OpenAL32.lib -D OpenAL32.dll COMMENT "Stripping ordinals from OpenAL32.def and generating OpenAL32.lib..." @@ -1316,14 +1318,14 @@ if(WIN32 AND NOT LIBTYPE STREQUAL "STATIC") ENDIF() ENDIF() -TARGET_LINK_LIBRARIES(openal ${EXTRA_LIBS}) +TARGET_LINK_LIBRARIES(OpenAL ${EXTRA_LIBS}) IF(TARGET build_version) - ADD_DEPENDENCIES(openal build_version) + ADD_DEPENDENCIES(OpenAL build_version) ENDIF() IF(ALSOFT_INSTALL) # Add an install target here - INSTALL(TARGETS openal + INSTALL(TARGETS OpenAL RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} @@ -1398,7 +1400,7 @@ ENDIF() IF(ALSOFT_UTILS) ADD_EXECUTABLE(openal-info utils/openal-info.c) SET_PROPERTY(TARGET openal-info APPEND PROPERTY COMPILE_FLAGS ${EXTRA_CFLAGS}) - TARGET_LINK_LIBRARIES(openal-info openal) + TARGET_LINK_LIBRARIES(openal-info OpenAL) ADD_EXECUTABLE(makehrtf utils/makehrtf.c) SET_PROPERTY(TARGET makehrtf APPEND PROPERTY COMPILE_FLAGS ${EXTRA_CFLAGS}) @@ -1432,7 +1434,7 @@ IF(ALSOFT_TESTS) SET_PROPERTY(TARGET test-common APPEND PROPERTY COMPILE_FLAGS ${EXTRA_CFLAGS}) ADD_EXECUTABLE(altonegen examples/altonegen.c ${COMMON_OBJS}) - TARGET_LINK_LIBRARIES(altonegen test-common openal) + TARGET_LINK_LIBRARIES(altonegen test-common OpenAL) SET_PROPERTY(TARGET altonegen APPEND PROPERTY COMPILE_FLAGS ${EXTRA_CFLAGS}) IF(ALSOFT_INSTALL) @@ -1459,7 +1461,7 @@ IF(ALSOFT_EXAMPLES) ADD_EXECUTABLE(alstream examples/alstream.c ${COMMON_OBJS}) TARGET_LINK_LIBRARIES(alstream ex-common ${SDL_SOUND_LIBRARIES} ${SDL2_LIBRARY} - openal) + OpenAL) SET_PROPERTY(TARGET alstream APPEND PROPERTY COMPILE_FLAGS ${EXTRA_CFLAGS}) SET_PROPERTY(TARGET alstream APPEND PROPERTY INCLUDE_DIRECTORIES ${SDL2_INCLUDE_DIR} ${SDL_SOUND_INCLUDE_DIR} @@ -1467,7 +1469,7 @@ IF(ALSOFT_EXAMPLES) ADD_EXECUTABLE(alreverb examples/alreverb.c ${COMMON_OBJS}) TARGET_LINK_LIBRARIES(alreverb ex-common ${SDL_SOUND_LIBRARIES} ${SDL2_LIBRARY} - openal) + OpenAL) SET_PROPERTY(TARGET alreverb APPEND PROPERTY COMPILE_FLAGS ${EXTRA_CFLAGS}) SET_PROPERTY(TARGET alreverb APPEND PROPERTY INCLUDE_DIRECTORIES ${SDL2_INCLUDE_DIR} ${SDL_SOUND_INCLUDE_DIR} @@ -1475,7 +1477,7 @@ IF(ALSOFT_EXAMPLES) ADD_EXECUTABLE(allatency examples/allatency.c ${COMMON_OBJS}) TARGET_LINK_LIBRARIES(allatency ex-common ${SDL_SOUND_LIBRARIES} ${SDL2_LIBRARY} - openal) + OpenAL) SET_PROPERTY(TARGET allatency APPEND PROPERTY COMPILE_FLAGS ${EXTRA_CFLAGS}) SET_PROPERTY(TARGET allatency APPEND PROPERTY INCLUDE_DIRECTORIES ${SDL2_INCLUDE_DIR} ${SDL_SOUND_INCLUDE_DIR} @@ -1483,7 +1485,7 @@ IF(ALSOFT_EXAMPLES) ADD_EXECUTABLE(alloopback examples/alloopback.c ${COMMON_OBJS}) TARGET_LINK_LIBRARIES(alloopback ex-common ${SDL_SOUND_LIBRARIES} ${SDL2_LIBRARY} - openal) + OpenAL) SET_PROPERTY(TARGET alloopback APPEND PROPERTY COMPILE_FLAGS ${EXTRA_CFLAGS}) SET_PROPERTY(TARGET alloopback APPEND PROPERTY INCLUDE_DIRECTORIES ${SDL2_INCLUDE_DIR} ${SDL_SOUND_INCLUDE_DIR} @@ -1491,7 +1493,7 @@ IF(ALSOFT_EXAMPLES) ADD_EXECUTABLE(alhrtf examples/alhrtf.c ${COMMON_OBJS}) TARGET_LINK_LIBRARIES(alhrtf ex-common ${SDL_SOUND_LIBRARIES} ${SDL2_LIBRARY} - openal) + OpenAL) SET_PROPERTY(TARGET alhrtf APPEND PROPERTY COMPILE_FLAGS ${EXTRA_CFLAGS}) SET_PROPERTY(TARGET alhrtf APPEND PROPERTY INCLUDE_DIRECTORIES ${SDL2_INCLUDE_DIR} ${SDL_SOUND_INCLUDE_DIR} @@ -1534,7 +1536,7 @@ IF(ALSOFT_EXAMPLES) ENDIF() IF(FFVER_OK AND NOT MSVC) ADD_EXECUTABLE(alffplay examples/alffplay.c ${COMMON_OBJS}) - TARGET_LINK_LIBRARIES(alffplay ${SDL2_LIBRARY} openal ${FFMPEG_LIBRARIES}) + TARGET_LINK_LIBRARIES(alffplay ${SDL2_LIBRARY} OpenAL ${FFMPEG_LIBRARIES}) SET_PROPERTY(TARGET alffplay APPEND PROPERTY COMPILE_FLAGS ${EXTRA_CFLAGS}) SET_PROPERTY(TARGET alffplay APPEND PROPERTY INCLUDE_DIRECTORIES ${SDL2_INCLUDE_DIR} ${FFMPEG_INCLUDE_DIRS} |