
if(UNIX)
  set(ENV{LD_LIBRARY_PATH} "@CMAKE_CURRENT_BINARY_DIR@/python-build/lib")
  set(ENV{CXX} "@CMAKE_CXX_COMPILER@")

  set(library_param --enable-shared)

  if(APPLE)
    set(library_param --enable-framework=@CMAKE_CURRENT_BINARY_DIR@/python-build)
  endif()

  EXECUTE_PROCESS(
    COMMAND sh configure --prefix=@CMAKE_CURRENT_BINARY_DIR@/python-build ${library_param} --enable-unicode=ucs2
    WORKING_DIRECTORY "@python_base@"
    RESULT_VARIABLE rv
    )
endif()
