Use a custom target for bison as the built-in one is ill-equipped for our purposes. Also, add pandabase.
This commit is contained in:
parent
b0e3949544
commit
a8cde9f6f1
|
|
@ -13,6 +13,9 @@ set(P3D_COREAPI_VERSION ${P3D_PLUGIN_VERSION} 1)
|
|||
## Set CMake Find<Foo> Module path ##
|
||||
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/modules/")
|
||||
|
||||
## This is where dtool_config.h gets generated ##
|
||||
include_directories("${CMAKE_BINARY_DIR}/include")
|
||||
|
||||
## Include Panda3D Packages ##
|
||||
add_subdirectory(dtool)
|
||||
add_subdirectory(panda)
|
||||
|
|
|
|||
|
|
@ -424,4 +424,3 @@ else()
|
|||
endif()
|
||||
|
||||
configure_file(dtool_config.h.cmake ${CMAKE_BINARY_DIR}/include/dtool_config.h)
|
||||
include_directories("${CMAKE_BINARY_DIR}/include")
|
||||
|
|
|
|||
|
|
@ -47,11 +47,23 @@ if(NOT HAVE_BISON)
|
|||
endif()
|
||||
endif()
|
||||
|
||||
bison_target(cppParser
|
||||
cppBison.yxx
|
||||
${CMAKE_CURRENT_BINARY_DIR}/cppBison.cxx
|
||||
COMPILE_FLAGS --defines=${CMAKE_CURRENT_BINARY_DIR}/cppBison.h
|
||||
)
|
||||
# TODO: we should move this to a global macro somewhere.
|
||||
if(BISON_FOUND)
|
||||
add_custom_command(
|
||||
OUTPUT cppBison.h cppBison.cxx
|
||||
COMMAND ${BISON_EXECUTABLE}
|
||||
--defines=cppBison.h -o cppBison.cxx -p cppyy
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/cppBison.yxx"
|
||||
DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/cppBison.yxx"
|
||||
)
|
||||
else()
|
||||
add_custom_command(
|
||||
OUTPUT cppBison.h cppBison.cxx
|
||||
COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/cppBison.h.prebuilt" cppBison.h
|
||||
COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/cppBison.cxx.prebuilt" cppBison.cxx
|
||||
DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/cppBison.h.prebuilt" "${CMAKE_CURRENT_SOURCE_DIR}/cppBison.cxx.prebuilt"
|
||||
)
|
||||
endif()
|
||||
|
||||
include_directories(${CMAKE_CURRENT_BINARY_DIR})
|
||||
include_directories(${CMAKE_CURRENT_LIST_DIR})
|
||||
|
|
|
|||
|
|
@ -0,0 +1,2 @@
|
|||
## Include panda subpackages ##
|
||||
add_subdirectory(src/pandabase)
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
include_directories(../../../dtool/src/dtoolbase)
|
||||
|
||||
set(P3PANDABASE_HEADERS
|
||||
pandabase.h pandasymbols.h
|
||||
)
|
||||
|
||||
set(P3PANDABASE_SOURCES
|
||||
pandabase.cxx
|
||||
)
|
||||
|
||||
add_library(p3pandabase STATIC
|
||||
${P3PANDABASE_HEADERS}
|
||||
${P3PANDABASE_SOURCES}
|
||||
)
|
||||
Loading…
Reference in New Issue