Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ask cmake to find python if not on windows. #284

Merged
merged 1 commit into from
Jul 9, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 16 additions & 6 deletions newton-4.00/applications/toolsAndWrapers/newtonPy/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,11 @@ cmake_minimum_required(VERSION 3.9.0 FATAL_ERROR)

set (projectName "newtonPy")
message (${projectName})

set (swig "${CMAKE_SOURCE_DIR}/thirdParty/swigwin/swigwin-4.0.2/swig.exe")
if(MSVC OR MINGW)
set (swig "${CMAKE_SOURCE_DIR}/thirdParty/swigwin/swigwin-4.0.2/swig.exe")
else()
set (swig "/usr/bin/swig")
endif()
set (script "${CMAKE_SOURCE_DIR}/applications/toolsAndWrapers/newtonPy/newton.i")
execute_process(COMMAND ${swig} -c++ -python ${script})

Expand Down Expand Up @@ -43,11 +46,18 @@ include_directories(../../../sdk/dNewton/dModels/dCharacter)

add_library(${projectName} SHARED ${CPP_SOURCE})

#message ($ENV{PythonInclude})
target_include_directories(${projectName} BEFORE PRIVATE "$ENV{Python}/Include")

#message ("$ENV{Python}")
target_link_directories(${projectName} BEFORE PRIVATE "$ENV{Python}/Libs")
if (MSVC OR MINGW)
#message ($ENV{PythonInclude})
target_include_directories(${projectName} BEFORE PRIVATE "$ENV{Python}/Include")

#message ("$ENV{Python}")
target_link_directories(${projectName} BEFORE PRIVATE "$ENV{Python}/Libs")
else()
find_package (Python COMPONENTS Development REQUIRED)
target_include_directories(${projectName} PUBLIC ${Python_INCLUDE_DIRS})
target_link_libraries(${projectName} ${Python_LIBRARIES})
endif()

if (NEWTON_BUILD_CREATE_SUB_PROJECTS)
target_link_libraries (${projectName} ndNewton ndCollision ndCore)
Expand Down