From 6926fbfbe69520fd23ae4ff4cc2641185fa09a26 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Wed, 8 Mar 2017 01:44:27 -0700 Subject: [PATCH] CMake: Push Python links back to where they're actually needed This keeps the Panda3D core free of any Python-specific linkage --- direct/src/dcparser/CMakeLists.txt | 1 + direct/src/distributed/CMakeLists.txt | 1 + dtool/src/dtoolbase/CMakeLists.txt | 2 +- dtool/src/dtoolutil/CMakeLists.txt | 3 --- dtool/src/interrogatedb/CMakeLists.txt | 1 + 5 files changed, 4 insertions(+), 4 deletions(-) diff --git a/direct/src/dcparser/CMakeLists.txt b/direct/src/dcparser/CMakeLists.txt index 917d517774..a959ba7695 100644 --- a/direct/src/dcparser/CMakeLists.txt +++ b/direct/src/dcparser/CMakeLists.txt @@ -50,6 +50,7 @@ add_library(p3dcparser ${P3DCPARSER_HEADERS} ${P3DCPARSER_SOURCES} ${P3DCPARSER_PARSER_SOURCES}) set_target_properties(p3dcparser PROPERTIES COMPILE_DEFINITIONS WITHIN_PANDA) target_link_libraries(p3dcparser p3directbase p3express p3pstatclient p3prc) +target_use_packages(p3dcparser PYTHON) target_interrogate(p3dcparser ${P3DCPARSER_HEADERS} ${P3DCPARSER_SOURCES}) install(TARGETS p3dcparser DESTINATION lib) diff --git a/direct/src/distributed/CMakeLists.txt b/direct/src/distributed/CMakeLists.txt index 1b4c06be44..a04ba893a4 100644 --- a/direct/src/distributed/CMakeLists.txt +++ b/direct/src/distributed/CMakeLists.txt @@ -14,6 +14,7 @@ if(HAVE_PYTHON) add_library(p3distributed ${P3DISTRIBUTED_HEADERS} ${P3DISTRIBUTED_SOURCES}) set_target_properties(p3distributed PROPERTIES COMPILE_DEFINITIONS WITHIN_PANDA) target_link_libraries(p3distributed p3directbase p3dcparser p3pgraph) + target_use_packages(p3distributed PYTHON) if(WANT_NATIVE_NET) target_link_libraries(p3distributed p3nativenet) endif() diff --git a/dtool/src/dtoolbase/CMakeLists.txt b/dtool/src/dtoolbase/CMakeLists.txt index fa6f94b6b1..95e9c2e2e0 100644 --- a/dtool/src/dtoolbase/CMakeLists.txt +++ b/dtool/src/dtoolbase/CMakeLists.txt @@ -65,7 +65,7 @@ set(P3DTOOLBASE_SOURCES composite_sources(p3dtoolbase P3DTOOLBASE_SOURCES) add_library(p3dtoolbase ${P3DTOOLBASE_HEADERS} ${P3DTOOLBASE_SOURCES}) -target_use_packages(p3dtoolbase THREADS PYTHON) +target_use_packages(p3dtoolbase THREADS) install(TARGETS p3dtoolbase DESTINATION lib) install(FILES ${P3DTOOLBASE_HEADERS} DESTINATION include/panda3d) diff --git a/dtool/src/dtoolutil/CMakeLists.txt b/dtool/src/dtoolutil/CMakeLists.txt index de973ec598..3a6b01c1e7 100644 --- a/dtool/src/dtoolutil/CMakeLists.txt +++ b/dtool/src/dtoolutil/CMakeLists.txt @@ -58,9 +58,6 @@ composite_sources(p3dtoolutil P3DTOOLUTIL_SOURCES) add_library(p3dtoolutil ${P3DTOOLUTIL_HEADERS} ${P3DTOOLUTIL_SOURCES}) target_link_libraries(p3dtoolutil p3dtoolbase ${CMAKE_DL_LIBS}) -if(HAVE_PYTHON) - target_link_libraries(p3dtoolutil ${PYTHON_LIBRARIES}) -endif() if(APPLE) find_library(FOUNDATION_LIBRARY Foundation) diff --git a/dtool/src/interrogatedb/CMakeLists.txt b/dtool/src/interrogatedb/CMakeLists.txt index fddc089a3e..798335b2b5 100644 --- a/dtool/src/interrogatedb/CMakeLists.txt +++ b/dtool/src/interrogatedb/CMakeLists.txt @@ -29,6 +29,7 @@ composite_sources(p3interrogatedb P3INTERROGATEDB_SOURCES) add_library(p3interrogatedb ${P3INTERROGATEDB_HEADERS} ${P3INTERROGATEDB_SOURCES}) target_link_libraries(p3interrogatedb p3dconfig) +target_use_packages(p3interrogatedb PYTHON) install(TARGETS p3interrogatedb DESTINATION lib) install(FILES ${P3INTERROGATEDB_HEADERS} DESTINATION include/panda3d)