Skip to content

Instantly share code, notes, and snippets.

@ctrlcctrlv
Created August 31, 2019 07:24
Show Gist options
  • Select an option

  • Save ctrlcctrlv/15d6852b46377906f3f46af50e381702 to your computer and use it in GitHub Desktop.

Select an option

Save ctrlcctrlv/15d6852b46377906f3f46af50e381702 to your computer and use it in GitHub Desktop.
diff --git a/src/plugins/CMakeLists.txt b/src/plugins/CMakeLists.txt
index fc8d2eed4..fceebb936 100644
--- a/src/plugins/CMakeLists.txt
+++ b/src/plugins/CMakeLists.txt
@@ -97,10 +97,15 @@ if(ENABLE_SCRIPTS AND ENABLE_PERL)
endif()
if(ENABLE_SCRIPTS AND ENABLE_PYTHON)
- find_package(Python)
- if(PYTHON_FOUND)
- add_subdirectory(python)
- endif()
+ find_package(Python2 2.7 COMPONENTS Development REQUIRED)
+
+if(PYTHON2_FOUND)
+ message(STATUS "got python")
+else()
+ message(FATAL_ERROR "fucked up")
+endif()
+
+add_subdirectory(python)
endif()
if(ENABLE_SCRIPTS AND ENABLE_RUBY)
diff --git a/src/plugins/python/CMakeLists.txt b/src/plugins/python/CMakeLists.txt
index 076e4c702..83902bc14 100644
--- a/src/plugins/python/CMakeLists.txt
+++ b/src/plugins/python/CMakeLists.txt
@@ -22,7 +22,7 @@ weechat-python-api.c weechat-python-api.h)
set_target_properties(python PROPERTIES PREFIX "")
-if(PYTHON_FOUND)
+if(PYTHON2_FOUND)
include_directories(${PYTHON_INCLUDE_DIRS})
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${PYTHON_LDFLAGS}")
target_link_libraries(python ${PYTHON_LIBRARIES} weechat_plugins_scripts coverage_config)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment