diff --git a/CMakeLists.txt b/CMakeLists.txt index 01f5b0056b..14e3da0ba6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,6 +13,9 @@ set(P3D_COREAPI_VERSION ${P3D_PLUGIN_VERSION} 1) ## Set CMake Find 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) diff --git a/dtool/Configure.cmake b/dtool/Configure.cmake index b1742ba6d6..72bb43a358 100644 --- a/dtool/Configure.cmake +++ b/dtool/Configure.cmake @@ -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") diff --git a/dtool/src/cppparser/CMakeLists.txt b/dtool/src/cppparser/CMakeLists.txt index 1d3d2e23c3..c7970491a1 100644 --- a/dtool/src/cppparser/CMakeLists.txt +++ b/dtool/src/cppparser/CMakeLists.txt @@ -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}) diff --git a/panda/CMakeLists.txt b/panda/CMakeLists.txt new file mode 100644 index 0000000000..f07f3367dc --- /dev/null +++ b/panda/CMakeLists.txt @@ -0,0 +1,2 @@ +## Include panda subpackages ## +add_subdirectory(src/pandabase) diff --git a/panda/src/pandabase/CMakeLists.txt b/panda/src/pandabase/CMakeLists.txt new file mode 100644 index 0000000000..25f065b222 --- /dev/null +++ b/panda/src/pandabase/CMakeLists.txt @@ -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} +)