Mercurial > almixer_isolated
diff CMakeLists.txt @ 7:ee50db043251
Cross-platform fixes.
author | Eric Wing <ewing . public |-at-| gmail . com> |
---|---|
date | Thu, 28 Oct 2010 02:33:05 -0700 |
parents | 8cb13d89451a |
children | a71ed111a627 |
line wrap: on
line diff
--- a/CMakeLists.txt Thu Oct 28 02:32:46 2010 -0700 +++ b/CMakeLists.txt Thu Oct 28 02:33:05 2010 -0700 @@ -81,16 +81,17 @@ IF(WANTS_BUILD_SHARED_LIBRARY) - ADD_LIBRARY(ALMIXER_LIBRARY SHARED ${PUBLIC_HEADERS} ${ALMIXER_SOURCE} ${RESOURCE_FILES}) + #ADD_LIBRARY(ALmixer SHARED ${PUBLIC_HEADERS} ${ALMIXER_SOURCE} ${RESOURCE_FILES}) + ADD_LIBRARY(ALmixer SHARED ${PUBLIC_HEADERS} ${ALMIXER_SOURCE}) ELSE(WANTS_BUILD_SHARED_LIBRARY) - ADD_LIBRARY(ALMIXER_LIBRARY STATIC ${PUBLIC_HEADERS} ${ALMIXER_SOURCE} ${RESOURCE_FILES}) + ADD_LIBRARY(ALmixer STATIC ${PUBLIC_HEADERS} ${ALMIXER_SOURCE} ${RESOURCE_FILES}) ENDIF(WANTS_BUILD_SHARED_LIBRARY) -SET_TARGET_PROPERTIES(ALMIXER_LIBRARY PROPERTIES OUTPUT_NAME "ALmixer") +#SET_TARGET_PROPERTIES(ALmixer PROPERTIES OUTPUT_NAME "ALmixer") # Set Dynamic Library and Framework properties IF(WANTS_BUILD_SHARED_LIBRARY AND WANTS_BUILD_FRAMEWORK) - SET_TARGET_PROPERTIES(ALMIXER_LIBRARY PROPERTIES + SET_TARGET_PROPERTIES(ALmixer PROPERTIES FRAMEWORK TRUE FRAMEWORK_VERSION "${ALMIXER_FRAMEWORK_VERSION_NUMBER}" # PRIVATE_HEADER "fooPrivate.h;fooBoth.h" @@ -105,8 +106,8 @@ # I moved the INSTALL_NAME_DIR to use SET_PROPERTY instead because # SET_TARGET_PROPERTIES will fail if the variable is empty. - SET_PROPERTY(TARGET ALMIXER_LIBRARY PROPERTY INSTALL_NAME_DIR ${CMAKE_FRAMEWORK_INSTALL_NAME_DIR}) - SET_PROPERTY(TARGET ALMIXER_LIBRARY PROPERTY BUILD_WITH_INSTALL_RPATH NO) + SET_PROPERTY(TARGET ALmixer PROPERTY INSTALL_NAME_DIR ${CMAKE_FRAMEWORK_INSTALL_NAME_DIR}) + SET_PROPERTY(TARGET ALmixer PROPERTY BUILD_WITH_INSTALL_RPATH NO) # If the user deletes the install_name path, use the gcc default # and disable the option completely. But CMake by default places # the name of the library in the install_name if @@ -114,11 +115,11 @@ # disable the switch. IF(CMAKE_FRAMEWORK_INSTALL_NAME_DIR) # MESSAGE("got dir ${CMAKE_FRAMEWORK_INSTALL_NAME_DIR}") - SET_PROPERTY(TARGET ALMIXER_LIBRARY PROPERTY BUILD_WITH_INSTALL_RPATH ${CMAKE_BUILD_WITH_INSTALL_RPATH}) + SET_PROPERTY(TARGET ALmixer PROPERTY BUILD_WITH_INSTALL_RPATH ${CMAKE_BUILD_WITH_INSTALL_RPATH}) ELSE(CMAKE_FRAMEWORK_INSTALL_NAME_DIR) # MESSAGE("no dir ${CMAKE_FRAMEWORK_INSTALL_NAME_DIR}") - SET_PROPERTY(TARGET ALMIXER_LIBRARY PROPERTY BUILD_WITH_INSTALL_RPATH NO) + SET_PROPERTY(TARGET ALmixer PROPERTY BUILD_WITH_INSTALL_RPATH NO) ENDIF(CMAKE_FRAMEWORK_INSTALL_NAME_DIR) @@ -133,7 +134,7 @@ ELSEIF(WANTS_BUILD_SHARED_LIBRARY) IF(APPLE) - SET_TARGET_PROPERTIES(ALMIXER_LIBRARY PROPERTIES + SET_TARGET_PROPERTIES(ALmixer PROPERTIES FRAMEWORK FALSE # INSTALL_NAME_DIR ${CMAKE_DYLIB_INSTALL_NAME_DIR} # BUILD_WITH_INSTALL_RPATH ${CMAKE_BUILD_WITH_INSTALL_RPATH} @@ -143,23 +144,23 @@ ) # I moved the INSTALL_NAME_DIR to use SET_PROPERTY instead because # SET_TARGET_PROPERTIES will fail if the variable is empty. - SET_PROPERTY(TARGET ALMIXER_LIBRARY PROPERTY INSTALL_NAME_DIR ${CMAKE_DYLIB_INSTALL_NAME_DIR}) - SET_PROPERTY(TARGET ALMIXER_LIBRARY PROPERTY BUILD_WITH_INSTALL_RPATH NO) + SET_PROPERTY(TARGET ALmixer PROPERTY INSTALL_NAME_DIR ${CMAKE_DYLIB_INSTALL_NAME_DIR}) + SET_PROPERTY(TARGET ALmixer PROPERTY BUILD_WITH_INSTALL_RPATH NO) # If the user deletes the install_name path, use the gcc default # and disable the option completely. But CMake by default places # the name of the library in the install_name if # BUILD_WITH_INSTALL_RPATH is ON. So to avoid this, I need to # disable the switch. IF(CMAKE_DYLIB_INSTALL_NAME_DIR) - SET_PROPERTY(TARGET ALMIXER_LIBRARY PROPERTY BUILD_WITH_INSTALL_RPATH ${CMAKE_BUILD_WITH_INSTALL_RPATH}) + SET_PROPERTY(TARGET ALmixer PROPERTY BUILD_WITH_INSTALL_RPATH ${CMAKE_BUILD_WITH_INSTALL_RPATH}) ELSE(CMAKE_DYLIB_INSTALL_NAME_DIR) - SET_PROPERTY(TARGET ALMIXER_LIBRARY PROPERTY BUILD_WITH_INSTALL_RPATH OFF) + SET_PROPERTY(TARGET ALmixer PROPERTY BUILD_WITH_INSTALL_RPATH OFF) ENDIF(CMAKE_DYLIB_INSTALL_NAME_DIR) ELSEIF(UNIX) - SET_TARGET_PROPERTIES(ALMIXER_LIBRARY PROPERTIES + SET_TARGET_PROPERTIES(ALmixer PROPERTIES INSTALL_RPATH ${CMAKE_INSTALL_RPATH} BUILD_WITH_INSTALL_RPATH ${CMAKE_BUILD_WITH_INSTALL_RPATH} VERSION ${ALMIXER_VERSION} @@ -168,14 +169,14 @@ ) ELSEIF(WIN32) - SET_TARGET_PROPERTIES(ALMIXER_LIBRARY PROPERTIES - VERSION ${ALMIXER_VERSION} - SOVERSION ${ALMIXER_COMPATIBILITY_VERSION} -# COMPILE_FLAGS "${ALMIXER_C_FLAGS} -DALMIXER_BUILD_AS_DLL" - ) + MESSAGE("Win32") + # SET_TARGET_PROPERTIES(ALmixer PROPERTIES + # VERSION ${ALMIXER_VERSION} + # SOVERSION ${ALMIXER_COMPATIBILITY_VERSION} + #) ELSE(APPLE) - SET_TARGET_PROPERTIES(ALMIXER_LIBRARY PROPERTIES + SET_TARGET_PROPERTIES(ALmixer PROPERTIES VERSION ${ALMIXER_VERSION} SOVERSION ${ALMIXER_COMPATIBILITY_VERSION} # COMPILE_FLAGS "${ALMIXER_C_FLAGS}" @@ -187,7 +188,7 @@ ENDIF(WANTS_BUILD_SHARED_LIBRARY AND WANTS_BUILD_FRAMEWORK) INCLUDE_DIRECTORIES(${OPENAL_INCLUDE_DIR} ${SDL_INCLUDE_DIR} ${SDL_SOUND_INCLUDE_DIR}) -TARGET_LINK_LIBRARIES(ALMIXER_LIBRARY ${OPENAL_LIBRARY} ${SDL_SOUND_LIBRARIES} ${SDL_LIBRARY}) +TARGET_LINK_LIBRARIES(ALmixer ${OPENAL_LIBRARY} ${SDL_SOUND_LIBRARIES} ${SDL_LIBRARY}) @@ -262,12 +263,12 @@ IF(APPLE AND WANTS_BUILD_SHARED_LIBRARY AND WANTS_BUILD_FRAMEWORK) # Will install framework to /Library/Frameworks directory or user specified INSTALL(TARGETS - ALMIXER_LIBRARY + ALmixer FRAMEWORK DESTINATION ${CMAKE_FRAMEWORK_INSTALL_DIR} ) ELSE(APPLE AND WANTS_BUILD_SHARED_LIBRARY AND WANTS_BUILD_FRAMEWORK) INSTALL(TARGETS - ALMIXER_LIBRARY + ALmixer LIBRARY DESTINATION lib ARCHIVE DESTINATION lib PUBLIC_HEADER DESTINATION include