project_files/hwc/CMakeLists.txt
branchwebgl
changeset 9130 4f4b71da3559
parent 8853 ef59a44a9f08
child 9201 bcf2f7798ebb
equal deleted inserted replaced
9127:e350500c4edb 9130:4f4b71da3559
    57                                 physfs
    57                                 physfs
    58                                 physlayer
    58                                 physlayer
    59                                 #TODO: add other libraries
    59                                 #TODO: add other libraries
    60                             )
    60                             )
    61 if(APPLE)
    61 if(APPLE)
    62     target_link_libraries(hwengine IOKit)
    62     target_link_libraries(hwengine IOKit SDLmain)
    63 endif()
    63 endif()
    64 
       
    65 #TODO: move this away in its proper findxxx.cmake
       
    66 if(APPLE)
       
    67     #let's look for the installed sdlmain file; if it is not found, let's build our own
       
    68     find_package(SDL REQUIRED)
       
    69     #remove the ";-framework Cocoa" from the SDL_LIBRARY variable
       
    70     string(REGEX REPLACE "(.*);-.*" "\\1" sdl_dir "${SDL_LIBRARY}")
       
    71     #find libsdmain.a
       
    72     find_file(SDLMAIN_LIB libSDLMain.a PATHS ${sdl_dir}/Resources/)
       
    73 
       
    74     if(SDLMAIN_LIB MATCHES "SDLMAIN_LIB-NOTFOUND")
       
    75         include_directories(${SDL_INCLUDE_DIR})
       
    76         add_library (SDLmain STATIC ${CMAKE_SOURCE_DIR}/hedgewars/sdlmain_osx/SDLMain.m)
       
    77         #add a dependency to the hwengine target
       
    78         set(SDLMAIN_LIB "${LIBRARY_OUTPUT_PATH}/libSDLmain.a")
       
    79     endif()
       
    80 
       
    81     target_link_libraries(hwengine ${SDLMAIN_LIB})
       
    82 endif(APPLE)
       
    83 
       
    84 
    64 
    85 install(PROGRAMS "${EXECUTABLE_OUTPUT_PATH}/hwengine${CMAKE_EXECUTABLE_SUFFIX}" DESTINATION ${target_binary_install_dir})
    65 install(PROGRAMS "${EXECUTABLE_OUTPUT_PATH}/hwengine${CMAKE_EXECUTABLE_SUFFIX}" DESTINATION ${target_binary_install_dir})
    86 
    66