include_directories(BEFORE common)
set(Q3MAP_VERSION 2.5.17n)
-find_package(Git REQUIRED)
-execute_process(
- COMMAND ${GIT_EXECUTABLE} rev-parse --short HEAD
- WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
- OUTPUT_VARIABLE GIT_VERSION
- OUTPUT_STRIP_TRAILING_WHITESPACE
-)
+
if (GIT_VERSION)
set(Q3MAP_VERSION "${Q3MAP_VERSION}-git-${GIT_VERSION}")
endif ()
+
add_definitions(-DQ3MAP_VERSION="${Q3MAP_VERSION}")
find_package(GLIB REQUIRED)
find_package(PNG REQUIRED)
include_directories(${PNG_INCLUDE_DIR})
+find_package(WebP REQUIRED)
+include_directories(${WEBP_INCLUDE_DIR})
+
find_package(LibXml2 REQUIRED)
include_directories(${LIBXML2_INCLUDE_DIR})
-find_package(ZLIB REQUIRED)
-include_directories(${ZLIB_INCLUDE_DIRS})
+find_package(Minizip REQUIRED)
+include_directories(${Minizip_INCLUDE_DIRS})
+
+include_directories(${CMAKE_SOURCE_DIR}/libs/crnrgba)
set(q3map2_games
q3map2/game_darkplaces.h
q3map2/game_ja.h
q3map2/game_jk2.h
q3map2/game_nexuiz.h
+ q3map2/game_oa.h
q3map2/game_prophecy.h
+ q3map2/game_q3rally.h
q3map2/game_qfusion.h
q3map2/game_quake3.h
q3map2/game_quakelive.h
q3map2/game_reaction.h
+ q3map2/game_smokinguns.h
q3map2/game_sof2.h
q3map2/game_tenebrae.h
q3map2/game_tremulous.h
+ q3map2/game_unvanquished.h
+ q3map2/game_warfork.h
+ q3map2/game_warsow.h
q3map2/game_wolf.h
q3map2/game_wolfet.h
+ q3map2/game_wop.h
q3map2/game_xonotic.h
)
radiant_tool(q3map2
+ q3map2/q3map2.rc
+
common/cmdlib.c common/cmdlib.h
common/imagelib.c common/imagelib.h
common/inout.c common/inout.h
common/scriplib.c common/scriplib.h
common/surfaceflags.h
common/threads.c
- common/unzip.c common/unzip.h
common/vfs.c common/vfs.h
q3map2/brush.c
q3map2/convert_map.c
q3map2/convert_obj.c
q3map2/decals.c
+ q3map2/exportents.c
q3map2/facebsp.c
q3map2/fixaas.c
q3map2/fog.c
q3map2/writebsp.c
)
+if (BUILD_CRUNCH)
+ set(OPTIONAL_IMAGE_LIBRARIES crnrgba)
+ set(OPTIONAL_IMAGE_DEFINES BUILD_CRUNCH=1)
+endif ()
+
+target_compile_definitions(q3map2
+ PRIVATE
+ ${OPTIONAL_IMAGE_DEFINES}
+ )
+
target_link_libraries(q3map2
${GLIB_LIBRARIES}
${JPEG_LIBRARIES}
${PNG_LIBRARIES}
+ ${WEBP_LIBRARIES}
${LIBXML2_LIBRARIES}
- ${ZLIB_LIBRARIES}
+ ${Minizip_LIBRARIES}
+ ${OPTIONAL_IMAGE_LIBRARIES}
ddslib
etclib
filematch
)
radiant_tool(q3data
+ q3data/q3data.rc
+
common/aselib.c common/aselib.h
common/bspfile.c common/bspfile.h
common/cmdlib.c common/cmdlib.h
common/md4.c common/md4.h
common/scriplib.c common/scriplib.h
common/trilib.c common/trilib.h
- common/unzip.c common/unzip.h
common/vfs.c common/vfs.h
q3data/3dslib.c q3data/3dslib.h
target_link_libraries(q3data
${GLIB_LIBRARIES}
${LIBXML2_LIBRARIES}
- ${ZLIB_LIBRARIES}
+ ${Minizip_LIBRARIES}
filematch
etclib
l_net
target_link_libraries(q3map2 pthread m)
target_link_libraries(q3data m)
endif ()
+
+target_link_libraries(q3map2)