set(Q3MAP_VERSION "${Q3MAP_VERSION}-git-${GIT_VERSION}")
endif ()
-configure_file("${CMAKE_SOURCE_DIR}/include/version.cpp.in" "${CMAKE_BINARY_DIR}/version.cpp")
+configure_file("${PROJECT_SOURCE_DIR}/include/version.cpp.in" "${PROJECT_BINARY_DIR}/version.cpp")
-add_library(version "${CMAKE_BINARY_DIR}/version.cpp")
+add_library(version "${PROJECT_BINARY_DIR}/version.cpp")
set_property(TARGET version PROPERTY POSITION_INDEPENDENT_CODE TRUE)
set(RADIANT_ABOUTMSG "Custom build" CACHE STRING "About message")
add_subdirectory(tools)
-if (NOT (CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR))
+if (NOT (PROJECT_SOURCE_DIR STREQUAL PROJECT_BINARY_DIR))
# Copy data files from sources to the build directory
message(STATUS "Copying data files")
- file(GLOB DATA_FILES "${CMAKE_SOURCE_DIR}/setup/data/tools/*")
- file(COPY ${DATA_FILES} DESTINATION "${CMAKE_BINARY_DIR}")
- file(GLOB DATA_FILES "${CMAKE_SOURCE_DIR}/docs/*")
- file(COPY ${DATA_FILES} DESTINATION "${CMAKE_BINARY_DIR}/docs")
+ file(GLOB DATA_FILES "${PROJECT_SOURCE_DIR}/setup/data/tools/*")
+ file(COPY ${DATA_FILES} DESTINATION "${PROJECT_BINARY_DIR}")
+ file(GLOB DATA_FILES "${PROJECT_SOURCE_DIR}/docs/*")
+ file(COPY ${DATA_FILES} DESTINATION "${PROJECT_BINARY_DIR}/docs")
endif ()
#-----------------------------------------------------------------------
option(DOWNLOAD_GAMEPACKS "Download game packs" ON)
add_custom_target(game_packs
COMMAND ${CMAKE_COMMAND} -E make_directory games
- COMMAND DOWNLOAD_GAMEPACKS=yes SOURCE_DIR="${CMAKE_SOURCE_DIR}" "${CMAKE_SOURCE_DIR}/install-gamepacks.sh" "${CMAKE_BINARY_DIR}"
+ COMMAND DOWNLOAD_GAMEPACKS=yes SOURCE_DIR="${PROJECT_SOURCE_DIR}" "${PROJECT_SOURCE_DIR}/install-gamepacks.sh" "${PROJECT_BINARY_DIR}"
COMMENT "Downloading game packs"
)
add_custom_command(OUTPUT games
-include_directories("${CMAKE_SOURCE_DIR}/libs")
-include_directories("${CMAKE_SOURCE_DIR}/include")
+include_directories("${PROJECT_SOURCE_DIR}/libs")
+include_directories("${PROJECT_SOURCE_DIR}/include")
-set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/plugins")
+set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/plugins")
add_custom_target(plugins)
macro(radiant_plugin name)
-#include "@CMAKE_SOURCE_DIR@/include/version.h"
+#include "@PROJECT_SOURCE_DIR@/include/version.h"
namespace radiant {
std::string version()
set(CMAKE_POSITION_INDEPENDENT_CODE 1)
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
-include_directories("${CMAKE_SOURCE_DIR}/include")
+include_directories("${PROJECT_SOURCE_DIR}/include")
add_subdirectory(cmdlib)
add_subdirectory(container)
-include_directories("${CMAKE_SOURCE_DIR}/libs")
-include_directories("${CMAKE_SOURCE_DIR}/include")
+include_directories("${PROJECT_SOURCE_DIR}/libs")
+include_directories("${PROJECT_SOURCE_DIR}/include")
-set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/modules")
+set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/modules")
add_custom_target(modules)
macro(radiant_plugin name)
-set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}")
+set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}")
find_package(OpenGL REQUIRED)
-include_directories("${CMAKE_SOURCE_DIR}/libs")
-include_directories("${CMAKE_SOURCE_DIR}/include")
+include_directories("${PROJECT_SOURCE_DIR}/libs")
+include_directories("${PROJECT_SOURCE_DIR}/include")
string(SUBSTRING ${CMAKE_SHARED_MODULE_SUFFIX} 1 -1 _clibext)
add_definitions(-DCMAKE_SHARED_MODULE_SUFFIX="${_clibext}")
# Todo split further and actually compile the tools
-set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}")
+set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}")
macro(radiant_tool name)
add_executable(${name} ${ARGN})
if(NOT (CMAKE_EXECUTABLE_SUFFIX STREQUAL RADIANT_EXECUTABLE))
add_custom_command(TARGET ${name} POST_BUILD
- COMMAND ln -f -s "$<TARGET_FILE_NAME:${name}>" "${CMAKE_BINARY_DIR}/${name}.${RADIANT_EXECUTABLE}"
+ COMMAND ln -f -s "$<TARGET_FILE_NAME:${name}>" "${PROJECT_BINARY_DIR}/${name}.${RADIANT_EXECUTABLE}"
VERBATIM
)
endif()
endmacro()
-configure_file("${CMAKE_CURRENT_SOURCE_DIR}/version.c.in" "${CMAKE_BINARY_DIR}/version.c")
+configure_file("${CMAKE_CURRENT_SOURCE_DIR}/version.c.in" "${PROJECT_BINARY_DIR}/version.c")
include_directories("${CMAKE_CURRENT_SOURCE_DIR}")
add_subdirectory(quake3)
add_subdirectory(quake2)
include_directories(common)
-include_directories("${CMAKE_SOURCE_DIR}/libs")
-include_directories("${CMAKE_SOURCE_DIR}/include")
+include_directories("${PROJECT_SOURCE_DIR}/libs")
+include_directories("${PROJECT_SOURCE_DIR}/include")
find_package(LibXml2 REQUIRED)
include_directories(${LIBXML2_INCLUDE_DIR})
q2map/trace.c
q2map/tree.c
q2map/writebsp.c
- "${CMAKE_BINARY_DIR}/version.c"
+ "${PROJECT_BINARY_DIR}/version.c"
)
target_link_libraries(q2map
${LIBXML2_LIBRARIES}
qdata/sprites.c
qdata/tables.c
qdata/video.c
- "${CMAKE_BINARY_DIR}/version.c"
+ "${PROJECT_BINARY_DIR}/version.c"
)
target_link_libraries(qdata3
qdata_heretic2/tables.c
qdata_heretic2/tmix.c
qdata_heretic2/video.c
- "${CMAKE_BINARY_DIR}/version.c"
+ "${PROJECT_BINARY_DIR}/version.c"
)
target_include_directories(h2data BEFORE
PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/qdata_heretic2/common"
include_directories(common)
-include_directories("${CMAKE_SOURCE_DIR}/libs")
+include_directories("${PROJECT_SOURCE_DIR}/libs")
find_package(GLIB REQUIRED)
include_directories(${GLIB_INCLUDE_DIRS})
q3map2/vis.c
q3map2/visflow.c
q3map2/writebsp.c
- "${CMAKE_BINARY_DIR}/version.c"
+ "${PROJECT_BINARY_DIR}/version.c"
)
target_link_libraries(q3map2
q3data/q3data.h
q3data/stripper.c
q3data/video.c
- "${CMAKE_BINARY_DIR}/version.c"
+ "${PROJECT_BINARY_DIR}/version.c"
)
target_link_libraries(q3data