build: split up cmake build system into subprojects.
-DDOUBLEVEC_T now correctly used for qbsp only.
This commit is contained in:
parent
86d3aa990d
commit
3a109ac84d
124
CMakeLists.txt
124
CMakeLists.txt
|
|
@ -2,122 +2,26 @@ cmake_minimum_required (VERSION 2.6)
|
||||||
project (tyrutils)
|
project (tyrutils)
|
||||||
|
|
||||||
include_directories(
|
include_directories(
|
||||||
"${PROJECT_SOURCE_DIR}/include")
|
"${CMAKE_SOURCE_DIR}/include")
|
||||||
|
|
||||||
set(COMMON_INCLUDES
|
set(COMMON_INCLUDES
|
||||||
include/common/bspfile.h
|
${CMAKE_SOURCE_DIR}/include/common/bspfile.h
|
||||||
include/common/cmdlib.h
|
${CMAKE_SOURCE_DIR}/include/common/cmdlib.h
|
||||||
include/common/lbmlib.h
|
${CMAKE_SOURCE_DIR}/include/common/lbmlib.h
|
||||||
include/common/log.h
|
${CMAKE_SOURCE_DIR}/include/common/log.h
|
||||||
include/common/mathlib.h
|
${CMAKE_SOURCE_DIR}/include/common/mathlib.h
|
||||||
include/common/polylib.h
|
${CMAKE_SOURCE_DIR}/include/common/polylib.h
|
||||||
include/common/scriplib.h
|
${CMAKE_SOURCE_DIR}/include/common/scriplib.h
|
||||||
include/common/threads.h
|
${CMAKE_SOURCE_DIR}/include/common/threads.h
|
||||||
include/common/trilib.h
|
${CMAKE_SOURCE_DIR}/include/common/trilib.h
|
||||||
include/common/wadlib.h)
|
${CMAKE_SOURCE_DIR}/include/common/wadlib.h)
|
||||||
|
|
||||||
set(LIGHT_INCLUDES
|
|
||||||
include/light/entities.h
|
|
||||||
include/light/light.h
|
|
||||||
include/light/litfile.h)
|
|
||||||
|
|
||||||
set(VIS_INCLUDES
|
|
||||||
include/vis/leafbits.h
|
|
||||||
include/vis/vis.h)
|
|
||||||
|
|
||||||
set(QBSP_INCLUDES
|
|
||||||
qbsp/bspfile.h
|
|
||||||
qbsp/file.h
|
|
||||||
qbsp/parser.h
|
|
||||||
qbsp/qbsp.h
|
|
||||||
qbsp/wad.h
|
|
||||||
qbsp/warnerr.h)
|
|
||||||
|
|
||||||
set(LIGHT_SOURCES
|
|
||||||
light/entities.c
|
|
||||||
light/litfile.c
|
|
||||||
light/ltface.c
|
|
||||||
light/trace.c
|
|
||||||
light/light.c
|
|
||||||
common/bspfile.c
|
|
||||||
common/cmdlib.c
|
|
||||||
common/mathlib.c
|
|
||||||
common/log.c
|
|
||||||
common/threads.c
|
|
||||||
${COMMON_INCLUDES}
|
|
||||||
${LIGHT_INCLUDES})
|
|
||||||
|
|
||||||
set(VIS_SOURCES
|
|
||||||
vis/flow.c
|
|
||||||
vis/vis.c
|
|
||||||
vis/soundpvs.c
|
|
||||||
vis/state.c
|
|
||||||
common/cmdlib.c
|
|
||||||
common/mathlib.c
|
|
||||||
common/bspfile.c
|
|
||||||
common/log.c
|
|
||||||
common/threads.c
|
|
||||||
${COMMON_INCLUDES}
|
|
||||||
${VIS_INCLUDES})
|
|
||||||
|
|
||||||
set(BSPINFO_SOURCES
|
|
||||||
bspinfo/bspinfo.c
|
|
||||||
common/cmdlib.c
|
|
||||||
common/bspfile.c
|
|
||||||
common/log.c
|
|
||||||
common/threads.c
|
|
||||||
${COMMON_INCLUDES})
|
|
||||||
|
|
||||||
set(BSPUTIL_SOURCES
|
|
||||||
bsputil/bsputil.c
|
|
||||||
common/cmdlib.c
|
|
||||||
common/bspfile.c
|
|
||||||
common/log.c
|
|
||||||
common/threads.c
|
|
||||||
${COMMON_INCLUDES})
|
|
||||||
|
|
||||||
set(QBSP_SOURCES
|
|
||||||
common/threads.c
|
|
||||||
common/log.c
|
|
||||||
qbsp/brush.c
|
|
||||||
qbsp/bspfile.c
|
|
||||||
qbsp/cmdlib.c
|
|
||||||
qbsp/csg4.c
|
|
||||||
qbsp/file.c
|
|
||||||
qbsp/globals.c
|
|
||||||
qbsp/map.c
|
|
||||||
qbsp/mathlib.c
|
|
||||||
qbsp/merge.c
|
|
||||||
qbsp/outside.c
|
|
||||||
qbsp/parser.c
|
|
||||||
qbsp/portals.c
|
|
||||||
qbsp/qbsp.c
|
|
||||||
qbsp/solidbsp.c
|
|
||||||
qbsp/surfaces.c
|
|
||||||
qbsp/tjunc.c
|
|
||||||
qbsp/util.c
|
|
||||||
qbsp/wad.c
|
|
||||||
qbsp/winding.c
|
|
||||||
qbsp/writebsp.c
|
|
||||||
${QBSP_INCLUDES})
|
|
||||||
|
|
||||||
find_package (Threads)
|
find_package (Threads)
|
||||||
|
|
||||||
add_executable(light ${LIGHT_SOURCES})
|
|
||||||
add_executable(vis ${VIS_SOURCES})
|
|
||||||
add_executable(bspinfo ${BSPINFO_SOURCES})
|
|
||||||
add_executable(bsputil ${BSPUTIL_SOURCES})
|
|
||||||
add_executable(qbsp ${QBSP_SOURCES})
|
|
||||||
|
|
||||||
target_link_libraries (light ${CMAKE_THREAD_LIBS_INIT})
|
|
||||||
|
|
||||||
if (CMAKE_USE_PTHREADS_INIT)
|
if (CMAKE_USE_PTHREADS_INIT)
|
||||||
add_definitions(-DUSE_PTHREADS)
|
add_definitions(-DUSE_PTHREADS)
|
||||||
endif (CMAKE_USE_PTHREADS_INIT)
|
endif (CMAKE_USE_PTHREADS_INIT)
|
||||||
|
|
||||||
#FIXME: Should be only for qbsp
|
|
||||||
add_definitions(-DDOUBLEVEC_T)
|
|
||||||
|
|
||||||
set(STACKSIZE 8388608)
|
set(STACKSIZE 8388608)
|
||||||
add_definitions(-DQ_STACKSIZE=${STACKSIZE})
|
add_definitions(-DQ_STACKSIZE=${STACKSIZE})
|
||||||
|
|
||||||
|
|
@ -125,3 +29,9 @@ add_definitions(-DQ_STACKSIZE=${STACKSIZE})
|
||||||
if (WIN32)
|
if (WIN32)
|
||||||
set(CMAKE_EXE_LINKER_FLAGS -Wl,--stack,${STACKSIZE})
|
set(CMAKE_EXE_LINKER_FLAGS -Wl,--stack,${STACKSIZE})
|
||||||
endif (WIN32)
|
endif (WIN32)
|
||||||
|
|
||||||
|
add_subdirectory(bspinfo)
|
||||||
|
add_subdirectory(bsputil)
|
||||||
|
add_subdirectory(light)
|
||||||
|
add_subdirectory(qbsp)
|
||||||
|
add_subdirectory(vis)
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,12 @@
|
||||||
|
cmake_minimum_required (VERSION 2.6)
|
||||||
|
project (bspinfo)
|
||||||
|
|
||||||
|
set(BSPINFO_SOURCES
|
||||||
|
bspinfo.c
|
||||||
|
${CMAKE_SOURCE_DIR}/common/cmdlib.c
|
||||||
|
${CMAKE_SOURCE_DIR}/common/bspfile.c
|
||||||
|
${CMAKE_SOURCE_DIR}/common/log.c
|
||||||
|
${CMAKE_SOURCE_DIR}/common/threads.c
|
||||||
|
${COMMON_INCLUDES})
|
||||||
|
|
||||||
|
add_executable(bspinfo ${BSPINFO_SOURCES})
|
||||||
|
|
@ -0,0 +1,12 @@
|
||||||
|
cmake_minimum_required (VERSION 2.6)
|
||||||
|
project (bsputil)
|
||||||
|
|
||||||
|
set(BSPUTIL_SOURCES
|
||||||
|
bsputil.c
|
||||||
|
${CMAKE_SOURCE_DIR}/common/cmdlib.c
|
||||||
|
${CMAKE_SOURCE_DIR}/common/bspfile.c
|
||||||
|
${CMAKE_SOURCE_DIR}/common/log.c
|
||||||
|
${CMAKE_SOURCE_DIR}/common/threads.c
|
||||||
|
${COMMON_INCLUDES})
|
||||||
|
|
||||||
|
add_executable(bsputil ${BSPUTIL_SOURCES})
|
||||||
|
|
@ -0,0 +1,24 @@
|
||||||
|
cmake_minimum_required (VERSION 2.6)
|
||||||
|
project (light)
|
||||||
|
|
||||||
|
set(LIGHT_INCLUDES
|
||||||
|
${CMAKE_SOURCE_DIR}/include/light/entities.h
|
||||||
|
${CMAKE_SOURCE_DIR}/include/light/light.h
|
||||||
|
${CMAKE_SOURCE_DIR}/include/light/litfile.h)
|
||||||
|
|
||||||
|
set(LIGHT_SOURCES
|
||||||
|
entities.c
|
||||||
|
litfile.c
|
||||||
|
ltface.c
|
||||||
|
trace.c
|
||||||
|
light.c
|
||||||
|
${CMAKE_SOURCE_DIR}/common/bspfile.c
|
||||||
|
${CMAKE_SOURCE_DIR}/common/cmdlib.c
|
||||||
|
${CMAKE_SOURCE_DIR}/common/mathlib.c
|
||||||
|
${CMAKE_SOURCE_DIR}/common/log.c
|
||||||
|
${CMAKE_SOURCE_DIR}/common/threads.c
|
||||||
|
${COMMON_INCLUDES}
|
||||||
|
${LIGHT_INCLUDES})
|
||||||
|
|
||||||
|
add_executable(light ${LIGHT_SOURCES})
|
||||||
|
target_link_libraries (light ${CMAKE_THREAD_LIBS_INIT})
|
||||||
|
|
@ -0,0 +1,39 @@
|
||||||
|
cmake_minimum_required (VERSION 2.6)
|
||||||
|
project (qbsp)
|
||||||
|
|
||||||
|
set(QBSP_INCLUDES
|
||||||
|
bspfile.h
|
||||||
|
file.h
|
||||||
|
parser.h
|
||||||
|
qbsp.h
|
||||||
|
wad.h
|
||||||
|
warnerr.h)
|
||||||
|
|
||||||
|
set(QBSP_SOURCES
|
||||||
|
${CMAKE_SOURCE_DIR}/common/threads.c
|
||||||
|
${CMAKE_SOURCE_DIR}/common/log.c
|
||||||
|
brush.c
|
||||||
|
bspfile.c
|
||||||
|
cmdlib.c
|
||||||
|
csg4.c
|
||||||
|
file.c
|
||||||
|
globals.c
|
||||||
|
map.c
|
||||||
|
mathlib.c
|
||||||
|
merge.c
|
||||||
|
outside.c
|
||||||
|
parser.c
|
||||||
|
portals.c
|
||||||
|
qbsp.c
|
||||||
|
solidbsp.c
|
||||||
|
surfaces.c
|
||||||
|
tjunc.c
|
||||||
|
util.c
|
||||||
|
wad.c
|
||||||
|
winding.c
|
||||||
|
writebsp.c
|
||||||
|
${QBSP_INCLUDES})
|
||||||
|
|
||||||
|
add_definitions(-DDOUBLEVEC_T)
|
||||||
|
|
||||||
|
add_executable(qbsp ${QBSP_SOURCES})
|
||||||
|
|
@ -0,0 +1,22 @@
|
||||||
|
cmake_minimum_required (VERSION 2.6)
|
||||||
|
project (vis)
|
||||||
|
|
||||||
|
set(VIS_INCLUDES
|
||||||
|
${CMAKE_SOURCE_DIR}/include/vis/leafbits.h
|
||||||
|
${CMAKE_SOURCE_DIR}/include/vis/vis.h)
|
||||||
|
|
||||||
|
set(VIS_SOURCES
|
||||||
|
flow.c
|
||||||
|
vis.c
|
||||||
|
soundpvs.c
|
||||||
|
state.c
|
||||||
|
${CMAKE_SOURCE_DIR}/common/cmdlib.c
|
||||||
|
${CMAKE_SOURCE_DIR}/common/mathlib.c
|
||||||
|
${CMAKE_SOURCE_DIR}/common/bspfile.c
|
||||||
|
${CMAKE_SOURCE_DIR}/common/log.c
|
||||||
|
${CMAKE_SOURCE_DIR}/common/threads.c
|
||||||
|
${COMMON_INCLUDES}
|
||||||
|
${VIS_INCLUDES})
|
||||||
|
|
||||||
|
add_executable(vis ${VIS_SOURCES})
|
||||||
|
target_link_libraries (vis ${CMAKE_THREAD_LIBS_INIT})
|
||||||
Loading…
Reference in New Issue