configure_file("${CMAKE_SOURCE_DIR}/include/version.cpp.in" "${CMAKE_BINARY_DIR}/version.cpp")
+add_library(version "${CMAKE_BINARY_DIR}/version.cpp")
+set_property(TARGET version PROPERTY POSITION_INDEPENDENT_CODE TRUE)
+
set(RADIANT_ABOUTMSG "Custom build" CACHE STRING "About message")
message(STATUS "Building ${PROJECT_NAME} ${RADIANT_VERSION_STRING} ${RADIANT_ABOUTMSG}")
mkdir build && cd build
cmake --version
cmake -G 'MSYS Makefiles' .. -DGTK2_GLIBCONFIG_INCLUDE_DIR=/mingw64/lib/glib-2.0/include -DGTK2_GDKCONFIG_INCLUDE_DIR=/mingw64/lib/gtk-2.0/include
- cmake --build . --target radiant
+ cmake --build .
"@
visfind.cpp visfind.h
)
-find_package(GTK2 REQUIRED)
-target_include_directories(bobtoolz PRIVATE ${GTK2_INCLUDE_DIRS})
+target_include_directories(bobtoolz PRIVATE uilib)
+target_link_libraries(bobtoolz PRIVATE uilib)
-target_link_libraries(bobtoolz mathlib)
+target_include_directories(bobtoolz PRIVATE mathlib)
+target_link_libraries(bobtoolz PRIVATE mathlib)
support.cpp support.h
)
-find_package(GTK2 REQUIRED)
-target_include_directories(brushexport PRIVATE ${GTK2_INCLUDE_DIRS})
+target_include_directories(brushexport PRIVATE uilib)
+target_link_libraries(brushexport PRIVATE uilib)
prtview.cpp prtview.h
)
-find_package(GTK2 REQUIRED)
-target_include_directories(prtview PRIVATE ${GTK2_INCLUDE_DIRS})
+target_include_directories(prtview PRIVATE version)
+target_link_libraries(prtview PRIVATE version)
+
+target_include_directories(prtview PRIVATE uilib)
+target_link_libraries(prtview PRIVATE uilib)
+
+target_include_directories(prtview PRIVATE profile)
+target_link_libraries(prtview PRIVATE profile)
shaderplug.cpp shaderplug.h
)
-find_package(LibXml2 REQUIRED)
-target_include_directories(shaderplug PRIVATE ${LIBXML2_INCLUDE_DIR})
+target_include_directories(shaderplug PRIVATE xmllib)
+target_link_libraries(shaderplug PRIVATE xmllib)
-find_package(GTK2 REQUIRED)
-target_include_directories(shaderplug PRIVATE ${GTK2_INCLUDE_DIRS})
+target_include_directories(shaderplug PRIVATE uilib)
+target_link_libraries(shaderplug PRIVATE uilib)
sunplug.cpp sunplug.h
)
-find_package(GTK2 REQUIRED)
-target_include_directories(sunplug PRIVATE ${GTK2_INCLUDE_DIRS})
+target_include_directories(sunplug PRIVATE uilib)
+target_link_libraries(sunplug PRIVATE uilib)
ufoai_level.cpp ufoai_level.h
)
-find_package(GTK2 REQUIRED)
-target_include_directories(ufoaiplug PRIVATE ${GTK2_INCLUDE_DIRS})
+target_include_directories(ufoaiplug PRIVATE version)
+target_link_libraries(ufoaiplug PRIVATE version)
+
+target_include_directories(ufoaiplug PRIVATE uilib)
+target_link_libraries(ufoaiplug PRIVATE uilib)
find_package(GLIB REQUIRED)
target_include_directories(libs PRIVATE ${GLIB_INCLUDE_DIRS})
+target_link_libraries(libs PRIVATE ${GLIB_LIBRARIES})
xorrectangle.h
)
-find_package(GTK2 REQUIRED)
-target_include_directories(gtkutil PRIVATE ${GTK2_INCLUDE_DIRS} ${GTK2_GDK_INCLUDE_DIR} ${GTK2_GLIB_INCLUDE_DIR})
+target_include_directories(gtkutil PRIVATE uilib)
+target_link_libraries(gtkutil PRIVATE uilib)
+
+target_include_directories(gtkutil PRIVATE ${GTK2_PANGO_INCLUDE_DIR})
+target_link_libraries(gtkutil PRIVATE ${GTK2_PANGO_LIBRARY})
find_package(GtkGLExt REQUIRED)
target_include_directories(gtkutil PRIVATE ${GTKGL_INCLUDE_DIRS})
+target_link_libraries(gtkutil PRIVATE ${GTKGL_LIBRARIES})
add_library(l_net ${L_NETLIST})
if (WIN32)
- target_link_libraries(l_net ws2_32)
+ target_link_libraries(l_net PRIVATE ws2_32)
endif ()
find_package(GLIB REQUIRED)
target_include_directories(os PRIVATE ${GLIB_INCLUDE_DIRS})
+target_link_libraries(os PRIVATE ${GLIB_LIBRARIES})
)
find_package(GTK2 REQUIRED)
-target_include_directories(uilib PRIVATE ${GTK2_INCLUDE_DIRS})
+target_include_directories(uilib PUBLIC ${GTK2_INCLUDE_DIRS})
+target_link_libraries(uilib PUBLIC ${GTK2_LIBRARIES})
+
+target_include_directories(uilib PUBLIC gtkutil)
+target_link_libraries(uilib PUBLIC gtkutil)
find_package(GLIB REQUIRED)
target_include_directories(xmllib PUBLIC ${GLIB_INCLUDE_DIRS})
+target_link_libraries(xmllib PUBLIC ${GLIB_LIBRARIES})
find_package(LibXml2 REQUIRED)
target_include_directories(xmllib PUBLIC ${LIBXML2_INCLUDE_DIR})
-target_link_libraries(xmllib ${LIBXML2_LIBRARIES})
+target_link_libraries(xmllib PUBLIC ${LIBXML2_LIBRARIES})
find_package(ZLIB REQUIRED)
target_include_directories(archivezip PRIVATE ${ZLIB_INCLUDE_DIRS})
+target_link_libraries(archivezip PRIVATE ${ZLIB_LIBRARIES})
find_package(JPEG REQUIRED)
target_include_directories(image PRIVATE ${JPEG_INCLUDE_DIR})
-target_link_libraries(image ddslib etclib ${JPEG_LIBRARIES})
+target_link_libraries(image PRIVATE ddslib etclib ${JPEG_LIBRARIES})
find_package(PNG REQUIRED)
target_include_directories(imagepng PRIVATE ${PNG_INCLUDE_DIR})
+target_link_libraries(imagepng PRIVATE ${PNG_LIBRARIES})
xmlwrite.cpp xmlwrite.h
)
-target_link_libraries(mapxml xmllib)
+target_include_directories(mapxml PRIVATE xmllib)
+target_link_libraries(mapxml PRIVATE xmllib)
plugin.cpp
)
-target_link_libraries(model picomodel)
+target_include_directories(model PRIVATE picomodel)
+target_link_libraries(model PRIVATE picomodel)
find_package(GLIB REQUIRED)
target_include_directories(shaders PRIVATE ${GLIB_INCLUDE_DIRS})
+target_link_libraries(shaders PRIVATE ${GLIB_LIBRARIES})
find_package(GLIB REQUIRED)
target_include_directories(vfspk3 PRIVATE ${GLIB_INCLUDE_DIRS})
+target_link_libraries(vfspk3 PRIVATE ${GLIB_LIBRARIES})
-target_link_libraries(vfspk3 filematch)
+target_include_directories(vfspk3 PRIVATE filematch)
+target_link_libraries(vfspk3 PRIVATE filematch)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}")
-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(OpenGL REQUIRED)
-find_package(GtkGLExt REQUIRED)
-include_directories(${GTKGL_INCLUDE_DIRS})
-
include_directories("${CMAKE_SOURCE_DIR}/libs")
include_directories("${CMAKE_SOURCE_DIR}/include")
xmlstuff.h
xywindow.cpp
xywindow.h
- "${CMAKE_BINARY_DIR}/version.cpp"
)
add_executable(radiant WIN32 radiant.rc ${RADIANTLIST})
${CMAKE_DL_LIBS}
${LIBXML2_LIBRARIES}
${OPENGL_gl_LIBRARY}
- ${GTK2_LIBRARIES}
- ${GTK2_PANGO_LIBRARY}
${GTKGL_LIBRARIES}
+ version
includes
cmdlib
container
etclib
filematch
generic
- gtkutil
l_net
math
mathlib