Skip to content

Commit

Permalink
Compiles and links against CMake built debug and release dependencies…
Browse files Browse the repository at this point in the history
… on Windows.
  • Loading branch information
bitshifter committed Jul 13, 2011
1 parent caffd3f commit 0c572e7
Show file tree
Hide file tree
Showing 20 changed files with 270 additions and 84 deletions.
8 changes: 5 additions & 3 deletions Bindings/Contents/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ SET(polycodeLua_HDRS
LUA/Include/PolycodeLUA2D.h
)

SET(CMAKE_DEBUG_POSTFIX "_d")

IF(POLYCODE_BUILD_SHARED)
ADD_LIBRARY(PolycodeLua SHARED ${polycodeLua_SRCS} ${polycodeLua_HDRS})
TARGET_LINK_LIBRARIES(PolycodeLua PolyCore ${LUA_LIBRARY})
Expand All @@ -30,14 +32,14 @@ ENDIF(POLYCODE_BUILD_STATIC)
IF(POLYCODE_INSTALL_FRAMEWORK)

# install headers
INSTALL(FILES ${polycodeLua_HDRS} DESTINATION Framework/Modules/Include)
INSTALL(FILES ${polycodeLua_HDRS} DESTINATION ${POLYCODE_RELEASE_DIR}/Framework/Modules/Include)

# install libraries
IF(POLYCODE_BUILD_SHARED)
INSTALL(TARGETS PolycodeLua DESTINATION Framework/Modules/Lib/${CMAKE_BUILD_TYPE})
INSTALL(TARGETS PolycodeLua DESTINATION ${POLYCODE_RELEASE_DIR}/Framework/Modules/Lib)
ENDIF(POLYCODE_BUILD_SHARED)
IF(POLYCODE_BUILD_STATIC)
INSTALL(TARGETS PolycodeLua_static DESTINATION Framework/Modules/Lib/${CMAKE_BUILD_TYPE})
INSTALL(TARGETS PolycodeLua_static DESTINATION ${POLYCODE_RELEASE_DIR}/Framework/Modules/Lib)
ENDIF(POLYCODE_BUILD_STATIC)

ENDIF(POLYCODE_INSTALL_FRAMEWORK)
4 changes: 2 additions & 2 deletions CMake/ExternalAssimp.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ INSTALL(DIRECTORY ${install_dir}/include/

# install debug lib
INSTALL(FILES ${install_dir}/lib/assimp${CMAKE_STATIC_LIBRARY_SUFFIX}
DESTINATION ${POLYCODE_DEPS_TOOLS_PREFIX}/Lib/Debug
DESTINATION ${POLYCODE_DEPS_TOOLS_PREFIX}/Lib
CONFIGURATIONS Debug
RENAME assimpd${CMAKE_STATIC_LIBRARY_SUFFIX})

# install release lib
INSTALL(FILES ${install_dir}/lib/assimp${CMAKE_STATIC_LIBRARY_SUFFIX}
DESTINATION ${POLYCODE_DEPS_TOOLS_PREFIX}/Lib/Release
DESTINATION ${POLYCODE_DEPS_TOOLS_PREFIX}/Lib
CONFIGURATIONS Release)
4 changes: 2 additions & 2 deletions CMake/ExternalBox2D.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ INSTALL(DIRECTORY ${install_dir}/include/

# install debug lib
INSTALL(FILES ${install_dir}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}Box2D${CMAKE_STATIC_LIBRARY_SUFFIX}
DESTINATION ${POLYCODE_DEPS_MODULES_PREFIX}/Lib/Debug
DESTINATION ${POLYCODE_DEPS_MODULES_PREFIX}/Lib
CONFIGURATIONS Debug
RENAME Box2D_d${CMAKE_STATIC_LIBRARY_SUFFIX})

# install release lib
INSTALL(FILES ${install_dir}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}Box2D${CMAKE_STATIC_LIBRARY_SUFFIX}
DESTINATION ${POLYCODE_DEPS_MODULES_PREFIX}/Lib/Release
DESTINATION ${POLYCODE_DEPS_MODULES_PREFIX}/Lib
CONFIGURATIONS Release)

16 changes: 8 additions & 8 deletions CMake/ExternalBullet.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -35,38 +35,38 @@ INSTALL(DIRECTORY ${install_dir}/include/

# install debug libs
INSTALL(FILES ${install_dir}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}BulletDynamics${CMAKE_STATIC_LIBRARY_SUFFIX}
DESTINATION ${POLYCODE_DEPS_MODULES_PREFIX}/Lib/Debug
DESTINATION ${POLYCODE_DEPS_MODULES_PREFIX}/Lib
CONFIGURATIONS Debug
RENAME BulletDynamics_d${CMAKE_STATIC_LIBRARY_SUFFIX})

