X-Git-Url: https://git.jsancho.org/?a=blobdiff_plain;f=CMakeLists.txt;h=63b5bdc3f21fcd9a5c50cc607dd541e9179d01c3;hb=4df6d827a1a3837142051de155083a3e36409959;hp=ff201528a71b3242f5c47477a1cbedd7b6cbfe76;hpb=4d2d492f83ce7740cefa8a50f6ef694063e53f38;p=lugaru.git diff --git a/CMakeLists.txt b/CMakeLists.txt index ff20152..63b5bdc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ project(lugaru) -cmake_minimum_required(VERSION 2.6) +cmake_minimum_required(VERSION 3.5) set(SRCDIR "${CMAKE_CURRENT_SOURCE_DIR}/Source") set(DEPDIR "${CMAKE_CURRENT_SOURCE_DIR}/Dependencies") @@ -137,40 +137,13 @@ if(MSVC) # MSVC non-C99 support biting us hard endif(MSVC) if(WIN32) - if(CMAKE_CROSSCOMPILING) - ADD_CUSTOM_COMMAND( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/lugaru_resource.obj - COMMAND i686-w64-mingw32-windres - -I${SRCDIR}/win-res - -o ${CMAKE_CURRENT_BINARY_DIR}/lugaru_resource.obj - -i${SRCDIR}/win-res/Lugaru.rc - DEPENDS ${SRCDIR}/win-res/Lugaru.rc - ) - endif(CMAKE_CROSSCOMPILING) - if(NOT CMAKE_CROSSCOMPILING) - if(MSVC) - ADD_CUSTOM_COMMAND( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/lugaru_resource.obj - COMMAND rc - -I${SRCDIR}/win-res - -fo${CMAKE_CURRENT_BINARY_DIR}/lugaru_resource.obj - ${SRCDIR}/win-res/Lugaru.rc - DEPENDS ${SRCDIR}/win-res/Lugaru.rc - ) - endif(MSVC) - if(MINGW) - ADD_CUSTOM_COMMAND( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/lugaru_resource.obj - COMMAND windres - -I${SRCDIR}/win-res - -o ${CMAKE_CURRENT_BINARY_DIR}/lugaru_resource.obj - -i${SRCDIR}/win-res/Lugaru.rc - DEPENDS ${SRCDIR}/win-res/Lugaru.rc - ) - endif(MINGW) - endif(NOT CMAKE_CROSSCOMPILING) - - # !!! FIXME: get rid of this. + ENABLE_LANGUAGE(RC) + + # !!! FIXME: get rid of WinDefs.{cpp,h} set(LUGARU_SRCS ${LUGARU_SRCS} - ${SRCDIR}/WinDefs.cpp) + ${SRCDIR}/WinDefs.cpp + ${SRCDIR}/win-res/Lugaru.rc) set(LUGARU_H ${LUGARU_H} @@ -500,11 +473,7 @@ include_directories( set(LUGARU_LIBS ${OPENAL_LIBRARY} ${PNG_LIBRARY} ${JPEG_LIBRARY} ${ZLIB_LIBRARIES} ${SDL_LIBRARY} ${OPENGL_glu_LIBRARY} ${VORBISFILE_LIBRARY} ${OGG_LIBRARY} ${PLATFORM_LIBS}) -if(WIN32) - add_executable(lugaru ${LUGARU_SRCS} ${LUGARU_H} lugaru_resource.obj) -else(WIN32) - add_executable(lugaru ${LUGARU_SRCS} ${LUGARU_H}) -endif(WIN32) +add_executable(lugaru ${LUGARU_SRCS} ${LUGARU_H}) target_link_libraries(lugaru ${LUGARU_LIBS})