1 enable_language(Pascal) |
1 enable_language(Pascal) |
2 |
2 |
3 if(${USESDL12}) |
3 if(${NOSDL2}) |
4 find_package(SDL REQUIRED) |
4 find_package(SDL REQUIRED) |
5 find_package(SDL_image REQUIRED) |
5 find_package(SDL_image REQUIRED) |
6 find_package(SDL_net REQUIRED) |
6 find_package(SDL_net REQUIRED) |
7 find_package(SDL_ttf REQUIRED) |
7 find_package(SDL_ttf REQUIRED) |
8 find_package(SDL_mixer REQUIRED) |
8 find_package(SDL_mixer REQUIRED) |
9 else(${USESDL12}) |
9 else(${NOSDL2}) |
10 find_package(SDL2 REQUIRED) |
10 find_package(SDL2 REQUIRED) |
11 find_package(SDL2_image REQUIRED) |
11 find_package(SDL2_image REQUIRED) |
12 find_package(SDL2_net REQUIRED) |
12 find_package(SDL2_net REQUIRED) |
13 find_package(SDL2_ttf REQUIRED) |
13 find_package(SDL2_ttf REQUIRED) |
14 find_package(SDL2_mixer REQUIRED) |
14 find_package(SDL2_mixer REQUIRED) |
15 add_definitions(-dSDL2) |
15 add_definitions(-dSDL2) |
16 endif(${USESDL12}) |
16 endif(${NOSDL2}) |
17 |
17 |
18 include (CheckLibraryExists) |
18 include (CheckLibraryExists) |
19 |
19 |
20 configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.inc.in ${CMAKE_CURRENT_BINARY_DIR}/config.inc) |
20 configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.inc.in ${CMAKE_CURRENT_BINARY_DIR}/config.inc) |
21 include_directories(${CMAKE_CURRENT_BINARY_DIR}) |
21 include_directories(${CMAKE_CURRENT_BINARY_DIR}) |
106 add_flag_prepend(CMAKE_Pascal_FLAGS_RELEASE -Si) |
106 add_flag_prepend(CMAKE_Pascal_FLAGS_RELEASE -Si) |
107 endif() |
107 endif() |
108 |
108 |
109 |
109 |
110 #DEPENDECIES AND EXECUTABLES SECTION |
110 #DEPENDECIES AND EXECUTABLES SECTION |
111 if(NOT ${BUILD_ENGINE_LIBRARY} AND APPLE AND ${USESDL12}) |
111 if(NOT ${BUILD_ENGINE_LIBRARY} AND APPLE AND ${NOSDL2}) |
112 #on OSX we need to provide the SDL_main() function when building as executable |
112 #on OSX we need to provide the SDL_main() function when building as executable |
113 add_subdirectory(sdlmain) |
113 add_subdirectory(sdlmain) |
114 list(APPEND HW_LINK_LIBS SDLmain) |
114 list(APPEND HW_LINK_LIBS SDLmain) |
115 add_flag_append(CMAKE_Pascal_FLAGS -Fl${LIBRARY_OUTPUT_PATH}) |
115 add_flag_append(CMAKE_Pascal_FLAGS -Fl${LIBRARY_OUTPUT_PATH}) |
116 endif() |
116 endif() |
119 add_subdirectory(avwrapper) |
119 add_subdirectory(avwrapper) |
120 list(APPEND HW_LINK_LIBS avwrapper) |
120 list(APPEND HW_LINK_LIBS avwrapper) |
121 add_definitions(-dUSE_VIDEO_RECORDING) |
121 add_definitions(-dUSE_VIDEO_RECORDING) |
122 add_flag_append(CMAKE_Pascal_FLAGS -Fl${LIBRARY_OUTPUT_PATH}) |
122 add_flag_append(CMAKE_Pascal_FLAGS -Fl${LIBRARY_OUTPUT_PATH}) |
123 |
123 |
124 if(${USESDL12}) |
124 if(${NOSDL2}) |
125 #only for SDL < 2, linking carried out by fpc |
125 #only for SDL < 2, linking carried out by fpc |
126 find_package_or_disable_msg(GLUT NOVIDEOREC "Video recording will not be built") |
126 find_package_or_disable_msg(GLUT NOVIDEOREC "Video recording will not be built") |
127 endif(${USESDL12}) |
127 endif(${NOSDL2}) |
128 endif() |
128 endif() |
129 |
129 |
130 find_package_or_disable_msg(PNG NOPNG "Screenshots will be saved in BMP") |
130 find_package_or_disable_msg(PNG NOPNG "Screenshots will be saved in BMP") |
131 if(PNG_FOUND) |
131 if(PNG_FOUND) |
132 list(INSERT engine_sources 0 PNGh.pas) |
132 list(INSERT engine_sources 0 PNGh.pas) |
158 add_flag_append(CMAKE_Pascal_FLAGS "-Fl${LIBRARY_OUTPUT_PATH} -XLAphysfs=${physfs_output_name}") |
158 add_flag_append(CMAKE_Pascal_FLAGS "-Fl${LIBRARY_OUTPUT_PATH} -XLAphysfs=${physfs_output_name}") |
159 endif() |
159 endif() |
160 list(APPEND HW_LINK_LIBS physlayer) |
160 list(APPEND HW_LINK_LIBS physlayer) |
161 |
161 |
162 #Mix_Init/Mix_Quit from SDL_mixer 1.2.10 |
162 #Mix_Init/Mix_Quit from SDL_mixer 1.2.10 |
163 if(${USESDL12}) |
163 if(${NOSDL2}) |
164 check_library_exists(${SDLMIXER_LIBRARY} Mix_Init "" HAVE_MIXINIT) |
164 check_library_exists(${SDLMIXER_LIBRARY} Mix_Init "" HAVE_MIXINIT) |
165 if(HAVE_MIXINIT) |
165 if(HAVE_MIXINIT) |
166 add_definitions(-dSDL_MIXER_NEWER) |
166 add_definitions(-dSDL_MIXER_NEWER) |
167 endif(HAVE_MIXINIT) |
167 endif(HAVE_MIXINIT) |
168 |
168 |
169 #IMG_Init/IMG_Quit from SDL_image 1.2.8 |
169 #IMG_Init/IMG_Quit from SDL_image 1.2.8 |
170 check_library_exists(${SDLIMAGE_LIBRARY} IMG_Init "" HAVE_IMGINIT) |
170 check_library_exists(${SDLIMAGE_LIBRARY} IMG_Init "" HAVE_IMGINIT) |
171 if(HAVE_IMGINIT) |
171 if(HAVE_IMGINIT) |
172 add_definitions(-dSDL_IMAGE_NEWER) |
172 add_definitions(-dSDL_IMAGE_NEWER) |
173 endif(HAVE_IMGINIT) |
173 endif(HAVE_IMGINIT) |
174 endif(${USESDL12}) |
174 endif(${NOSDL2}) |
175 |
175 |
176 #needs to be last |
176 #needs to be last |
177 add_definitions(-dDEBUGFILE) |
177 add_definitions(-dDEBUGFILE) |
178 |
178 |
179 #SOURCE AND PROGRAMS SECTION |
179 #SOURCE AND PROGRAMS SECTION |