INSTALL(FILES ${install_dir}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}BulletCollision${CMAKE_STATIC_LIBRARY_SUFFIX}
DESTINATION ${POLYCODE_DEPS_MODULES_PREFIX}/Lib/Debug
DESTINATION ${POLYCODE_DEPS_MODULES_PREFIX}/Lib
CONFIGURATIONS Debug
RENAME BulletCollision_d${CMAKE_STATIC_LIBRARY_SUFFIX})

INSTALL(FILES ${install_dir}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}BulletSoftBody${CMAKE_STATIC_LIBRARY_SUFFIX}
DESTINATION ${POLYCODE_DEPS_MODULES_PREFIX}/Lib/Debug
DESTINATION ${POLYCODE_DEPS_MODULES_PREFIX}/Lib
CONFIGURATIONS Debug
RENAME BulletSoftBody_d${CMAKE_STATIC_LIBRARY_SUFFIX})

INSTALL(FILES ${install_dir}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}LinearMath${CMAKE_STATIC_LIBRARY_SUFFIX}
DESTINATION ${POLYCODE_DEPS_MODULES_PREFIX}/Lib/Debug
DESTINATION ${POLYCODE_DEPS_MODULES_PREFIX}/Lib
CONFIGURATIONS Debug
RENAME LinearMath_d${CMAKE_STATIC_LIBRARY_SUFFIX})

# install release libs
INSTALL(FILES ${install_dir}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}BulletDynamics${CMAKE_STATIC_LIBRARY_SUFFIX}
DESTINATION ${POLYCODE_DEPS_MODULES_PREFIX}/Lib/Release
DESTINATION ${POLYCODE_DEPS_MODULES_PREFIX}/Lib
CONFIGURATIONS Release)

INSTALL(FILES ${install_dir}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}BulletCollision${CMAKE_STATIC_LIBRARY_SUFFIX}
DESTINATION ${POLYCODE_DEPS_MODULES_PREFIX}/Lib/Release
DESTINATION ${POLYCODE_DEPS_MODULES_PREFIX}/Lib
CONFIGURATIONS Release)

INSTALL(FILES ${install_dir}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}BulletSoftBody${CMAKE_STATIC_LIBRARY_SUFFIX}
DESTINATION ${POLYCODE_DEPS_MODULES_PREFIX}/Lib/Release
DESTINATION ${POLYCODE_DEPS_MODULES_PREFIX}/Lib
CONFIGURATIONS Release)

INSTALL(FILES ${install_dir}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}LinearMath${CMAKE_STATIC_LIBRARY_SUFFIX}
DESTINATION ${POLYCODE_DEPS_MODULES_PREFIX}/Lib/Release
DESTINATION ${POLYCODE_DEPS_MODULES_PREFIX}/Lib
CONFIGURATIONS Release)
6 changes: 3 additions & 3 deletions CMake/ExternalFreetype.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ INSTALL(DIRECTORY ${install_dir}/include/
FILES_MATCHING PATTERN "*.h")

