Fixes for MSVC CMake build.
Look in the right place for SDL libs depending on arch. Output exe's to RecastDemo/Bin, with output suffix so different configs don't clash.
This commit is contained in:
parent
15cd962073
commit
ee4fa30c73
5
.gitignore
vendored
5
.gitignore
vendored
@ -3,7 +3,9 @@
|
||||
*.class
|
||||
*.dll
|
||||
*.exe
|
||||
*.ilk
|
||||
*.o
|
||||
*.pdb
|
||||
*.so
|
||||
|
||||
## Logs and databases #
|
||||
@ -22,3 +24,6 @@ Thumbs.db
|
||||
|
||||
## xcode specific
|
||||
*xcuserdata*
|
||||
|
||||
## SDL contrib
|
||||
RecastDemo/Contrib/SDL/*
|
||||
|
@ -1,4 +1,5 @@
|
||||
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
|
||||
# 2.8.5 required for CMAKE_LIBRARY_ARCHITECTURE
|
||||
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.5)
|
||||
|
||||
SET(recastdemo_SRCS
|
||||
Source/ChunkyTriMesh.cpp
|
||||
@ -54,7 +55,13 @@ SET(recastdemo_HDRS
|
||||
IF(MSVC)
|
||||
# Look in the Contrib directory for SDL when building with MSVC
|
||||
SET(CMAKE_PREFIX_PATH Contrib/SDL)
|
||||
ENDIF(MSVC)
|
||||
# Look in arch dependendent lib subfolder for libsdl
|
||||
IF(CMAKE_GENERATOR MATCHES Win64)
|
||||
SET(CMAKE_LIBRARY_ARCHITECTURE x64)
|
||||
ELSE()
|
||||
SET(CMAKE_LIBRARY_ARCHITECTURE x86)
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
FIND_PACKAGE(OpenGL REQUIRED)
|
||||
FIND_PACKAGE(SDL REQUIRED)
|
||||
@ -72,18 +79,28 @@ INCLUDE_DIRECTORIES(Include
|
||||
|
||||
IF(XCODE)
|
||||
ADD_EXECUTABLE(RecastDemo MACOSX_BUNDLE Source/SDLMain.m Include/SDLMain.h ${recastdemo_SRCS} ${recastdemo_HDRS})
|
||||
ELSE(XCODE)
|
||||
ELSE()
|
||||
ADD_EXECUTABLE(RecastDemo WIN32 ${recastdemo_SRCS} ${recastdemo_HDRS})
|
||||
ENDIF(XCODE)
|
||||
ENDIF()
|
||||
|
||||
TARGET_LINK_LIBRARIES(RecastDemo DebugUtils Detour DetourCrowd DetourTileCache Recast ${SDL_LIBRARY} ${OPENGL_LIBRARIES})
|
||||
|
||||
IF(MSVC)
|
||||
# Enable some linker optimisations
|
||||
SET_TARGET_PROPERTIES(RecastDemo PROPERTIES LINK_FLAGS_RELEASE "/OPT:REF /OPT:ICF")
|
||||
SET_TARGET_PROPERTIES(RecastDemo PROPERTIES LINK_FLAGS_MINSIZEREL "/OPT:REF /OPT:ICF")
|
||||
SET_TARGET_PROPERTIES(RecastDemo PROPERTIES LINK_FLAGS_RELWITHDEBINFO "/OPT:REF /OPT:ICF")
|
||||
ENDIF(MSVC)
|
||||
SET(recastdemo_LINK_OPTS "/OPT:REF /OPT:ICF")
|
||||
SET_TARGET_PROPERTIES(RecastDemo PROPERTIES LINK_FLAGS_RELEASE ${recastdemo_LINK_OPTS})
|
||||
SET_TARGET_PROPERTIES(RecastDemo PROPERTIES LINK_FLAGS_MINSIZEREL ${recastdemo_LINK_OPTS})
|
||||
SET_TARGET_PROPERTIES(RecastDemo PROPERTIES LINK_FLAGS_RELWITHDEBINFO ${recastdemo_LINK_OPTS})
|
||||
ENDIF()
|
||||
|
||||
SET_TARGET_PROPERTIES(RecastDemo PROPERTIES DEBUG_POSTFIX "_Debug")
|
||||
SET_TARGET_PROPERTIES(RecastDemo PROPERTIES MINSIZEREL_POSTFIX "_MinSizeRel")
|
||||
SET_TARGET_PROPERTIES(RecastDemo PROPERTIES RELWITHDEBINFO_POSTFIX "_RelWithDebInfo")
|
||||
|
||||
SET(recastdemo_OUTPUT_DIR "${RecastNavigation_SOURCE_DIR}/RecastDemo/Bin")
|
||||
SET_TARGET_PROPERTIES(RecastDemo PROPERTIES RUNTIME_OUTPUT_DIRECTORY_DEBUG ${recastdemo_OUTPUT_DIR})
|
||||
SET_TARGET_PROPERTIES(RecastDemo PROPERTIES RUNTIME_OUTPUT_DIRECTORY_MINSIZEREL ${recastdemo_OUTPUT_DIR})
|
||||
SET_TARGET_PROPERTIES(RecastDemo PROPERTIES RUNTIME_OUTPUT_DIRECTORY_RELEASE ${recastdemo_OUTPUT_DIR})
|
||||
SET_TARGET_PROPERTIES(RecastDemo PROPERTIES RUNTIME_OUTPUT_DIRECTORY_RELWITHDEBINFO ${recastdemo_OUTPUT_DIR})
|
||||
|
||||
SET(EXECUTABLE_OUTPUT_PATH ${RecastNavigation_SOURCE_DIR}/RecastDemo/Bin)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user