equal
deleted
inserted
replaced
32 |
32 |
33 #compile our rtl implementation |
33 #compile our rtl implementation |
34 add_subdirectory(rtl) |
34 add_subdirectory(rtl) |
35 include_directories("${GLEW_INCLUDE_PATH}") |
35 include_directories("${GLEW_INCLUDE_PATH}") |
36 include_directories("${CMAKE_CURRENT_SOURCE_DIR}/rtl") |
36 include_directories("${CMAKE_CURRENT_SOURCE_DIR}/rtl") |
37 |
|
38 |
37 |
39 configure_file(${CMAKE_SOURCE_DIR}/hedgewars/config.inc.in ${CMAKE_CURRENT_BINARY_DIR}/config.inc) |
38 configure_file(${CMAKE_SOURCE_DIR}/hedgewars/config.inc.in ${CMAKE_CURRENT_BINARY_DIR}/config.inc) |
40 |
39 |
41 #get the list of pas files that are going to be converted and compiled |
40 #get the list of pas files that are going to be converted and compiled |
42 file(GLOB engine_sources_pas "${CMAKE_SOURCE_DIR}/hedgewars/*.pas") |
41 file(GLOB engine_sources_pas "${CMAKE_SOURCE_DIR}/hedgewars/*.pas") |
78 ${SDLIMAGE_LIBRARY} |
77 ${SDLIMAGE_LIBRARY} |
79 ${SDLTTF_LIBRARY} |
78 ${SDLTTF_LIBRARY} |
80 #TODO: add other libraries |
79 #TODO: add other libraries |
81 ) |
80 ) |
82 |
81 |
|
82 #TODO: move this away in its proper findxxx.cmake |
|
83 if(APPLE) |
|
84 #let's look for the installed sdlmain file; if it is not found, let's build our own |
|
85 find_package(SDL REQUIRED) |
|
86 #remove the ";-framework Cocoa" from the SDL_LIBRARY variable |
|
87 string(REGEX REPLACE "(.*);-.*" "\\1" sdl_dir "${SDL_LIBRARY}") |
|
88 #find libsdmain.a |
|
89 find_file(SDLMAIN_LIB libSDLMain.a PATHS ${sdl_dir}/Resources/) |
|
90 |
|
91 if(SDLMAIN_LIB MATCHES "SDLMAIN_LIB-NOTFOUND") |
|
92 include_directories(${SDL_INCLUDE_DIR}) |
|
93 add_library (SDLmain STATIC ${CMAKE_SOURCE_DIR}/hedgewars/sdlmain_osx/SDLMain.m) |
|
94 #add a dependency to the hwengine target |
|
95 set(SDLMAIN_LIB "${LIBRARY_OUTPUT_PATH}/libSDLmain.a") |
|
96 endif() |
|
97 |
|
98 target_link_libraries(hwengine ${SDLMAIN_LIB}) |
|
99 endif(APPLE) |
|
100 |
|
101 |
83 install(PROGRAMS "${EXECUTABLE_OUTPUT_PATH}/hwengine${CMAKE_EXECUTABLE_SUFFIX}" DESTINATION ${target_dir}) |
102 install(PROGRAMS "${EXECUTABLE_OUTPUT_PATH}/hwengine${CMAKE_EXECUTABLE_SUFFIX}" DESTINATION ${target_dir}) |
84 |
103 |