X-Git-Url: https://git.jsancho.org/?a=blobdiff_plain;f=CMakeLists.txt;h=4833e360834086d5420fcb6719c0593b46cd58d6;hb=980959d6da4f0cd440372c0efd25b89f8a034cb6;hp=7cb9cefffb30dbf7cc7cec516475650ade3da2b6;hpb=6fc45cb7ea4054a25eb0e8d2158c7079f5c4216a;p=lugaru.git diff --git a/CMakeLists.txt b/CMakeLists.txt index 7cb9cef..4833e36 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -25,10 +25,10 @@ endif(NOT LUGARU_INSTALL_PREFIX) set(CMAKE_INSTALL_PREFIX "${LUGARU_INSTALL_PREFIX}" CACHE INTERNAL "Prefix prepended to install directories" FORCE) -if(WIN32) +if(MINGW) set(OPENGL_gl_LIBRARY "-lopengl32" CACHE STRING "OpenGL library for Win32" FORCE) set(OPENGL_glu_LIBRARY "-lglu32" CACHE STRING "GLU library for Win32" FORCE) -endif(WIN32) +endif(MINGW) @@ -70,13 +70,27 @@ if(UNIX) ) endif(UNIX) +if(MSVC) # MSVC non-C99 support biting us hard + set(LUGARU_H + ${LUGARU_H} + ${DEPDIR}/msinttypes/stdint.h + ${DEPDIR}/msinttypes/inttypes.h + ) +endif(MSVC) + +if(UNIX) + set(LUGARU_H + ${LUGARU_H} + ${SRCDIR}/MacCompatibility.h + ) +endif(UNIX) + set(LUGARU_H ${SRCDIR}/Constants.h ${SRCDIR}/Frustum.h ${SRCDIR}/Game.h ${SRCDIR}/Lights.h ${SRCDIR}/LinkedList.h - ${SRCDIR}/MacCompatibility.h ${SRCDIR}/Models.h ${SRCDIR}/Objects.h ${SRCDIR}/Person.h @@ -115,6 +129,16 @@ if(WIN32) ) endif(CMAKE_CROSSCOMPILING) if(NOT CMAKE_CROSSCOMPILING) + if(MSVC) + ADD_CUSTOM_COMMAND( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/lugaru_resource.obj + COMMAND rc + -I${SRCDIR}/res + -fo${CMAKE_CURRENT_BINARY_DIR}/lugaru_resource.obj + ${SRCDIR}/res/Lugaru.rc + DEPENDS ${SRCDIR}/res/Lugaru.rc + ) + endif(MSVC) + if(MINGW) ADD_CUSTOM_COMMAND( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/lugaru_resource.obj COMMAND windres -I${SRCDIR}/res @@ -122,6 +146,7 @@ if(WIN32) -i${SRCDIR}/res/Lugaru.rc DEPENDS ${SRCDIR}/res/Lugaru.rc ) + endif(MINGW) endif(NOT CMAKE_CROSSCOMPILING) # !!! FIXME: get rid of this.