Browse Source

CMake: Move panda version logic to dtoolbase

Sam Edwards 7 years ago
parent
commit
b08ab6324e

+ 9 - 0
dtool/src/dtoolbase/CMakeLists.txt

@@ -1,4 +1,10 @@
+configure_file(pandaVersion.h.in pandaVersion.h)
+configure_file(checkPandaVersion.h.in checkPandaVersion.h)
+configure_file(checkPandaVersion.cxx.in checkPandaVersion.cxx)
+
 set(P3DTOOLBASE_HEADERS
+    ${CMAKE_CURRENT_BINARY_DIR}/checkPandaVersion.h
+    ${CMAKE_CURRENT_BINARY_DIR}/pandaVersion.h
     addHash.I addHash.h
     atomicAdjust.h
     atomicAdjustDummyImpl.h atomicAdjustDummyImpl.I
@@ -38,6 +44,7 @@ set(P3DTOOLBASE_HEADERS
 )
 
 set(P3DTOOLBASE_SOURCES
+    ${CMAKE_CURRENT_BINARY_DIR}/checkPandaVersion.cxx
     addHash.cxx
     atomicAdjustDummyImpl.cxx
     atomicAdjustI386Impl.cxx
@@ -74,6 +81,8 @@ add_component_library(p3dtoolbase SYMBOL BUILDING_DTOOL_DTOOLBASE
 # The extensions need py_panda.h and extension.h from interrogatedb
 target_include_directories(p3dtoolbase PUBLIC
   $<TARGET_PROPERTY:p3interrogatedb,INTERFACE_INCLUDE_DIRECTORIES>)
+# Help other libraries find the autogenerated version headers
+target_include_directories(p3dtoolbase PUBLIC ${CMAKE_CURRENT_BINARY_DIR})
 target_use_packages(p3dtoolbase THREADS EIGEN)
 target_interrogate(p3dtoolbase ${P3DTOOLBASE_SOURCES} EXTENSIONS ${P3DTOOLBASE_IGATEEXT})
 

+ 1 - 1
dtool/src/dtoolutil/checkPandaVersion.cxx.in → dtool/src/dtoolbase/checkPandaVersion.cxx.in

@@ -18,4 +18,4 @@
 
 #include "dtoolbase.h"
 
-EXPCL_DTOOL_DTOOLUTIL int @PANDA_VERSION_SYMBOL@ = 0;
+EXPCL_DTOOL_DTOOLBASE int @PANDA_VERSION_SYMBOL@ = 0;

+ 1 - 1
dtool/src/dtoolutil/checkPandaVersion.h.in → dtool/src/dtoolbase/checkPandaVersion.h.in

@@ -28,7 +28,7 @@
 
 #include "dtoolbase.h"
 
-extern EXPCL_DTOOL_DTOOLUTIL int @PANDA_VERSION_SYMBOL@;
+extern EXPCL_DTOOL_DTOOLBASE int @PANDA_VERSION_SYMBOL@;
 
 #ifndef WIN32
 /* For Windows, exporting the symbol from the DLL is sufficient; the

+ 0 - 0
dtool/src/dtoolutil/pandaVersion.h.in → dtool/src/dtoolbase/pandaVersion.h.in


+ 0 - 8
dtool/src/dtoolutil/CMakeLists.txt

@@ -1,10 +1,4 @@
-configure_file(pandaVersion.h.in pandaVersion.h)
-configure_file(checkPandaVersion.h.in checkPandaVersion.h)
-configure_file(checkPandaVersion.cxx.in checkPandaVersion.cxx)
-
 set(P3DTOOLUTIL_HEADERS
-  ${CMAKE_CURRENT_BINARY_DIR}/checkPandaVersion.h
-  ${CMAKE_CURRENT_BINARY_DIR}/pandaVersion.h
   config_dtoolutil.h
   dSearchPath.I dSearchPath.h
   executionEnvironment.I executionEnvironment.h filename.I
@@ -38,7 +32,6 @@ if(APPLE)
 endif()
 
 set(P3DTOOLUTIL_SOURCES
-  ${CMAKE_CURRENT_BINARY_DIR}/checkPandaVersion.cxx
   config_dtoolutil.cxx
   dSearchPath.cxx
   executionEnvironment.cxx filename.cxx
@@ -73,7 +66,6 @@ composite_sources(p3dtoolutil P3DTOOLUTIL_SOURCES)
 
 add_component_library(p3dtoolutil SYMBOL BUILDING_DTOOL_DTOOLUTIL
   ${P3DTOOLUTIL_HEADERS} ${P3DTOOLUTIL_SOURCES})
-target_include_directories(p3dtoolutil PUBLIC ${CMAKE_CURRENT_BINARY_DIR})
 # The extensions need py_panda.h and extension.h from interrogatedb
 target_include_directories(p3dtoolutil PUBLIC
   $<TARGET_PROPERTY:p3interrogatedb,INTERFACE_INCLUDE_DIRECTORIES>)