# install debug libs
INSTALL(FILES ${install_dir}/lib/freetyped${CMAKE_STATIC_LIBRARY_SUFFIX}
DESTINATION ${POLYCODE_DEPS_CORE_PREFIX}/Lib/Debug
INSTALL(FILES ${install_dir}/lib/freetype_d${CMAKE_STATIC_LIBRARY_SUFFIX}
DESTINATION ${POLYCODE_DEPS_CORE_PREFIX}/Lib
CONFIGURATIONS Debug)

# install release lib
INSTALL(FILES ${install_dir}/lib/freetype${CMAKE_STATIC_LIBRARY_SUFFIX}
DESTINATION ${POLYCODE_DEPS_CORE_PREFIX}/Lib/Release
DESTINATION ${POLYCODE_DEPS_CORE_PREFIX}/Lib
CONFIGURATIONS Release)
24 changes: 12 additions & 12 deletions CMake/ExternalOggVorbis.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -39,52 +39,52 @@ INSTALL(DIRECTORY ${install_dir}/include/

# install debug libs
INSTALL(FILES ${install_dir}/lib/liboggd${CMAKE_STATIC_LIBRARY_SUFFIX}
DESTINATION ${POLYCODE_DEPS_CORE_PREFIX}/Lib/Debug
DESTINATION ${POLYCODE_DEPS_CORE_PREFIX}/Lib
CONFIGURATIONS Debug)

INSTALL(FILES ${install_dir}/lib/libvorbisd${CMAKE_STATIC_LIBRARY_SUFFIX}
DESTINATION ${POLYCODE_DEPS_CORE_PREFIX}/Lib/Debug
DESTINATION ${POLYCODE_DEPS_CORE_PREFIX}/Lib
CONFIGURATIONS Debug)

INSTALL(FILES ${install_dir}/lib/libvorbisfiled${CMAKE_STATIC_LIBRARY_SUFFIX}
DESTINATION ${POLYCODE_DEPS_CORE_PREFIX}/Lib/Debug
DESTINATION ${POLYCODE_DEPS_CORE_PREFIX}/Lib
CONFIGURATIONS Debug)

# install release lib
INSTALL(FILES ${install_dir}/lib/libogg${CMAKE_STATIC_LIBRARY_SUFFIX}
DESTINATION ${POLYCODE_DEPS_CORE_PREFIX}/Lib/Release
DESTINATION ${POLYCODE_DEPS_CORE_PREFIX}/Lib
CONFIGURATIONS Release)

INSTALL(FILES ${install_dir}/lib/libvorbis${CMAKE_STATIC_LIBRARY_SUFFIX}
DESTINATION ${POLYCODE_DEPS_CORE_PREFIX}/Lib/Release
DESTINATION ${POLYCODE_DEPS_CORE_PREFIX}/Lib
CONFIGURATIONS Release)

INSTALL(FILES ${install_dir}/lib/libvorbisfile${CMAKE_STATIC_LIBRARY_SUFFIX}
DESTINATION ${POLYCODE_DEPS_CORE_PREFIX}/Lib/Release
DESTINATION ${POLYCODE_DEPS_CORE_PREFIX}/Lib
CONFIGURATIONS Release)

# install debug shared library
INSTALL(FILES ${install_dir}/bin/liboggd${CMAKE_SHARED_LIBRARY_SUFFIX}
DESTINATION ${POLYCODE_DEPS_CORE_PREFIX}/Bin/Debug
DESTINATION ${POLYCODE_DEPS_CORE_PREFIX}/Bin
CONFIGURATIONS Debug)

INSTALL(FILES ${install_dir}/bin/libvorbisd${CMAKE_SHARED_LIBRARY_SUFFIX}
DESTINATION ${POLYCODE_DEPS_CORE_PREFIX}/Bin/Debug
DESTINATION ${POLYCODE_DEPS_CORE_PREFIX}/Bin
CONFIGURATIONS Debug)

INSTALL(FILES ${install_dir}/bin/libvorbisfiled${CMAKE_SHARED_LIBRARY_SUFFIX}
DESTINATION ${POLYCODE_DEPS_CORE_PREFIX}/Bin/Debug
DESTINATION ${POLYCODE_DEPS_CORE_PREFIX}/Bin
CONFIGURATIONS Debug)

# install release shared library
INSTALL(FILES ${install_dir}/bin/libogg${CMAKE_SHARED_LIBRARY_SUFFIX}
DESTINATION ${POLYCODE_DEPS_CORE_PREFIX}/Bin/Release
DESTINATION ${POLYCODE_DEPS_CORE_PREFIX}/Bin
CONFIGURATIONS Release)

INSTALL(FILES ${install_dir}/bin/libvorbis${CMAKE_SHARED_LIBRARY_SUFFIX}
DESTINATION ${POLYCODE_DEPS_CORE_PREFIX}/Bin/Release
DESTINATION ${POLYCODE_DEPS_CORE_PREFIX}/Bin
CONFIGURATIONS Release)

INSTALL(FILES ${install_dir}/bin/libvorbisfile${CMAKE_SHARED_LIBRARY_SUFFIX}
DESTINATION ${POLYCODE_DEPS_CORE_PREFIX}/Bin/Release
DESTINATION ${POLYCODE_DEPS_CORE_PREFIX}/Bin
CONFIGURATIONS Release)
16 changes: 8 additions & 8 deletions CMake/ExternalOpenAL.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,23 @@ INSTALL(DIRECTORY ${install_dir}/include/
FILES_MATCHING PATTERN "*.h")

# install debug lib
INSTALL(FILES ${install_dir}/lib/OpenAL32${CMAKE_STATIC_LIBRARY_SUFFIX}
DESTINATION ${POLYCODE_DEPS_CORE_PREFIX}/Lib/Debug
INSTALL(FILES ${install_dir}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}OpenAL32${CMAKE_STATIC_LIBRARY_SUFFIX}
DESTINATION ${POLYCODE_DEPS_CORE_PREFIX}/Lib
CONFIGURATIONS Debug
RENAME OpenAL32d${CMAKE_STATIC_LIBRARY_SUFFIX})

# install release lib
INSTALL(FILES ${install_dir}/lib/OpenAL32${CMAKE_STATIC_LIBRARY_SUFFIX}
DESTINATION ${POLYCODE_DEPS_CORE_PREFIX}/Lib/Release
INSTALL(FILES ${install_dir}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}OpenAL32${CMAKE_STATIC_LIBRARY_SUFFIX}
DESTINATION ${POLYCODE_DEPS_CORE_PREFIX}/Lib
CONFIGURATIONS Release)

# install debug shared library
INSTALL(FILES ${install_dir}/bin/OpenAL32${CMAKE_SHARED_LIBRARY_SUFFIX}
DESTINATION ${POLYCODE_DEPS_CORE_PREFIX}/Bin/Debug
INSTALL(FILES ${install_dir}/bin/${CMAKE_SHARED_LIBRARY_PREFIX}OpenAL32${CMAKE_SHARED_LIBRARY_SUFFIX}
DESTINATION ${POLYCODE_DEPS_CORE_PREFIX}/Bin
CONFIGURATIONS Debug
RENAME OpenAL32d${CMAKE_SHARED_LIBRARY_SUFFIX})

# install release shared library
INSTALL(FILES ${install_dir}/bin/OpenAL32${CMAKE_SHARED_LIBRARY_SUFFIX}
DESTINATION ${POLYCODE_DEPS_CORE_PREFIX}/Bin/Release
INSTALL(FILES ${install_dir}/bin/${CMAKE_SHARED_LIBRARY_PREFIX}OpenAL32${CMAKE_SHARED_LIBRARY_SUFFIX}
DESTINATION ${POLYCODE_DEPS_CORE_PREFIX}/Bin
CONFIGURATIONS Release)
16 changes: 8 additions & 8 deletions CMake/ExternalPNG.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -37,36 +37,36 @@ INSTALL(DIRECTORY ${install_dir}/include/

# install debug libs
INSTALL(FILES ${install_dir}/lib/zlibd${CMAKE_STATIC_LIBRARY_SUFFIX}
DESTINATION ${POLYCODE_DEPS_CORE_PREFIX}/Lib/Debug
DESTINATION ${POLYCODE_DEPS_CORE_PREFIX}/Lib
CONFIGURATIONS Debug)

INSTALL(FILES ${install_dir}/lib/libpng15d${CMAKE_STATIC_LIBRARY_SUFFIX}
DESTINATION ${POLYCODE_DEPS_CORE_PREFIX}/Lib/Debug
DESTINATION ${POLYCODE_DEPS_CORE_PREFIX}/Lib
CONFIGURATIONS Debug)

# install release lib
INSTALL(FILES ${install_dir}/lib/zlib${CMAKE_STATIC_LIBRARY_SUFFIX}
DESTINATION ${POLYCODE_DEPS_CORE_PREFIX}/Lib/Release
DESTINATION ${POLYCODE_DEPS_CORE_PREFIX}/Lib
CONFIGURATIONS Release)

INSTALL(FILES ${install_dir}/lib/libpng15${CMAKE_STATIC_LIBRARY_SUFFIX}
DESTINATION ${POLYCODE_DEPS_CORE_PREFIX}/Lib/Release
DESTINATION ${POLYCODE_DEPS_CORE_PREFIX}/Lib
CONFIGURATIONS Release)

# install debug shared library
INSTALL(FILES ${install_dir}/bin/zlibd1${CMAKE_SHARED_LIBRARY_SUFFIX}
DESTINATION ${POLYCODE_DEPS_CORE_PREFIX}/Bin/Debug
DESTINATION ${POLYCODE_DEPS_CORE_PREFIX}/Bin
CONFIGURATIONS Debug)

INSTALL(FILES ${install_dir}/bin/libpng15d${CMAKE_SHARED_LIBRARY_SUFFIX}
DESTINATION ${POLYCODE_DEPS_CORE_PREFIX}/Bin/Debug
DESTINATION ${POLYCODE_DEPS_CORE_PREFIX}/Bin
CONFIGURATIONS Debug)

# install release shared library
INSTALL(FILES ${install_dir}/bin/zlib1${CMAKE_SHARED_LIBRARY_SUFFIX}
DESTINATION ${POLYCODE_DEPS_CORE_PREFIX}/Bin/Release
DESTINATION ${POLYCODE_DEPS_CORE_PREFIX}/Bin
CONFIGURATIONS Release)

INSTALL(FILES ${install_dir}/bin/libpng15${CMAKE_SHARED_LIBRARY_SUFFIX}
DESTINATION ${POLYCODE_DEPS_CORE_PREFIX}/Bin/Release
DESTINATION ${POLYCODE_DEPS_CORE_PREFIX}/Bin
CONFIGURATIONS Release)
14 changes: 4 additions & 10 deletions CMake/ExternalPhysFS.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -23,32 +23,26 @@ INSTALL(DIRECTORY ${install_dir}/include/

# install debug lib
INSTALL(FILES ${install_dir}/lib/physfs${CMAKE_STATIC_LIBRARY_SUFFIX}
DESTINATION ${POLYCODE_DEPS_CORE_PREFIX}/Lib/Debug
DESTINATION ${POLYCODE_DEPS_CORE_PREFIX}/Lib
CONFIGURATIONS Debug
RENAME physfsd${CMAKE_STATIC_LIBRARY_SUFFIX})

# install release lib
INSTALL(FILES ${install_dir}/lib/physfs${CMAKE_STATIC_LIBRARY_SUFFIX}
DESTINATION ${POLYCODE_DEPS_CORE_PREFIX}/Lib/Release
DESTINATION ${POLYCODE_DEPS_CORE_PREFIX}/Lib
CONFIGURATIONS Release)

# install debug shared library
INSTALL(FILES ${install_dir}/bin/physfs${CMAKE_SHARED_LIBRARY_SUFFIX}
DESTINATION ${POLYCODE_DEPS_CORE_PREFIX}/Bin/Debug
DESTINATION ${POLYCODE_DEPS_CORE_PREFIX}/Bin
CONFIGURATIONS Debug
RENAME physfsd${CMAKE_SHARED_LIBRARY_SUFFIX})

# install release shared library
INSTALL(FILES ${install_dir}/bin/physfs${CMAKE_SHARED_LIBRARY_SUFFIX}
DESTINATION ${POLYCODE_DEPS_CORE_PREFIX}/Bin/Release
DESTINATION ${POLYCODE_DEPS_CORE_PREFIX}/Bin
CONFIGURATIONS Release)


#INSTALL(DIRECTORY ${install_dir}/bin
# DESTINATION ${POLYCODE_DEPS_CORE_PREFIX})
#INSTALL(DIRECTORY ${install_dir}/lib
# DESTINATION ${POLYCODE_DEPS_CORE_PREFIX})




15 changes: 12 additions & 3 deletions CMake/FindBox2D.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,18 @@ FIND_PATH(BOX2D_INCLUDE_DIR Box2D/Box2D.h
PATH_SUFFIXES include
)

SET(BOX2D_NAMES box2d Box2d BOX2D Box2D)
FIND_LIBRARY(BOX2D_LIBRARY NAMES ${BOX2D_NAMES})
MARK_AS_ADVANCED(BOX2D_LIBRARY BOX2D_INCLUDE_DIR)
FIND_LIBRARY(BOX2D_RELEASE_LIBRARY NAMES box2d Box2d BOX2D Box2D)
FIND_LIBRARY(BOX2D_DEBUG_LIBRARY NAMES box2d_d Box2d_d BOX2D_d Box2D_d)

IF(BOX2D_RELEASE_LIBRARY)
IF(BOX2D_DEBUG_LIBRARY)
SET(BOX2D_LIBRARY optimized "${BOX2D_RELEASE_LIBRARY}" debug "${BOX2D_DEBUG_LIBRARY}")
ELSE()
SET(BOX2D_LIBRARY "${BOX2D_RELEASE_LIBRARY}") # Could add "general" keyword, but it is optional
ENDIF()
ENDIF()

MARK_AS_ADVANCED(BOX2D_LIBRARY BOX2D_RELEASE_LIBRARY BOX2D_DEBUG_LIBRARY BOX2D_INCLUDE_DIR)

# Per-recommendation
SET(BOX2D_INCLUDE_DIRS "${BOX2D_INCLUDE_DIR}")
Expand Down
Loading

0 comments on commit 0c572e7

Please sign in to comment.