project_files/hwc/CMakeLists.txt
branchqmlfrontend
changeset 11408 b894922d58cc
parent 11405 fac466eb0c4d
child 11659 870f22de388b
equal deleted inserted replaced
11076:fcbdee9cdd74 11408:b894922d58cc
     1 #the usual set of dependencies
     1 #the usual set of dependencies
     2 find_package(OpenGL REQUIRED)
     2 find_package(OpenGL REQUIRED)
     3 find_package(GLEW REQUIRED)
     3 find_package(GLEW REQUIRED)
     4 find_package(SDL REQUIRED)
     4 find_package(SDL2 REQUIRED)
     5 find_package(SDL_mixer REQUIRED)
     5 find_package(SDL2_mixer REQUIRED)
     6 find_package(SDL_net REQUIRED)
     6 find_package(SDL2_net REQUIRED)
     7 find_package(SDL_image REQUIRED)
     7 find_package(SDL2_image REQUIRED)
     8 find_package(SDL_ttf REQUIRED)
     8 find_package(SDL2_ttf REQUIRED)
     9 
     9 
    10 #compile our rtl implementation
    10 #compile our rtl implementation
    11 include_directories(${GLEW_INCLUDE_DIR})
    11 include_directories(${GLEW_INCLUDE_DIR})
    12 include_directories(${CMAKE_CURRENT_SOURCE_DIR}/rtl)
    12 include_directories(${CMAKE_CURRENT_SOURCE_DIR}/rtl)
    13 include_directories(${PHYSFS_INCLUDE_DIR})
    13 include_directories(${PHYSFS_INCLUDE_DIR})
    14 include_directories(${PHYSLAYER_INCLUDE_DIR})
    14 include_directories(${PHYSLAYER_INCLUDE_DIR})
    15 include_directories(${LUA_INCLUDE_DIR})
    15 include_directories(${LUA_INCLUDE_DIR})
    16 include_directories(${SDL_INCLUDE_DIR})
    16 include_directories(${SDL2_INCLUDE_DIR})
    17 add_subdirectory(rtl)
    17 add_subdirectory(rtl)
    18 
    18 
    19 # convert list into pascal array
    19 # convert list into pascal array
    20 if(FONTS_DIRS)
    20 if(FONTS_DIRS)
    21   list(LENGTH FONTS_DIRS ndirs)
    21   list(LENGTH FONTS_DIRS ndirs)
    38 list(REMOVE_ITEM engine_sources_pas "${CMAKE_SOURCE_DIR}/hedgewars/uTouch.pas")
    38 list(REMOVE_ITEM engine_sources_pas "${CMAKE_SOURCE_DIR}/hedgewars/uTouch.pas")
    39 list(REMOVE_ITEM engine_sources_pas "${CMAKE_SOURCE_DIR}/hedgewars/PNGh.pas")
    39 list(REMOVE_ITEM engine_sources_pas "${CMAKE_SOURCE_DIR}/hedgewars/PNGh.pas")
    40 list(REMOVE_ITEM engine_sources_pas "${CMAKE_SOURCE_DIR}/hedgewars/pas2cSystem.pas")
    40 list(REMOVE_ITEM engine_sources_pas "${CMAKE_SOURCE_DIR}/hedgewars/pas2cSystem.pas")
    41 list(REMOVE_ITEM engine_sources_pas "${CMAKE_SOURCE_DIR}/hedgewars/pas2cRedo.pas")
    41 list(REMOVE_ITEM engine_sources_pas "${CMAKE_SOURCE_DIR}/hedgewars/pas2cRedo.pas")
    42 list(REMOVE_ITEM engine_sources_pas "${CMAKE_SOURCE_DIR}/hedgewars/hwLibrary.pas")
    42 list(REMOVE_ITEM engine_sources_pas "${CMAKE_SOURCE_DIR}/hedgewars/hwLibrary.pas")
       
    43 list(REMOVE_ITEM engine_sources_pas "${CMAKE_SOURCE_DIR}/hedgewars/uMatrix.pas")
    43 
    44 
    44 #remove and readd hwengine so that it is compiled first, compiling every other file in the process
    45 #remove and readd hwengine so that it is compiled first, compiling every other file in the process
    45 list(REMOVE_ITEM engine_sources_pas ${CMAKE_SOURCE_DIR}/hedgewars/hwengine.pas)
    46 list(REMOVE_ITEM engine_sources_pas ${CMAKE_SOURCE_DIR}/hedgewars/hwengine.pas)
    46 list(APPEND engine_sources_pas ${CMAKE_SOURCE_DIR}/hedgewars/hwengine.pas)
    47 list(APPEND engine_sources_pas ${CMAKE_SOURCE_DIR}/hedgewars/hwengine.pas)
    47 
    48 
    80 add_executable(hwengine WIN32 ${engine_sources})
    81 add_executable(hwengine WIN32 ${engine_sources})
    81 
    82 
    82 target_link_libraries(hwengine  fpcrtl
    83 target_link_libraries(hwengine  fpcrtl
    83                                 ${LUA_LIBRARY}
    84                                 ${LUA_LIBRARY}
    84                                 ${OPENGL_LIBRARY}
    85                                 ${OPENGL_LIBRARY}
    85                                 ${SDL_LIBRARY}
    86                                 ${SDL2_LIBRARY}
    86                                 ${SDLMIXER_LIBRARY}
    87                                 ${SDL2_MIXER_LIBRARY}
    87                                 ${SDLNET_LIBRARY}
    88                                 ${SDL2_NET_LIBRARY}
    88                                 ${SDLIMAGE_LIBRARY}
    89                                 ${SDL2_IMAGE_LIBRARY}
    89                                 ${SDLTTF_LIBRARY}
    90                                 ${SDL2_TTF_LIBRARY}
    90                                 ${GLEW_LIBRARY}
    91                                 ${GLEW_LIBRARY}
    91                                 physfs
    92                                 physfs
    92                                 physlayer
    93                                 physlayer
    93                                 m
    94                                 m
    94                                 #TODO: add other libraries
    95                                 #TODO: add other libraries
    95                             )
    96                             )
    96 if(APPLE)
       
    97     target_link_libraries(hwengine IOKit SDLmain)
       
    98 endif()
       
    99 
       
   100 install(PROGRAMS "${EXECUTABLE_OUTPUT_PATH}/hwengine${CMAKE_EXECUTABLE_SUFFIX}" DESTINATION ${target_binary_install_dir})
    97 install(PROGRAMS "${EXECUTABLE_OUTPUT_PATH}/hwengine${CMAKE_EXECUTABLE_SUFFIX}" DESTINATION ${target_binary_install_dir})
   101 
    98