From: TimePath Date: Sun, 26 Jul 2015 10:08:51 +0000 (+1000) Subject: MSYS2 support X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=353a36a5fd7822ac3117ae1c0938fd6b5dd20be9;p=xonotic%2Fnetradiant.git MSYS2 support --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 23fabf54..caf331de 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,6 +6,36 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH}) +find_package(LibXml2 REQUIRED) +include_directories(${LIBXML2_INCLUDE_DIR}) + +find_package(GTK2 REQUIRED) +include_directories(${GTK2_INCLUDE_DIRS} ${GTK2_GDK_INCLUDE_DIR} ${GTK2_GLIB_INCLUDE_DIR}) + +find_package(GtkGLExt REQUIRED) +include_directories(${GTKGL_INCLUDE_DIRS}) + +find_package(OpenGL REQUIRED) + +add_definitions( + -D_DEBUG=1 + -DRADIANT_VERSION="1.5.0n" + -DRADIANT_MAJOR_VERSION="5" + -DRADIANT_MINOR_VERSION="0" + -DRADIANT_ABOUTMSG="Custom build" + -DRADIANT_EXECUTABLE="x86_64" +) +if(NOT WIN32) + add_definitions( + -DPOSIX=1 + -DXWINDOWS=1 + ) +else() + add_definitions( + -D_WIN32 + ) +endif() + set(BKGRND2DLIST contrib/bkgrnd2d/bkgrnd2d.cpp contrib/bkgrnd2d/bkgrnd2d.h @@ -371,14 +401,21 @@ add_library(gtkutil libs/gtkutil/xorrectangle.cpp libs/gtkutil/xorrectangle.h ) +target_link_libraries(gtkutil ${GTK2_PANGOFT2_LIBRARY}) -add_library(l_net +set(L_NETLIST libs/l_net/l_net.c libs/l_net/l_net.h - libs/l_net/l_net_berkley.c -# libs/l_net/l_net_wins.c - libs/l_net/l_net_wins.h ) +if(WIN32) + set(L_NETLIST ${L_NETLIST} libs/l_net/l_net_wins.c libs/l_net/l_net_wins.h) +else() + set(L_NETLIST ${L_NETLIST} libs/l_net/l_net_berkley.c) +endif() +add_library(l_net ${L_NETLIST}) +if(WIN32) + target_link_libraries(l_net ws2_32) +endif() #add_library(math # libs/math/aabb.cpp @@ -542,6 +579,7 @@ add_library(xml libs/xml/xmlwriter.cpp libs/xml/xmlwriter.h ) +target_link_libraries(xml ${LIBXML2_LIBRARIES}) add_library(libs libs/archivelib.cpp @@ -1337,28 +1375,6 @@ set(QUAKE3LIST tools/quake3/q3map2/q3map2.h ) -find_package(LibXml2 REQUIRED) -include_directories(${LIBXML2_INCLUDE_DIR}) - -find_package(GTK2 REQUIRED) -include_directories(${GTK2_INCLUDE_DIRS} ${GTK2_GDK_INCLUDE_DIR}) - -find_package(GtkGLExt REQUIRED) -include_directories(${GTKGL_INCLUDE_DIRS}) - -find_package(OpenGL REQUIRED) - -add_definitions( - -D_DEBUG=1 - -DPOSIX=1 - -DXWINDOWS=1 - -DRADIANT_VERSION="1.5.0n" - -DRADIANT_MAJOR_VERSION="5" - -DRADIANT_MINOR_VERSION="0" - -DRADIANT_ABOUTMSG="Custom build" - -DRADIANT_EXECUTABLE="x86_64" -) - add_executable(radiant WIN32 radiant/radiant.rc ${RADIANTLIST}) target_link_libraries(radiant ${CMAKE_DL_LIBS}